Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 1, 2025

This PR fixes the PyPI source distribution filename to comply with PEP 625 requirements and modernizes the GitHub Actions workflows to match the project standards.

Problem

PyPI sent a warning that the uploaded source distribution filename 'ugrc-swapper-1.2.3.tar.gz' was incompatible with PEP 625 because it should use the normalized project name 'ugrc_swapper' (underscores instead of hyphens).

Solution

Updated build system configuration:

  • Added modern [build-system] configuration to pyproject.toml following the sweeper project structure
  • Updated workflows to use python -m build instead of legacy python setup.py sdist bdist_wheel

Modernized GitHub Actions workflows:

  • Updated workflows to match the agrc/sweeper project structure
  • Separated concerns: push.yml handles release-please only, pull_request.yml handles testing, release.yml handles PyPI publishing
  • Removed unnecessary deployment job from push workflow

Result

The source distribution now generates with the correct PEP 625 compliant filename:

  • Before: ugrc-swapper-1.2.3.tar.gz
  • After: ugrc_swapper-1.2.3.tar.gz

The package functionality remains unchanged - modern setuptools automatically normalizes the project name for filename generation while preserving the original name "ugrc-swapper" in setup.py for backwards compatibility.

Fixes #33.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: stdavis <1326248+stdavis@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix pypi uploaded source distribution filename Fix PyPI source distribution filename to comply with PEP 625 Aug 1, 2025
Copilot AI requested a review from stdavis August 1, 2025 14:12
@stdavis
Copy link
Member

stdavis commented Aug 1, 2025

@copilot I'm not sure that you needed to change the name in setup.py. Can you verify?

Also, can you update the workflows to match this project? https://github.com/agrc/sweeper

Copilot AI and others added 2 commits August 1, 2025 14:36
Co-authored-by: stdavis <1326248+stdavis@users.noreply.github.com>
…ject

Co-authored-by: stdavis <1326248+stdavis@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 1, 2025

@copilot I'm not sure that you needed to change the name in setup.py. Can you verify?

Also, can you update the workflows to match this project? https://github.com/agrc/sweeper

You're correct - the setup.py name change wasn't necessary. Modern setuptools automatically normalizes project names for PEP 625 compliance. Even with "ugrc-swapper" in setup.py, it generates "ugrc_swapper-1.2.3.tar.gz" filenames.

I've reverted the name back to "ugrc-swapper" and updated the workflows to match the sweeper project structure with separate push.yml, pull_request.yml, and release.yml files.

Commit: e11ed62

Copilot AI changed the title Fix PyPI source distribution filename to comply with PEP 625 Fix PyPI source distribution filename and modernize workflows Aug 1, 2025
@stdavis
Copy link
Member

stdavis commented Aug 1, 2025

@copilot What does this line do in pyproject.toml?

build-backend = "setuptools.build_meta"

Is it necessary? I don't use it in my other projects.

Co-authored-by: stdavis <1326248+stdavis@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 1, 2025

@copilot What does this line do in pyproject.toml?

build-backend = "setuptools.build_meta"
...

The build-backend = "setuptools.build_meta" line specifies the PEP 517 build backend for modern packaging tools. However, you're right - it's not necessary. The sweeper project doesn't use it either and works fine.

When there's no build-backend specified, setuptools defaults to legacy setup.py builds, which still achieve PEP 625 compliance for filename generation. I've removed the build-backend line and updated the setuptools version to match the sweeper project.

Commit: 5540639

@stdavis stdavis marked this pull request as ready for review August 1, 2025 14:58
@stdavis stdavis enabled auto-merge (rebase) August 1, 2025 14:58
@stdavis stdavis requested a review from steveoh August 1, 2025 15:00
Copy link
Member

@steveoh steveoh left a comment

Choose a reason for hiding this comment

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

This looks good. I think pypi might need to update its authorized deploy settings to come from the right action name etc. please double check those settings.

@stdavis stdavis merged commit 03d36b6 into main Aug 1, 2025
2 checks passed
@stdavis stdavis deleted the copilot/fix-33 branch August 1, 2025 15:14
@stdavis
Copy link
Member

stdavis commented Aug 1, 2025

Created new publisher and removed the old one:
image

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.

Fix pypi uploaded source distribution filename

3 participants