@@ -36,7 +36,9 @@ The Python package is based on the following toolchain:
3636├── dist Reserved folder for build artifacts
3737├── docs Sphinx documentation
3838├── src Python package source code
39- └── tests Python tests
39+ ├── tests Python tests
40+ └── tools Scripts
41+
4042```
4143
4244## Build, test and deploy instructions
@@ -52,37 +54,53 @@ Note: the Python virtual environment can be removed using `pipenv --rm`.
5254
5355** IMPORTANT:** all of the following commands have to be executed within the Python virtual environment!
5456
55- Build the Sphinx documentation:
57+ ### Build documentation
58+
59+ Build the Sphinx documentation: ` ./tools/build-docs.sh `
5660
5761``` bash
5862pip install -e . # package installation is required for Git version
5963cd docs
6064make html
6165```
6266
63- Build the Python package:
67+ ### Build Python package
68+
69+ Build the Python package: ` ./tools/build-package.sh `
6470
6571``` bash
6672python -m build --wheel
6773```
6874
69- Execute static code analysis:
75+ ### Run Python linters
76+
77+ Run static code analysis: ` ./tools/lint-package.sh `
7078
7179``` bash
72- flake8 src/python_training_project --format=pylint > flake8.log
73- pylint src/python_training_project --msg-template=" {path}:{line}: [{msg_id}, {obj}] {msg} ({symbol})" > pylint.log
74- mypy src/python_training_project > mypy.log
80+ mkdir -p build
81+ flake8 src/python_training_project --format=pylint > build/flake8.txt
82+ pylint src/python_training_project --msg-template=" {path}:{line}: [{msg_id}, {obj}] {msg} ({symbol})" > build/pylint.txt
83+ mypy src/python_training_project > build/mypy.txt
7584```
7685
77- Execute Python tests:
86+ ### Run Python tests
87+
88+ Run Python tests: ` ./tools/test-package.sh `
7889
7990``` bash
8091pip install -e . # package installation is required for path resolution
92+ mkdir -p build
8193pytest
8294```
8395
84- Deploy the Python package:
96+ ### Deploy Python package
97+
98+ Deploy the Python package: ` ./tools/deploy-package.sh `
8599
86100``` bash
87- twine upload --repository-url REPOSITORY_URL --username USERNAME --password PASSWORD dist/*
101+ # Make sure to set the following environment variables
102+ # TWINE_REPOSITORY_URL
103+ # TWINE_USERNAME
104+ # TWINE_PASSWORD
105+ twine upload dist/*
88106```
0 commit comments