Development¶
For users who’d like to actively develop with galois
, these sections may prove helpful.
Install for development¶
The the latest code from master
can be checked out and installed locally in an “editable” fashion.
$ git clone https://github.com/mhostetter/galois.git
$ python3 -m pip install -e galois
Install for development with min dependencies¶
The package dependencies have minimum supported version. They are stored in requirements-min.txt
.
1 2 | numpy==1.17.3
numba==0.49
|
pip
installing galois
will install the latest versions of the dependencies. If you’d like to test against
the oldest supported dependencies, you can do the following:
$ git clone https://github.com/mhostetter/galois.git
# First install the minimum version of the dependencies
$ python3 -m pip install -r galois/requirements-min.txt
# Then installing the package won't upgrade those dependencies
$ python3 -m pip install -e galois
Locally lint the package¶
Linting is done with pylint. The linting dependencies are stored in requirements-lint.txt
.
1 | pylint
|
Install the linter dependencies.
$ python3 -m pip install -r requirements-lint.txt
Run the linter.
$ python3 -m pylint --rcfile=setup.cfg galois/
Locally run the unit tests¶
The unit testing is done through pytest. The tests themselves are stored in tests/
. We test
against test vectors, stored in tests/data/
. generated from the SageMath package.
See the scripts/generate_test_vectors.py
script. The testing dependencies are stored in requirements-test.txt
.
1 2 | pytest
pytest-cov
|
Install the test dependencies.
$ python3 -m pip install -r requirements-test.txt
Run the unit tests.
$ python3 -m pytest tests/
Locally build the documentation¶
The documentation is generated with Sphinx. The dependencies are
stored in requirements-doc.txt
.
1 2 3 4 5 6 7 | sphinx>=3
recommonmark>=0.5
sphinx_rtd_theme>=0.5
readthedocs-sphinx-ext>=1.1
ipykernel
nbsphinx
numpy
|
Install the documentation dependencies.
$ python3 -m pip install -r requirements-doc.txt
Build the HTML documentation. The index page will be located at docs/build/index.html
.
$ sphinx-build -b html -v docs/build/