Install Python 3 if you don't have it already: https://www.python.org/downloads/
Install Pipenv to manage Python environments and pip dependencies
python3 -m pip install pipenv
(You may need to source .bash_profile)
Development should be done inside a Pipenv environment. Create and enter your Pipenv environment with:
PIPENV_VENV_IN_PROJECT=1 python3 -m pipenv install --dev
PIPENV_VENV_IN_PROJECT=1 python3 -m pipenv shell
PIPENV_VENV_IN_PROJECT
will place the virtual environment in ./.venv/
.
On macOS you may get an error if you don't have the needed developer tools. You can use xcode-select --install
to fix that.
Library dependencies must be listed in setup.py.
Dependencies for the development environment, such as development tools, should be listed in the Pipfile.
After adding new dependencies, run pipenv install
to refresh the environment.
Run the linter:
pylint netanalysis
Run the type checker:
mypy netanalysis
Run the unit tests:
python -m unittest -v