This is a template repository for starting a python project. Includes the following automated testing:
pytest: unit testsmypy: type hintsflake8: lintertox: test multiple environments
Include / remove the packages you need for your project.
GitHub Actions are configured to run on a push or PR to the master branch.
Badge from GitHub Actions:
- Project dependencies:
requirements.txt - Development dependencies:
requirements_dev.txt
Use a virtual environment:
python -m venv venv
venv/scripts/activate (Win) or source venv\bin\activate (Linux)
The test/ folder uses a general import of the packages inside src/ so that the relative path doesn't matter.
Install the packages in src/ using: pip install -e . (edit mode install)
The files setup.cfg and setup.py define how the packages will be installed.
Run unit tests and generate code coverage report.
Configuration: pytest.ini
Check the python code for correct type hinting.
Configuration file: mypy.ini
Python linter. Check the code formatting.
Configuration: inside setup.cfg
Run the tests in multiple python environments
Configuration: tox.ini
Run the tests on certain events.
Configuration: .github/workflows/test.yml and also tox.ini