Add PyPI publishing workflows and fix packaging metadata#66
Conversation
Set up a libmbd-style two-stage release pipeline:
- build-dist.yaml ("Build distributions") builds the sdist + wheel,
validates metadata with `twine check --strict`, and uploads them as a
workflow artifact. Runs on packaging-related PRs/pushes, on published
releases, and on manual dispatch.
- publish.yaml ("Publish") reacts to a successful release build via
workflow_run, publishes to PyPI using OIDC trusted publishing (no stored
token), and attaches the distributions to the GitHub Release. Gated on
the release event succeeding so it never runs on pull requests.
The repository guards target the upstream NASymmetry/MolSym slug, since
this branch is intended to be merged there.
Also fix pyproject.toml, which used setup.cfg-style [metadata]/[options]
tables that setuptools' pyproject backend ignores entirely -- builds were
producing a metadata-less molsym-0.0.0. Convert to a valid PEP 621
[project] table so the package builds as MolSym 0.2.1 with its declared
authors, dependencies, and classifiers.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YTSDMXdrJqFVK5NKXFoBBb
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
nlk36701
left a comment
There was a problem hiding this comment.
Thanks for putting this together. I’m requesting changes because the current pyproject.toml rewrite appears to undo the optional-dependency split that was just merged in #65.
That PR made qcelemental optional so the core molsym install/API path can remain NumPy-only, but this branch currently puts qcelemental back into the main dependency list. Could you rebase or otherwise carry forward #65’s packaging change while keeping the PEP 621 rewrite, so qcelemental remains available via an optional extra rather than project.dependencies?
Separately, if Python 3.14 support matters for the optional paths, it may be worth tightening or documenting the supported qcelemental range explicitly, since the upstream Python 3.14 import issue was fixed in QCElemental 0.50.4.
|
Quick clarification on my earlier note: my main concern is downstream compatibility (especially Pyberny), not necessarily that 0.50.4 is a hard pinned requirement. I’d like us to verify MolSym against the qcelemental version range Pyberny currently resolves to before merge/release. |
Addresses #63. Made with Claude. I’m making this so Pyberny can use Molsym as a required dependency.
This PR largely automatizes publishing on PyPI, but you’d still need to do a few things yourself. I’m happy to help.
The workflows take care of the rest.
Set up a two-stage release pipeline:
twine check --strict, and uploads them as a workflow artifact. Runs on packaging-related PRs/pushes, on published releases, and on manual dispatch.The repository guards target the upstream NASymmetry/MolSym slug, since this branch is intended to be merged there.
Also fix pyproject.toml, which used setup.cfg-style [metadata]/[options] tables that setuptools' pyproject backend ignores entirely -- builds were producing a metadata-less molsym-0.0.0. Convert to a valid PEP 621 [project] table so the package builds as MolSym 0.2.1 with its declared authors, dependencies, and classifiers.