Simple template for a Python package.
pip install -U cookiecutter
cookiecutter https://github.com/network-science-lab/cookiecutter-pypackage.git
authors
should be separeted by ,
.
Try to keep your code simple.
Remember to declaring types and try to avoid type Any
.
Use apropriete commit names to make it easier for other people understanding your code (Convetional Commits specification - https://www.conventionalcommits.org/en/v1.0.0/)
It is important part of developing features to providing test cases that will allow to check different use cases (happy path, expected errors etc). We strongly suggest committing to pytest
as our testing tool. All tests should be organized in tests
module, python files should have test
prepend in the name as well as testing functions. Good test should have 3 seperated parts:
- Arrange - preparing input for tested functionality,
- Act - invoking functionality,
- Assert - checking whether the test case ended as expected.
Remember to use code formatting tools and verify is everything alright before pushing changes by using tox
.
pip install -U black isort flake8 mypy pylint tox
Usage
black <DIR>
isort <DIR>
flake8 <DIR>
mypy <DIR>
pylint <DIR>
tox
Never push commits to master branch, create seperate for functionalities that you are developing and create appropriete pull requests
- Remember to assign yourself to your PR,
- Request to at least 2 other people to review your changes,
- Put the PR updates in the separate commits for making easier reviewing the changes,
- Before the merge squash commits for clarity in the git history.