From f888776a8e1e065fcb417a8a0f527879623ce668 Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Wed, 12 Aug 2026 01:06:21 -0600 Subject: [PATCH 1/5] fix: put the repository root on pytest's path so the client tests collect pytest.ini listed the package directories themselves, which supports preponderous.viron... imports, while the client and every test module import through src.main.python.preponderous.viron... and need the root instead. All eight test modules failed collection with ModuleNotFoundError: No module named 'src'. Point pythonpath at the root to match the import style already in use, and pin testpaths so a bare pytest run only picks up the client suite. Co-Authored-By: Claude Opus 5 (1M context) --- pytest.ini | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pytest.ini b/pytest.ini index a08953c..68582e2 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,3 +1,6 @@ [pytest] -pythonpath = ./src/main/python - ./src/test/python \ No newline at end of file +# The client and its tests import through the full path from the repository +# root (src.main.python.preponderous.viron...), so the root is what belongs on +# the path. +pythonpath = . +testpaths = src/test/python From 69d45c4b4f1da926e585ab9d8b95c2325c0ce077 Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Wed, 12 Aug 2026 01:06:27 -0600 Subject: [PATCH 2/5] fix: annotate get_all_environments with typing.List for Python 3.8 environmentService was the only service using a PEP 585 builtin generic (list[Environment]); its siblings all use typing.List. Builtin generics in annotations are evaluated when the class body runs and are not subscriptable before Python 3.9, so importing EnvironmentService raised TypeError there and test_environmentService.py could not be collected. Co-Authored-By: Claude Opus 5 (1M context) --- .../python/preponderous/viron/services/environmentService.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/python/preponderous/viron/services/environmentService.py b/src/main/python/preponderous/viron/services/environmentService.py index 35bee0b..29cb96a 100644 --- a/src/main/python/preponderous/viron/services/environmentService.py +++ b/src/main/python/preponderous/viron/services/environmentService.py @@ -2,7 +2,7 @@ # Copyright (c) 2024 Preponderous Software # MIT License -from typing import Optional +from typing import List, Optional import requests from src.main.python.preponderous.viron.models.environment import Environment @@ -18,7 +18,7 @@ def get_base_url(self) -> str: def get_auth_headers(self) -> dict: return {"Authorization": f"Bearer {self.auth_token}"} if self.auth_token else {} - def get_all_environments(self) -> list[Environment]: + def get_all_environments(self) -> List[Environment]: response = requests.get(f"{self.get_base_url()}", headers=self.get_auth_headers()) response.raise_for_status() return [Environment(**env) for env in response.json()] From 66398acb44e0aa4f9dd55af2529085740ac783bd Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Wed, 12 Aug 2026 01:06:27 -0600 Subject: [PATCH 3/5] docs: document how to run the Python client test suite The README mentioned the client directory but never said how to test it, and did not note that CI covers the Java build only. Co-Authored-By: Claude Opus 5 (1M context) --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 66ba448..4e055ec 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,7 @@ viron/ │ └── services/ # Business logic ├── src/main/python/ # Python client SDK ├── src/test/java/... # Unit and integration tests + ├── src/test/python/... # Python client SDK tests (pytest) ├── db-scripts/ # SQL schema setup scripts, and migrations for existing databases ├── docs/ │ ├── MVP.md # Implementation checklist for MVP @@ -152,9 +153,17 @@ or refer to the `docs/openapi/viron-api.json` file. ## 🧪 Testing -Run all unit and integration tests: +Run all Java unit and integration tests: mvn test +Run the Python client tests (requires Python 3.8+ and `pip install -r requirements.txt`): +pytest + +`pytest.ini` puts the repository root on the path, so the client is imported the same way +from tests as it is from application code (`src.main.python.preponderous.viron...`). +Note that CI runs the Java build and tests only — Python client changes are not covered there +and must be checked locally. + --- ## 📄 License From b3b8fe3e1678a6d93eb26a11e1402f5f1e939c48 Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Wed, 12 Aug 2026 01:09:42 -0600 Subject: [PATCH 4/5] fix: drop the unnecessary testpaths setting and warn about the pinned pytest testpaths changed nothing measurable: a bare pytest run collects the same 107 tests without it, since no other test_*.py exists in the tree. The README now also records that pytest.ini's pythonpath setting arrived in pytest 7.0, so the 6.2.4 pinned by requirements.txt ignores it. Co-Authored-By: Claude Opus 5 (1M context) --- README.md | 7 +++++-- pytest.ini | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4e055ec..9c3ac89 100644 --- a/README.md +++ b/README.md @@ -156,11 +156,14 @@ or refer to the `docs/openapi/viron-api.json` file. Run all Java unit and integration tests: mvn test -Run the Python client tests (requires Python 3.8+ and `pip install -r requirements.txt`): +Run the Python client tests (requires Python 3.8+, `requests`, and pytest 7 or newer): pytest `pytest.ini` puts the repository root on the path, so the client is imported the same way -from tests as it is from application code (`src.main.python.preponderous.viron...`). +from tests as it is from application code (`src.main.python.preponderous.viron...`). The +`pythonpath` setting it uses arrived in pytest 7.0, so the pytest 6.2.4 pinned by +`requirements.txt` ignores it and collection fails; install a newer pytest until that pin is +raised. Note that CI runs the Java build and tests only — Python client changes are not covered there and must be checked locally. diff --git a/pytest.ini b/pytest.ini index 68582e2..0aea8cc 100644 --- a/pytest.ini +++ b/pytest.ini @@ -3,4 +3,3 @@ # root (src.main.python.preponderous.viron...), so the root is what belongs on # the path. pythonpath = . -testpaths = src/test/python From 29853d662eba37391a659fe861bec75bea59257e Mon Sep 17 00:00:00 2001 From: Daniel McCoy Stephenson Date: Wed, 12 Aug 2026 01:09:57 -0600 Subject: [PATCH 5/5] docs: separate the CI-coverage note into its own paragraph Co-Authored-By: Claude Opus 5 (1M context) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9c3ac89..592262b 100644 --- a/README.md +++ b/README.md @@ -164,6 +164,7 @@ from tests as it is from application code (`src.main.python.preponderous.viron.. `pythonpath` setting it uses arrived in pytest 7.0, so the pytest 6.2.4 pinned by `requirements.txt` ignores it and collection fails; install a newer pytest until that pin is raised. + Note that CI runs the Java build and tests only — Python client changes are not covered there and must be checked locally.