From 62bbb9bdce6e3a322a5693b08f28669a8dd0db97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Requero?= Date: Thu, 6 Nov 2025 11:33:10 +0100 Subject: [PATCH 1/6] Fix import path for version module --- src/python_app_template/cli/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python_app_template/cli/main.py b/src/python_app_template/cli/main.py index 3699030..4d8be48 100644 --- a/src/python_app_template/cli/main.py +++ b/src/python_app_template/cli/main.py @@ -1,7 +1,7 @@ import sys import logging -from .version import __version__ +from ..version import __version__ logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) From 9718d6340ed4a326673fa67830b4204c82aea642 Mon Sep 17 00:00:00 2001 From: Raul Date: Thu, 6 Nov 2025 15:58:18 +0100 Subject: [PATCH 2/6] pin pip==25.2 and use linux images --- Makefile | 2 +- docker-compose.yml | 11 +++++++---- pyproject.toml | 20 ++++++++++---------- requirements.txt | 16 ++++++++-------- tests/cli/test_main.py | 5 +++++ 5 files changed, 31 insertions(+), 23 deletions(-) create mode 100644 tests/cli/test_main.py diff --git a/Makefile b/Makefile index 230252b..b621f32 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ venv: .PHONY: upgrade-pip ## Upgrades pip. upgrade-pip: - python -m pip install -U pip + python -m pip install pip==25.2 .PHONY: install-test ## Install and only test dependencies. install-test: upgrade-pip diff --git a/docker-compose.yml b/docker-compose.yml index fe26248..44b0ec6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,26 +1,29 @@ services: gcloud: image: google/cloud-sdk:latest + platform: linux/amd64 volumes: - - "gcp:/root/.config/" + - 'gcp:/root/.config/' entrypoint: gcloud dev: build: context: . target: dev + platform: linux/amd64 volumes: - - ".:/opt/project" - - "gcp:/root/.config/" + - '.:/opt/project' + - 'gcp:/root/.config/' entrypoint: /bin/bash test: + platform: linux/amd64 # Runs tests using the production Docker image. # Intended to be executed in the GitHub CI environment. build: context: . target: test - entrypoint: "pytest -v" + entrypoint: 'pytest -v' volumes: gcp: external: true diff --git a/pyproject.toml b/pyproject.toml index c9cb008..374a07f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ namespaces = false "assets" = ["*"] [project] -name = "python-app-template" +name = "my-project-name" version = "0.1.0" description = "A template for python (dockerized) applications." readme = "README.md" @@ -33,19 +33,19 @@ classifiers = [ requires-python = ">= 3.9" dependencies = [ "pyyaml~=6.0", - "rich~=13.9", + "rich~=14.0", "rich-argparse~=1.6", ] [project.urls] -Homepage = "https://github.com/GlobalFishingWatch/python-app-template" -Documentation = "https://globalfishingwatch.github.io/python-app-template/" -Changelog = "https://github.com/GlobalFishingWatch/python-app-template/blob/main/CHANGELOG.md" -Repository = "https://github.com/GlobalFishingWatch/python-app-template" -Issues = "https://github.com/GlobalFishingWatch/python-app-template/issues" +Homepage = "https://github.com/GlobalFishingWatch/my-project-name" +Documentation = "https://globalfishingwatch.github.io/my-project-name/" +Changelog = "https://github.com/GlobalFishingWatch/my-project-name/blob/main/CHANGELOG.md" +Repository = "https://github.com/GlobalFishingWatch/my-project-name" +Issues = "https://github.com/GlobalFishingWatch/my-project-name/issues" [project.scripts] -python-app-template = "python_app_template.cli.main:main" +my-project-name = "my_project_name.cli.main:main" [project.optional-dependencies] # Linting and code quality tools @@ -63,7 +63,7 @@ lint = [ # Development workflow and tools dev = [ "pre-commit~=4.2", # Framework for managing pre-commit hooks. - "pip-tools~=7.0", # Freezing dependencies for production containers. + "pip-tools>=7.4,<8.0", # Compatible with pip 24+, fixes use_pep517 AttributeError. "pip-audit~=2.8", # Audit for finding vulnerabilities in dependencies. ] @@ -140,7 +140,7 @@ disallow_untyped_calls = false [tool.pytest.ini_options] minversion = "6.0" testpaths = ["tests"] -addopts = "-v --cov=python_app_template --cov=init_project --cov-report=term-missing" +addopts = "-v --cov=my_project_name --cov=init_project --cov-report=term-missing" [tool.coverage.run] branch = true diff --git a/requirements.txt b/requirements.txt index c8542a3..62f32f9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,17 +4,17 @@ # # pip-compile --output-file=requirements.txt # -markdown-it-py==3.0.0 +markdown-it-py==4.0.0 # via rich mdurl==0.1.2 # via markdown-it-py -pygments==2.19.1 +pygments==2.19.2 # via rich -pyyaml==6.0.2 - # via python-app-template (setup.py) -rich==13.9.4 +pyyaml==6.0.3 + # via my-project-name (setup.py) +rich==14.2.0 # via - # python-app-template (setup.py) + # my-project-name (setup.py) # rich-argparse -rich-argparse==1.7.0 - # via python-app-template (setup.py) +rich-argparse==1.7.2 + # via my-project-name (setup.py) diff --git a/tests/cli/test_main.py b/tests/cli/test_main.py new file mode 100644 index 0000000..706d917 --- /dev/null +++ b/tests/cli/test_main.py @@ -0,0 +1,5 @@ +from python_app_template.cli.main import main + + +def test_main(): + main() From bee623578e5f6523ca7510bf93192041ba005c34 Mon Sep 17 00:00:00 2001 From: Raul Date: Thu, 6 Nov 2025 15:59:28 +0100 Subject: [PATCH 3/6] fix name --- pyproject.toml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 374a07f..2dd2177 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ namespaces = false "assets" = ["*"] [project] -name = "my-project-name" +name = "python-app-template" version = "0.1.0" description = "A template for python (dockerized) applications." readme = "README.md" @@ -38,14 +38,14 @@ dependencies = [ ] [project.urls] -Homepage = "https://github.com/GlobalFishingWatch/my-project-name" -Documentation = "https://globalfishingwatch.github.io/my-project-name/" -Changelog = "https://github.com/GlobalFishingWatch/my-project-name/blob/main/CHANGELOG.md" -Repository = "https://github.com/GlobalFishingWatch/my-project-name" -Issues = "https://github.com/GlobalFishingWatch/my-project-name/issues" +Homepage = "https://github.com/GlobalFishingWatch/python-app-template" +Documentation = "https://globalfishingwatch.github.io/python-app-template/" +Changelog = "https://github.com/GlobalFishingWatch/python-app-template/blob/main/CHANGELOG.md" +Repository = "https://github.com/GlobalFishingWatch/python-app-template" +Issues = "https://github.com/GlobalFishingWatch/python-app-template/issues" [project.scripts] -my-project-name = "my_project_name.cli.main:main" +python-app-template = "my_project_name.cli.main:main" [project.optional-dependencies] # Linting and code quality tools From 9199121ee3016b0bc2e9793459176c39ebf5701a Mon Sep 17 00:00:00 2001 From: Raul Date: Thu, 6 Nov 2025 15:59:56 +0100 Subject: [PATCH 4/6] fix requirements.txt --- requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 62f32f9..240e028 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,10 +11,10 @@ mdurl==0.1.2 pygments==2.19.2 # via rich pyyaml==6.0.3 - # via my-project-name (setup.py) + # via python-app-template (setup.py) rich==14.2.0 # via - # my-project-name (setup.py) + # python-app-template (setup.py) # rich-argparse rich-argparse==1.7.2 - # via my-project-name (setup.py) + # via python-app-template (setup.py) From e1e84396a6bec1129bd0073edce3bb49788e5a16 Mon Sep 17 00:00:00 2001 From: Raul Date: Thu, 6 Nov 2025 20:30:03 +0100 Subject: [PATCH 5/6] fix default name --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2dd2177..dc148c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,7 @@ Repository = "https://github.com/GlobalFishingWatch/python-app-template" Issues = "https://github.com/GlobalFishingWatch/python-app-template/issues" [project.scripts] -python-app-template = "my_project_name.cli.main:main" +python-app-template = "python-app-template.cli.main:main" [project.optional-dependencies] # Linting and code quality tools @@ -140,7 +140,7 @@ disallow_untyped_calls = false [tool.pytest.ini_options] minversion = "6.0" testpaths = ["tests"] -addopts = "-v --cov=my_project_name --cov=init_project --cov-report=term-missing" +addopts = "-v --cov=python-app-template --cov=init_project --cov-report=term-missing" [tool.coverage.run] branch = true From a9e2f9068e0f3ab21a1f59afc5960d3814a4cbf5 Mon Sep 17 00:00:00 2001 From: Raul Date: Thu, 6 Nov 2025 20:32:11 +0100 Subject: [PATCH 6/6] fix default name --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index dc148c3..754ae4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,7 @@ Repository = "https://github.com/GlobalFishingWatch/python-app-template" Issues = "https://github.com/GlobalFishingWatch/python-app-template/issues" [project.scripts] -python-app-template = "python-app-template.cli.main:main" +python-app-template = "python_app_template.cli.main:main" [project.optional-dependencies] # Linting and code quality tools @@ -140,7 +140,7 @@ disallow_untyped_calls = false [tool.pytest.ini_options] minversion = "6.0" testpaths = ["tests"] -addopts = "-v --cov=python-app-template --cov=init_project --cov-report=term-missing" +addopts = "-v --cov=python_app_template --cov=init_project --cov-report=term-missing" [tool.coverage.run] branch = true