Skip to content

GHA: Add Python sdist job to Package workflow - #2618

Merged
blowekamp merged 1 commit into
SimpleITK:mainfrom
blowekamp:add-python-sdist
Jul 2, 2026
Merged

blowekamp merged 1 commit into
SimpleITK:mainfrom
blowekamp:add-python-sdist

Conversation

@blowekamp

Copy link
Copy Markdown
Member

Add a standalone sdist job that builds a Python source distribution using python -m build --sdist from the root pyproject.toml (scikit-build-core backend).

Changes

.github/workflows/Package.yml

  • New sdist job: runs on all triggers (PR, tag, workflow_dispatch) on ubuntu-latest; uploads artifact as artifacts-sdist/simpleitk-*.tar.gz
  • publish-github now depends on sdist; twine check validates both wheels and the sdist
  • publish-pypi moves *.tar.gz alongside *.whl into dist/ so the sdist is uploaded to PyPI with the wheels

pyproject.toml

  • Remove outdated comment referencing build directory install
  • Replace deprecated write_to with version_file (setuptools-scm ≥8)

@blowekamp
blowekamp marked this pull request as ready for review July 1, 2026 16:45
@blowekamp
blowekamp requested review from Copilot, dave3d and zivy July 1, 2026 17:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the GitHub Actions packaging pipeline to also build and publish a Python source distribution (sdist) from the repository’s root pyproject.toml, and updates the setuptools-scm configuration to use the newer version_file key.

Changes:

  • Add a standalone sdist workflow job that builds python -m build --sdist and uploads the resulting artifact.
  • Update release/publish steps so publish-github depends on the new sdist job and runs twine check on wheels + sdist.
  • Adjust PyPI publish preparation to include the sdist alongside wheels in dist/, and update pyproject.toml to use version_file instead of deprecated write_to.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
pyproject.toml Updates setuptools-scm config for version file generation and removes outdated comment text.
.github/workflows/Package.yml Adds an sdist job and wires sdist artifacts into GitHub release validation and PyPI publishing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/Package.yml Outdated
Comment thread .github/workflows/Package.yml Outdated
Comment thread .github/workflows/Package.yml
Add a standalone sdist job to Package.yml that builds a Python source
distribution using python -m build --sdist from the root pyproject.toml
(scikit-build-core backend):
- Runs on all triggers (PR, tag, dispatch) on ubuntu-latest
- Artifact uploaded as artifacts-sdist/simpleitk-*.tar.gz
- publish-github depends on sdist; twine check validates both wheels
  and the sdist
- publish-pypi moves *.tar.gz alongside *.whl into dist/ so the sdist
  is uploaded to PyPI with the wheels

Update pyproject.toml:
- Remove outdated comment referencing build directory install
- Use setuptools_scm 'version_file' (replaces deprecated 'write_to')
@blowekamp
blowekamp merged commit 48b20d9 into SimpleITK:main Jul 2, 2026
17 of 19 checks passed
@blowekamp
blowekamp deleted the add-python-sdist branch September 9, 2026 12:55
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.

4 participants