-
(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 -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
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) Test Python support using act for GitHub Actions:
act_amd -j build
Note: If
act
is unable to locate Docker, make sure that the required/var/run/docker.sock
symlink exists. If it does not, you can fix it by running:sudo ln -s "$HOME/.docker/run/docker.sock" /var/run/docker.sock`
-
(Optional) Build the PyPI package independent of deployment:
make build
-
(Optional) Test packages for PyPI deployment:
make verify_build
-
(Optional) Check MkDocs documentation by serving it at http://localhost:8000/ locally:
make test_docs
-
(Optional) Build the PyPI package and MkDocs documentation independent of deployment:
make docs
Note: Running
make test_docs
from the previous step recreates the documentation without building the PyPI package withsetup.py
. -
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 test_deploy
-
Deploy YFPY by building the PyPI packages, recreating the documentation, and deploying to PyPI:
make 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 private-github.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