This section describes how to install pynautobot for development, how to run tests, and make sure you are a good contributor.
main
- Reserved for released codedevelop
- Planned next release code<feature>
- Individual feature branches, should be based on and PR'd withdevelop
This leverages Python 3.8 or later.
This repository uses poetry for dependency management and invoke for task execution.
Follow these steps to set up your local development environment:
# Double check your version
$ python --version
Python 3.8.7
# Activate the Poetry environment, which will auto create the virtual environment related to the project
$ poetry shell
# Install project dependencies as well as development dependencies
$ poetry install
When you install dependencies via Poetry you will get invoke as part of the process.
Python Invoke provides a help context invoke --list
to help identify possible commands to use. The invoke commands in turn execute the commands necessary to run the linting and unit tests.
- Execute
poetry shell
to enter the virtual environment for the project - Execute
poetry install
to install the dependencies - Execute
invoke black --local
to execute the black style check - Execute
invoke pytest --local
to execute pytest
All tests should be located within the tests/
directory with tests/unit
for the unit tests. Integration tests should be in the tests/integration
directory.
The following linting tasks are required:
- Bandit
- Pydocstyle
- Yamllint
- Flake8
- Black vs Flake conflicts: When conflicts arise between Black and Flake8, Black should win and Flake8 should be configured as such