Skip to content

Fix PyPI upload by pinning version from tag#7974

Merged
adamsachs merged 2 commits intomainfrom
erosselli/fix-publish-fides-action
Apr 20, 2026
Merged

Fix PyPI upload by pinning version from tag#7974
adamsachs merged 2 commits intomainfrom
erosselli/fix-publish-fides-action

Conversation

@erosselli
Copy link
Copy Markdown
Contributor

Ticket N/A

Description Of Changes

Set SETUPTOOLS_SCM_PRETEND_VERSION on both sdist and wheel build steps so the version comes directly from the git tag, bypassing dirty-tree detection from earlier build steps.

Code Changes

Steps to Confirm

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

Set SETUPTOOLS_SCM_PRETEND_VERSION on both sdist and wheel build steps
so the version comes directly from the git tag, bypassing dirty-tree
detection from earlier build steps.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@erosselli erosselli marked this pull request as ready for review April 20, 2026 21:23
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
fides-plus-nightly Ignored Ignored Preview Apr 20, 2026 9:33pm
fides-privacy-center Ignored Ignored Apr 20, 2026 9:33pm

Request Review

@erosselli
Copy link
Copy Markdown
Contributor Author

/code-review

Copy link
Copy Markdown
Contributor

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Code Review: Fix PyPI upload by pinning version from tag

The approach here is correct — setting SETUPTOOLS_SCM_PRETEND_VERSION on both build steps forces the version from the tag and avoids +dirty suffixes that would break PyPI uploads. Good fix.

One concern worth addressing

The git reset --hard at line 46 (originally needed to prevent dirty-tree version strings) is now redundant because the env var handles that. But more importantly, keeping it means uv build --wheel runs on the clean git tree — without the frontend assets exported in "Build and export frontend files". The sdist captures those files before the reset, but the wheel does not.

If the admin-ui export is supposed to be bundled in the wheel (which it appears to be, given the explicit build step), this should be fixed either by removing the now-unnecessary git reset --hard, or by combining both builds into a single uv build call before it. See the inline comment for details.


🔬 Codegraph: unavailable

💡 Write /code-review in a comment to re-run this review.

- name: Build the sdist
run: |
uv build --sdist
git reset --hard
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.

.github/workflows/publish_package.yaml:46

Now that SETUPTOOLS_SCM_PRETEND_VERSION bypasses dirty-tree version detection, git reset --hard appears to be redundant here. More importantly, keeping it means the wheel (built in the next step) is assembled from the clean git state — without the admin-ui assets exported at line 34 (npm run prod-export-admin-ui). The sdist captures those files before the reset, but the wheel does not.

If git reset --hard is still genuinely needed for some other reason, please document why. Otherwise, consider removing it so both artifacts include the built frontend files, or build both in a single uv build invocation before the reset:

- name: Build sdist and wheel
  run: uv build
  env:
    SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.ref_name }}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That comment is incorrect. git reset --hard only resets tracked files. The admin-ui build output in src/fides/ui-build/ is gitignored (.gitignore
has ui-build/), so git reset --hard doesn't touch it. The frontend assets persist through the reset and are included in the wheel via the
artifacts config in pyproject.toml:

[tool.hatch.build.targets.wheel]
artifacts = ["src/fides/ui-build"]

Both the sdist and the wheel get the frontend files. The git reset --hard only cleans up whatever tracked file modifications the build process
causes.

@adamsachs adamsachs added this pull request to the merge queue Apr 20, 2026
Merged via the queue into main with commit 8b82f9c Apr 20, 2026
44 of 45 checks passed
@adamsachs adamsachs deleted the erosselli/fix-publish-fides-action branch April 20, 2026 21:48
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.

2 participants