Skip to content

Fix/issue 100 python 314#101

Merged
haeussma merged 15 commits into
mainfrom
fix/issue-100-python-314
Jul 23, 2026
Merged

Fix/issue 100 python 314#101
haeussma merged 15 commits into
mainfrom
fix/issue-100-python-314

Conversation

@haeussma

@haeussma haeussma commented Jul 23, 2026

Copy link
Copy Markdown
Member

Fix Python 3.14 support (#100) + release-pipeline hardening

Fixes #100. Also fixes a latent 3.14 runtime bug behind it, plus some fetcher/CI cleanup found along the way.

Python 3.14 support (#100)

  • Drop the fastobo>=0.13.0,<0.14 pin. fastobo isn't imported anywhere — it's transitive via pymetadata/pronto. The <0.14 cap forced 0.13.0, which has no 3.14 wheel (PyO3 build fails). Removing it resolves fastobo 0.14.1 (ships cp314 wheels).
  • sbml/omex.py: flush model.xml before archiving it. add_entry() copies the file from disk but ran inside the open with block, before flush. On 3.14's I/O buffering this wrote a 0-byte SBML file, breaking every OMEX round-trip. On ≤3.13 it passed by luck.
  • Add '3.14' to the unit + remote CI matrices.

Fetcher / composer fixes

  • fetcher/pdb.py: accept integer PubMed IDs. PDB returns pdbx_database_id_PubMed as an int; the model typed it str, so pydantic rejected every PDB fetch. Now Optional[int], stringified at the one use site.
  • composer.py: surface real fetcher errors. _fetch_with_fetchers swallowed every exception → useless "no fetcher found". Now aggregates each fetcher's actual failure into the raised ValueError.
  • Updated compose fixtures (now include the PubMed citation reference the fixed fetch emits) + new offline tests/unit/test_composer.py; marked network-dependent composer tests remote.

Misc

  • __version__ now reads from installed metadata (single source = pyproject.toml).
  • Release pipeline: publish.yaml now needs a version==tag check and the reused test matrix, so a mismatched tag or red tests can't ship.
  • Bumped all GitHub Actions to latest (checkout@v7, setup-python@v7, setup-uv@v9.0.0).

Testing

Full suite green on 3.13 (106 passed) and a clean 3.14.6 venv (86 offline + 18 remote), all extras installed.


This change is Reviewable

haeussma added 11 commits July 23, 2026 13:33
This update includes the addition of the pydantic package with a version constraint of >=2,<3 to the dependencies list in pyproject.toml, enhancing type validation capabilities.
_fetch_with_fetchers caught every exception and discarded it, so a
failing fetch reported only "no fetcher found" with no cause. Collect
each fetcher's actual error and include them in the raised ValueError.
PDB returns pdbx_database_id_PubMed as an int, but the Citation model
typed pubmed_id as str
add_entry copies the SBML file from disk, but was called inside the
open() block before the write flushed. On Python 3.14 this produced a
0-byte model.xml, breaking every SBML round-trip. Close the file first.
…n tests as remote

This commit introduces a new unit test file for the composer module, which includes tests for handling successful and failed fetcher scenarios. Additionally, the integration test for the composer has been marked with the pytest remote marker to indicate its dependency on external resources.
This commit adds a new PubMed reference (https://pubmed.ncbi.nlm.nih.gov/9572841) to the expected JSON fixtures for both `expected_compose.json` and `expected_compose_no_vessel.json`, enhancing the citation information for the sequences.
…oject.toml and uv.lock

This commit updates the project version in pyproject.toml to 2.2.3 and modifies the fastobo dependency version in uv.lock to 0.14.1, ensuring compatibility with the latest features and fixes.
…s/setup-python@v7, and upgrade astral-sh/setup-uv to v9.0.0. This ensures consistency across workflows and leverages the latest features and improvements in the actions used.
@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
py-enzyme Ready Ready Preview, Comment Jul 23, 2026 12:42pm

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
uv-lock re-locks uv.lock when pyproject.toml changes to prevent drift;
ruff mirrors the lint.yml gate (scoped to pyenzyme/ and tests/).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
pre-commit is a standalone tool, not a project dependency, so 'uv run'
cannot find it. Use 'uv tool install pre-commit' instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Remote tests hit external APIs (e.g. RHEA-DB) that block CI datacenter
IPs with 403, making CI permanently red for reasons unrelated to the
code. They still run locally via 'pytest' (or 'pytest -m remote'); CI's
unit-tests already excludes them with -m 'not remote'.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@haeussma
haeussma merged commit 2d017ec into main Jul 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Install fails on python 3.14

1 participant