Skip to content

Development

Installing for development and/or improving the package

$ git clone https://github.com/cahthuranag/agenet.git
$ cd agenet
$ python -m venv env
$ source env/bin/activate
$ pip install -e .[dev]
$ pre-commit install

On Windows replace source env/bin/activate with . env\Scripts\activate.

Run tests

Tests can be executed with the following command:

$ pytest

To generate a test coverage report, run pytest as follows:

$ pytest --cov=agenet --cov-report=html

Build docs

Considering we're in the agenet folder, run the following commands:

$ cd docs
$ mkdocs build

The generated documentation will be placed in docs/site. Alternatively, the documentation can be generated and served locally with:

$ mkdocs serve

Code style

Code style is enforced with flake8 (and a number of plugins), black, and isort. Some highlights include, but are not limited to:

  • Encoding: UTF-8
  • Indentation: 4 spaces (no tabs)
  • Line size limit: 88 chars
  • Newlines: Unix style, i.e. LF or \n