Skip to content

Conversation

@jontsai
Copy link
Contributor

@jontsai jontsai commented Oct 30, 2025

Summary

  • Added --upgrade flag when installing setuptools in the tag-release workflow
  • This ensures we get a modern version of setuptools that properly normalizes package names

Problem

The tag-release workflow was partially failing during PyPI upload:

  • ✅ Wheel file uploaded successfully: altimate_datapilot_cli-0.1.1-py3-none-any.whl
  • ❌ Source tarball rejected: altimate-datapilot-cli-0.1.1.tar.gz

Error from PyPI:

HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/
Filename 'altimate-datapilot-cli-0.1.1.tar.gz' is invalid, should be 
'altimate_datapilot_cli-0.1.1.tar.gz'.

Root Cause

  • GitHub Actions Python 3.11.13 comes with setuptools 65.5.0 pre-installed
  • This old version doesn't normalize package names to underscores when creating source distributions
  • The workflow installed setuptools but didn't upgrade it (pip skips if already satisfied)
  • Modern setuptools (65.6.0+) automatically normalize package names

Solution

Changed:

pip install tox twine wheel setuptools

To:

pip install --upgrade tox twine wheel setuptools

This ensures setuptools is upgraded to the latest version which correctly normalizes:

  • altimate-datapilot-clialtimate_datapilot_cli (for filenames)

Local Verification

Tested locally to confirm the issue and fix:

❌ With setuptools 65.5.0 (mimicking GitHub Actions environment)

$ pip install setuptools==65.5.0
$ python setup.py sdist
creating altimate-datapilot-cli-0.1.1    # ❌ Creates directory with hyphens

$ ls dist/
altimate-datapilot-cli-0.1.1.tar.gz     # ❌ PyPI rejects this filename

✅ After pip install --upgrade setuptools (80.9.0)

$ pip install --upgrade setuptools
$ python setup.py sdist
creating altimate_datapilot_cli-0.1.1   # ✅ Creates directory with underscores

$ ls dist/
altimate_datapilot_cli-0.1.1.tar.gz     # ✅ PyPI accepts this filename

$ tar -tzf dist/*.tar.gz | head -3
altimate_datapilot_cli-0.1.1/           # ✅ Directory structure also uses underscores
altimate_datapilot_cli-0.1.1/.bumpversion.cfg
altimate_datapilot_cli-0.1.1/.cookiecutterrc

Result: Confirmed that upgrading setuptools fixes the filename normalization issue.

Impact

  • Both wheel and source distribution will upload successfully to PyPI
  • No breaking changes - package name normalization is transparent to users
  • Users can still install with either pip install altimate-datapilot-cli or pip install altimate_datapilot_cli

Verification

You can verify the current state:

🤖 Generated with Claude Code

The tag-release workflow was failing because the pre-installed setuptools (65.5.0) doesn't normalize package names to underscores when creating source distributions.

This caused PyPI to reject the tarball with error: 'Filename altimate-datapilot-cli-0.1.1.tar.gz is invalid, should be altimate_datapilot_cli-0.1.1.tar.gz'.

Modern setuptools (65.6.0+) automatically normalize package names. Adding --upgrade flag ensures we get the latest version that handles name normalization correctly.

Impact: This will allow both wheel and source distributions to upload successfully to PyPI.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to 7077c5b in 24 seconds. Click for details.
  • Reviewed 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .github/workflows/tag-release.yml:28
  • Draft comment:
    Adding '--upgrade' flag ensures setuptools (and others) are updated so package names are normalized correctly. Looks good.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_LQqjhoBAHdF7rBKF

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@jontsai jontsai merged commit d32a3ba into main Oct 30, 2025
31 of 39 checks passed
@jontsai jontsai deleted the fix/upgrade-setuptools-in-release-workflow branch October 30, 2025 21:41
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