From 3b924e1e49bb643bc7fa83ec13ad0c73f00f4fdd Mon Sep 17 00:00:00 2001 From: Juan Pablo Roldan Date: Fri, 21 Aug 2026 14:36:15 -0400 Subject: [PATCH 1/2] fix: CI pytest job fails on Python 3.11 -- numpy==2.5.2 needs 3.12+ The pytest job ran a 3.11/3.12 matrix, but requirements.txt pins exact versions (numpy==2.5.2 in particular) that were only ever verified against Python 3.12, the actual local dev environment. numpy 2.5.2 does not publish a 3.11 wheel (it requires Python >=3.12), so the 3.11 leg failed at pip install before a single test ran: ERROR: Could not find a version that satisfies the requirement numpy==2.5.2 ... Requires-Python >=3.12 This is the same class of mistake fixed earlier (pinned versions not matching the target Python version) -- I added the 3.11 leg to the CI matrix without ever actually verifying the pinned requirements install under 3.11. Rather than guess at a second set of pins for 3.11, narrowed the pytest job to Python 3.12 only, matching what has actually been verified and what the README already claims (Tested on Python 3.12). Also fixed a README line from the previous PR that claimed CI covered both Python versions. Verified locally: pytest and ruff both pass on 3.12, matching what CI will now run. --- .github/workflows/tests.yml | 7 ++----- README.md | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index afd7ee4..683de2c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,17 +9,14 @@ on: jobs: pytest: runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.11", "3.12"] steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: "3.12" cache: pip - name: Install dependencies diff --git a/README.md b/README.md index 4c5a523..34e744d 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ pytest Any bug fix or new solver logic should keep existing tests passing and add new tests alongside it. Test coverage spans the isentropic, oblique shock, Taylor-Maccoll, and MoC point solvers, plus `point.py`, `process_LE_points.py`, `metric_derivative_solver.py`, and `velocity_altitude_map.py`. The streamline integrator and surface pressure solver still have no automated tests. -A GitHub Actions workflow (`.github/workflows/tests.yml`) runs the full suite on every push and pull request against `main`, on Python 3.11 and 3.12. +A GitHub Actions workflow (`.github/workflows/tests.yml`) runs the full suite on every push and pull request against `main`, on Python 3.12 (the version `requirements.txt` is pinned against). --- From 480553f0580c11a79b8c5cf3028605b759524755 Mon Sep 17 00:00:00 2001 From: Juan Pablo Roldan Date: Fri, 21 Aug 2026 14:38:50 -0400 Subject: [PATCH 2/2] fix: bare pytest command fails with ModuleNotFoundError for src Deeper, pre-existing bug uncovered by the same CI run as the previous commit -- this one is not new, it predates all of this sessions work. Every test file imports its target module as from src.module_name import X (this was already the pattern in the original three test files, before any of my changes). That import requires the repo root to be on sys.path, so that src is resolvable as a namespace package. pytest.ini only set pythonpath = src, which puts src/ itself on sys.path -- that is what lets modules inside src/ import each other by bare name (e.g. taylor_maccoll_solver.py doing from isentropic_relations_solver import ...), but it does nothing for the repo root. Locally this went unnoticed because I always ran tests via python -m pytest, and -m module invocation adds the current working directory to sys.path as a side effect of how Python resolves -m. The bare pytest command -- which is what the README documents and what CI actually runs -- does not get that side effect, and failed immediately before collecting a single test. Reproduced locally via .venv/Scripts/pytest.exe -v (bypassing python -m) to confirm. Fixed by setting pythonpath = . src in pytest.ini, adding the repo root alongside src/ so both import styles resolve regardless of how pytest is invoked. Verified: .venv/Scripts/pytest.exe -v (bare entry point, matching CI exactly) now collects and passes all 24 tests. ruff check . still passes clean. --- pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest.ini b/pytest.ini index 95f9027..f29840a 100644 --- a/pytest.ini +++ b/pytest.ini @@ -2,6 +2,6 @@ [pytest] -pythonpath = src +pythonpath = . src testpaths = tests \ No newline at end of file