Skip to content

Commit

Permalink
Issues #218: track and check required version of python for development
Browse files Browse the repository at this point in the history
  • Loading branch information
tcgoetz committed Feb 19, 2024
1 parent 022624d commit 1025df7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ all: update_dbs
# install all needed code
setup_repo: $(CONF_DIR)/GarminConnectConfig.json $(PROJECT_BASE)/.venv submodules_update

setup_install: deps devdeps install_all
setup_install: version_check deps devdeps install_all

setup: setup_repo setup_install

Expand Down Expand Up @@ -68,6 +68,9 @@ $(PROJECT_BASE)/.venv:
clean_venv:
rm -rf $(PROJECT_BASE)/.venv

version_check:
python -c 'import sys; import garmindb.version; garmindb.version.python_dev_version_check(sys.argv[0])'

update: submodules_update
git pull

Expand Down
9 changes: 7 additions & 2 deletions garmindb/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import idbutils.version as uv

from .version_info import python_required, python_tested, version_info, prerelease
from .version_info import dev_python_required, python_required, python_tested, version_info, prerelease


version_string = uv.to_string(version_info, prerelease)
Expand All @@ -23,5 +23,10 @@ def log_version(program):


def python_version_check(program):
"""Validate the Python version requirements."""
"""Validate the Python version requirements for a pip installed package."""
uv.python_version_check(program, python_required, python_tested)


def python_dev_version_check(program):
"""Validate the Python version requirements for development."""
uv.python_version_check(program, dev_python_required, python_tested, verbose=True)
3 changes: 2 additions & 1 deletion garmindb/version_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@


python_required = (3, 0, 0)
dev_python_required = (3, 9, 0)
python_tested = (3, 11, 4)
version_info = (3, 5, 3)
version_info = (3, 5, 4)
prerelease = True


Expand Down

0 comments on commit 1025df7

Please sign in to comment.