Skip to content

build: raise the pytest floor and cover the Python client in CI - #208

Merged
dmccoystephenson merged 1 commit into
mainfrom
fix/python-client-ci-coverage
Aug 14, 2026
Merged

build: raise the pytest floor and cover the Python client in CI#208
dmccoystephenson merged 1 commit into
mainfrom
fix/python-client-ci-coverage

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

  • requirements.txt asked for pytest 6.2.4, a release that predates the pythonpath ini setting pytest.ini depends on. Anyone installing from that file was returned to the collection failure fixed in pytest fails to collect the Python client tests: pytest.ini's pythonpath does not match the tests' import style #201, which the README had been papering over with a warning. The floor is raised to pytest 7.0.
  • Both entries are expressed as floors rather than exact pins, because this file doubles as the declared dependency surface of the client under src/main/python, where exact pins fight with consuming applications. requests moves off 2.25.1 (December 2020) to 2.32.0 at the same time.
  • A python-client job is added to .github/workflows/ci.yml. It installs requirements.txt and runs pytest, so the 107 tests under src/test/python are exercised on every push and pull request instead of by hand.
  • The matrix covers Python 3.8 — the oldest interpreter the README claims — and 3.12. That shape is what would have caught the builtin generic annotation fixed in environmentService's get_all_environments uses a builtin generic annotation the rest of the client avoids, breaking Python 3.8 #204, which was invisible to CI at the time.
  • The README's testing section is updated: the stopgap warning about the stale pin is removed, and the note that CI covers the Java build alone no longer holds.

Test plan

  • pytest — 107 passed locally (Python 3.10.12, pytest 9.1.1)
  • No Java sources were touched by this change, so ./mvnw test -B is left to the build job on this branch for its authoritative signal
  • The client suite mocks requests.get/post/patch/delete throughout, so the version bump is not exercised by test behaviour
  • The client and its tests were checked for PEP 585 builtin generics and PEP 604 unions, of which none remain, so the 3.8 leg is expected to be green

Closes #206
Closes #207

This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).

requirements.txt pinned pytest 6.2.4, which predates the pythonpath ini
setting pytest.ini depends on; anything installing from that file landed back
on the collection failure #201 fixed. Both entries become floors rather than
exact pins, since this file doubles as the client's declared dependency
surface, and requests moves off 2.25.1 at the same time.

A python-client job now installs those dependencies and runs pytest on 3.8 and
3.12, so the 107 client tests carry the same weight as the Java suite. The
matrix covers the oldest interpreter the README claims and a current one,
which is the shape that would have caught the builtin generic fixed in #204.

Closes #206
Closes #207

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review

The diff was read in full and reviewed against this repository's conventions. No blocking issues were found; three points are recorded below as notes rather than requested changes, since each reflects a deliberate choice made while resolving #206 and #207.

requirements.txt:9-10 — floors (>=) replace exact pins. The reproducibility that exact pins buy is given up here: a future pytest or requests release can turn CI red without any change landing in this repository. That trade was taken because the same file is the client's declared dependency surface, where exact pins conflict with consuming applications, and because no lock file exists to hold a resolved set. Should the reproducibility matter more later, the conventional answer is a separate requirements-dev.txt or a lock file rather than a return to exact pins.

.github/workflows/ci.yml:38 — Python 3.8 reached end of life in October 2024 and is kept in the matrix only because the README declares it as the floor. Nothing in the repository enforces that floor (no setup.py or pyproject.toml, as noted in #204), so the matrix is currently the only place the claim is checked. If the floor is raised, this entry is what should move with it.

.github/workflows/ci.yml:52python -m pytest is used rather than a bare pytest, matching how the README's pytest.ini explanation depends on the invoking directory being the repository root. Both jobs confirmed collection of all 107 tests rather than an empty run, which is the failure mode a green pytest step can otherwise hide.

Verification on this branch: build passed, python-client (3.8) collected 107 items and passed on pytest 8.3.5 with requests 2.32.4, and python-client (3.12) collected 107 items and passed. The 3.8 leg confirms both that the interpreter is still installable on ubuntu-latest and that the raised floors resolve there.

This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).

@dmccoystephenson
dmccoystephenson merged commit fbba115 into main Aug 14, 2026
3 checks passed
@dmccoystephenson
dmccoystephenson deleted the fix/python-client-ci-coverage branch August 14, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant