A complete sample project:
- Source code in
src
and tests intests
- Source code organized in a module, specified in
setup.py
.gitignore
ignores all generated filesMakefile
allows users to run static analysis and tests withmake
. You can also clean up generated files withmake clean
pylintrc
defines configuration forpylint
/pytest.ini
defines configuration forpytest
- Python libraries used are specified in
requirements.txt
Jenkinsfile
defines steps for CI
-
Create/Activate a virtual environment
python3 -m venv .venv source .venv/bin/activate
-
Install libraries
pip install -r requirements.txt
-
Install source code as a module
pip install -e .
Type make
to run:
- Static analysis using
flake8
,pycodestyle
, andpylint
- Run
pytest
with coverage. The coverage metric is set to 95%