Skip to content

Conversation

@deanq
Copy link
Member

@deanq deanq commented Nov 19, 2025

Problem

The CD workflow failed when attempting to publish to PyPI with error:

HTTPError: 400 Bad Request
The use of local versions in <Version('0.1.dev1+gfc299edb5')> is not allowed.

Root Cause

  1. Shallow git clone: actions/checkout@v4 without fetch-depth: 0 performed shallow clone that didn't fetch tags
  2. setuptools_scm couldn't find tags: Generated dev version with local identifier (+gXXXXXX)
  3. PyPI rejection: PyPI doesn't accept packages with local version identifiers

Solution

  1. Add fetch-depth: 0 to checkout step for full git history including tags
  2. Configure setuptools_scm with local_scheme = "no-local-version" to strip local identifiers

Testing

  • ✅ Local build generates PyPI-compliant version without local identifier
  • ✅ Package metadata passes twine check

Impact

Future releases from release-please will correctly detect version tags and publish to PyPI without errors.

Fixes workflow run: https://github.com/runpod/runpod-python/actions/runs/19493997742

- Add fetch-depth: 0 to checkout step for full git history
- Configure setuptools_scm local_scheme to strip local version identifiers
- Fixes issue where shallow clone prevented tag detection
- Resolves PyPI 400 error: local versions not allowed
@deanq deanq requested a review from Copilot November 19, 2025 11:13
Copy link

Copilot AI left a comment

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 fixes a CD workflow failure where PyPI rejected package uploads due to invalid local version identifiers in the version string. The issue occurred because a shallow git clone prevented setuptools_scm from detecting version tags, causing it to generate dev versions with local identifiers (e.g., 0.1.dev1+gfc299edb5) that PyPI doesn't accept.

Key changes:

  • Enable full git history fetch in the CD workflow to ensure version tags are available
  • Configure setuptools_scm to strip local version identifiers for PyPI compliance

Reviewed Changes

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

File Description
.github/workflows/CD-publish_to_pypi.yml Added fetch-depth: 0 to checkout step to fetch full git history including tags
pyproject.toml Added local_scheme = "no-local-version" configuration to prevent local version identifiers

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

@deanq deanq merged commit c3cd473 into main Nov 19, 2025
8 checks passed
@deanq deanq deleted the deanq/fix-ci-cd-pypi branch November 19, 2025 22: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.

4 participants