-
(Optional) Clear virtual machine of old requirements:
pip uninstall -y -r <(pip freeze)
-
(Optional) Check
requirements.txt
andrequirement-dev.txt
for latest dependency versions. -
(Optional) Update virtual machine with the latest dependencies:
pip install -r requirements.txt pip install -r requirements-dev.txt
-
Lint code with
flake8
:flake8 . --count --show-source --statistics
-
Check code security with
bandit
:bandit -r yfpy/
-
Run all
pytest
tests (see following commands for running subsets of tests):python -m pytest
-
Run all
pytest
tests verbosely:python -m pytest -v -s
-
Run
pytest
unit tests:python -m pytest -v -s -m unit
-
Run
pytest
integration tests:python -m pytest -v -s -m integration
-
(Optional) Run all tests from
pytest
file:python -m pytest -v -s -m integration test/integration/test_api_game_data.py
-
(Optional) Run specific test from
pytest
file:python -m pytest -v -s -m integration test/integration/test_api_game_data.py -k test_get_game_key_by_season
-
(Optional) Build the documentation and PyPI package independent of deployment:
make -C docs-sphinx docs
Note: You can run
make -C docs-sphinx docs_no_build
to recreate documentation without building the PyPI package withsetup.py
. -
(Optional) Check Sphinx documentation locally:
make -C docs-sphinx open_local_docs
-
Create a git commit:
git add . git commit -m 'commit message'
-
Update the git tag with the new version:
git tag -a [tag_name/version] -m [message]
git tag -a v1.0.0 -m 'release message' git push origin --tags
-
Install
twine
(if not already installed):pip install twine
-
(Optional) Test deployment by building the PyPI packages, recreating the documentation, and deploying to Test PyPI:
make -C docs-sphinx test_deploy
-
Deploy YFPY by building the PyPI packages, recreating the Sphinx documentation, and deploying to PyPI:
make -C docs-sphinx deploy
-
Build Docker container:
docker compose -f compose.yaml -f compose.build.yaml build
-
(If needed) Authenticate with GitHub Personal Access Token (PAT):
jq -r .github_personal_access_token.value auth/github/private.json | docker login ghcr.io -u uberfastman --password-stdin
-
Deploy the newly-built Docker image with respective major, minor, and patch version numbers to the GitHub Container Registry:
docker push ghcr.io/uberfastman/yfpy:X.X.X
-
Create a second git commit with updated version number and documentation:
git add . git commit -m 'update version number and docs'
-
Update YFPY GitHub repository:
git push