Skip to content

Add PyPI publishing workflows and fix packaging metadata#66

Open
jhrmnn wants to merge 1 commit into
NASymmetry:mainfrom
jhrmnn:claude/pypi-publishing-workflow-09shk0
Open

Add PyPI publishing workflows and fix packaging metadata#66
jhrmnn wants to merge 1 commit into
NASymmetry:mainfrom
jhrmnn:claude/pypi-publishing-workflow-09shk0

Conversation

@jhrmnn

@jhrmnn jhrmnn commented Jun 26, 2026

Copy link
Copy Markdown

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.

  1. Make a PyPI account or find someone who has one
  2. Authorize this repo to publish on PyPI
  3. Create a corresponding env on Github
  4. Make a Github release

The workflows take care of the rest.


Set up a 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.

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
@sgoodlett sgoodlett requested a review from nlk36701 June 30, 2026 13:46
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
unittests 84.44% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nlk36701 nlk36701 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@nlk36701

Copy link
Copy Markdown
Collaborator

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.

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.

3 participants