Development

For users who would 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.

requirements-min.txt
1numpy==1.17.3
2numba==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 the dependencies since their versions are satisfactory
$ python3 -m pip install -e galois

Lint the package

Linting is done with pylint. The linting dependencies are stored in requirements-lint.txt.

requirements-lint.txt
1pylint

Install the linter dependencies.

$ python3 -m pip install -r requirements-lint.txt

Run the linter.

$ python3 -m pylint --rcfile=setup.cfg galois/

Run the unit tests

Unit testing is done through pytest. The tests themselves are stored in tests/. We test against test vectors, stored in tests/data/. generated using SageMath. See the scripts/generate_test_vectors.py script. The testing dependencies are stored in requirements-test.txt.

requirements-test.txt
1pytest
2pytest-cov

Install the test dependencies.

$ python3 -m pip install -r requirements-test.txt

Run the unit tests.

$ python3 -m pytest tests/

Build the documentation

The documentation is generated with Sphinx. The dependencies are stored in requirements-doc.txt.

requirements-doc.txt
1sphinx>=3
2recommonmark>=0.5
3sphinx_rtd_theme>=0.5
4readthedocs-sphinx-ext>=1.1
5ipykernel
6nbsphinx
7pandoc
8numpy

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/