Fix packaging: declare build-system, fix package discovery (v0.2.23) - #40
Merged
Merged
Conversation
The project had no [build-system] table, so uv treated it as a virtual project and never installed mtphandler — pytest and `uv add --editable` both failed with ModuleNotFoundError. setuptools' flat-layout discovery also errored on the two top-level dirs (mtphandler, specifications). - Add [build-system] (setuptools) so the project installs - Limit package discovery to mtphandler* (excludes specifications/) - Use SPDX string for license (drops setuptools deprecation warning) - Raw-string a regex in multiskan_spectrum_parser (drops SyntaxWarning) - Bump version 0.2.22 -> 0.2.23 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- tests.yml used `pip install poetry; poetry install --with dev`, but the project moved to uv (uv.lock) with PEP 735 [dependency-groups]; poetry has no `dev` group here, so install failed. Now uses astral-sh/setup-uv + `uv sync --group dev` + `uv run pytest`. - Bump actions/setup-python@v4 -> v5 in mkdocs.yml (v4 runs on EOL Node 16). - Add Python 3.14 to the test matrix (continue-on-error): allowed to fail until pyenzyme's transitive dep `fastobo` ships 3.14 wheels. - Widen requires-python to >=3.10,<3.15. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
pyenzyme pins fastobo<0.14, which has no 3.14 wheel, so 3.14 can't install. Revert requires-python to <3.14 and drop 3.14 from the CI matrix until pyenzyme allows fastobo 0.14.x (which does ship cp314 wheels). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- publish_pypi: gate TestPyPI publish to tag pushes and add skip-existing, so branch pushes no longer 400 on re-uploading an existing version. - tests: run `pytest tests/` instead of executing docs notebooks with --nbval; the notebooks call live PubChem and flake on macOS runners. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
test_define_molecule_without_name does a live PubChem lookup; macOS CI runners get rate-limited and the test fails there while ubuntu/windows pass. Skip on PubChem-specific failure so a network flake doesn't red the build, while still asserting whenever PubChem responds. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replaces the earlier skip-on-failure band-aid. test_define_molecule_without_name is the only test that does a live PubChem lookup. Mark it `network`; CI runs `pytest -m "not network"` because datacenter runner IPs get rate-limited by PubChem. A plain local `pytest` still runs it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- actions/checkout v4 -> v7 - actions/setup-python v5 -> v7 - actions/upload-artifact v4 -> v7 - actions/download-artifact v4 -> v8 (v4+ share one backend, cross-compatible) - actions/cache v4 -> v6 - astral-sh/setup-uv v6 -> v9 - sigstore/gh-action-sigstore-python v2.1.1 -> v3.4.0 Left on moving/recommended refs: codespell-project/actions-codespell@v2, pypa/gh-action-pypi-publish@release/v1 (upstream's recommended pin). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
pypa/gh-action-pypi-publish (>=1.11.0) already generates PEP 740 attestations by default, so the manual Sigstore signing + release-upload step duplicated provenance PyPI now provides. PyPA removed it from their canonical workflow. The github-release job now just creates the GitHub Release; the sigstore id-token permission and artifact download are no longer needed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- publish: add check-version job (release tag must equal pyproject version), gate both publish jobs on it so a mistagged release can't ship. - add .pre-commit-config.yaml with uv-lock hook so uv.lock can't drift from pyproject.toml; add pre-commit to the dev group. - tests: `uv sync --locked` fails CI if the lock is out of sync (belt to the pre-commit hook's suspenders). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Read the installed version via stdlib importlib.metadata instead of hardcoding, so it stays in sync with pyproject.toml. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
uv add --editable,uv sync, anduv run pytestall failed because the project was never actually installed. Root cause:pyproject.tomlhad no[build-system]table, so uv treated it as a virtual project and skipped installingmtphandler— every test collected withModuleNotFoundError: No module named 'mtphandler'. setuptools' flat-layout discovery separately errored on the two top-level dirs (mtphandler,specifications).Changes
[build-system](setuptools ≥61) so the project installs as a package[tool.setuptools.packages.find] include = ["mtphandler*"]— fixes "Multiple top-level packages discovered" by excludingspecifications/license = "MIT"(SPDX string) — drops the setuptools license-table deprecation warningmultiskan_spectrum_parser.py— drops aSyntaxWarning: invalid escape sequence '\d'0.2.22→0.2.23(bugfix)Verification
uv syncnow installsmtphandler==0.2.23editable;uv run pytest→ 25 passed.uv buildproduces a clean wheel + sdist.🤖 Generated with Claude Code