Developing for Dissect#
Tip
Thinking about writing your own Dissect module? Awesome! We kindly ask that you use the dissect.contrib.*
namespace!
Development#
Dissect is build and tested against Python 3.9 (CPython and PyPy). Older versions may not work, as features are used which
may not yet be supported by these versions (for example @cached_property
is only supported since Python 3.9).
Newer versions will probably work, but are not guaranteed to.
To build and test Dissect projects, tox is used. A minimum version of 3.8 is required.
When developing for Dissect, please make sure you follow the style guide. It helps to improve the quality of the code by making it more uniform in appearance which should increase the understandability and maintainability. It will also make the reviewing process easier and reduces the number of iterations to get the code in a mergable shape.
Building & testing#
The build uses PEP 517 and PEP 518. Together with tox
’s isolated_build
feature this ensures there are no hidden
dependencies on locally installed packages.
The tox.ini
configuration file together with the pyproject.toml
and setup.py
files will make sure the correct
versions of all build, test and install dependencies (including the version of tox
itself) are present or are
installed during the build and test runs.
Building#
To build source and wheel distributions of a project, run tox
with the build
testenv:
$ tox -e build
The source and wheel distributions are put in the dist/
directory in the root of the project. Building is done using
the default CPython 3 version on your system.
Testing#
The default tox
run will lint and unit test the code:
$ tox
Linting is done using flake8 and unit tests (if applicable) are run against the default installed CPython 3 and PyPy 3. Make sure that the default Python version on your system is 3.9 if you want to run the unit tests using a supported Python version.
To explicitly run the unit tests against a Python version use:
$ tox -e py310
Or in case of using PyPy:
$ tox -e pypy310
To run just the linting:
$ tox -e lint