Skip to content

Switch to uv #7328

Merged
johnewart merged 37 commits intomainfrom
johnewart/uv
Feb 11, 2026
Merged

Switch to uv #7328
johnewart merged 37 commits intomainfrom
johnewart/uv

Conversation

@johnewart
Copy link
Collaborator

This switches us from pip / setuptools / versioneer to uv / hatchling; creating a PR to ensure things run in CI as expected

@johnewart johnewart requested a review from a team as a code owner February 5, 2026 23:47
@johnewart johnewart requested review from galvana and removed request for a team February 5, 2026 23:47
@johnewart johnewart added dev experience Targets the developer experience do not merge Please don't merge yet, bad things will happen if you do labels Feb 5, 2026
@vercel
Copy link
Contributor

vercel bot commented Feb 5, 2026

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

Project Deployment Actions Updated (UTC)
fides-plus-nightly Ready Ready Preview, Comment Feb 11, 2026 3:25am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
fides-privacy-center Ignored Ignored Feb 11, 2026 3:25am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 5, 2026

Greptile Overview

Greptile Summary

This PR migrates the build system from pip/setuptools/versioneer to uv/hatchling, modernizing the dependency management and build process.

Major Changes:

  • Replaced setup.py, setup.cfg, and versioneer with pyproject.toml using hatchling and hatch-vcs
  • Consolidated requirements.txt, dev-requirements.txt, and optional-requirements.txt into pyproject.toml dependency declarations
  • Updated all GitHub Actions workflows to use uv for faster dependency installation
  • Modified Dockerfile to use uv for building the application instead of pip
  • Updated nox configuration to use uv as the default venv backend
  • Removed 2,200+ lines of versioneer-related code

Issues Found:

  • scripts/print_version.py has a package name mismatch (uses ethyca_fides but package is named ethyca-fides)
  • The script uses bare except Exception which will silently hide errors
  • Imports are inside try/except blocks instead of at the top of the file

Notes:

  • This PR exceeds 500 line changes (343 insertions + 2578 deletions), but the vast majority is deletion of auto-generated code (versioneer.py)
  • The migration appears comprehensive and consistent across all build/deployment touchpoints

Confidence Score: 3/5

  • This PR has a few critical issues that need resolution before merging, particularly the package name handling in the version script
  • The migration is well-structured and comprehensive, but there are syntax and logic issues in scripts/print_version.py that could cause runtime failures. The package name mismatch needs verification, and the bare except clause could hide important errors during version detection.
  • Pay close attention to scripts/print_version.py which has package naming and error handling issues that need to be resolved

Important Files Changed

Filename Overview
scripts/print_version.py New script to print package version; has package name mismatch and bare except issues
pyproject.toml Migration from setuptools/versioneer to hatchling/hatch-vcs with all dependencies consolidated
Dockerfile Replaced pip-based installation with uv for faster dependency management and builds
.github/workflows/backend_checks.yml Updated to use uv for dependency installation and removed pip caching
.github/workflows/publish_package.yaml Switched from setup.py to uv build for package publishing

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

5 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

try:
from importlib.metadata import version
import json
print(json.dumps({'version': version('ethyca_fides')}))
Copy link
Contributor

Choose a reason for hiding this comment

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

package name mismatch: pyproject.toml defines the package as ethyca-fides (with hyphen) but this script uses ethyca_fides (with underscore). When installed, Python packages normalize hyphens to underscores, so this should work, but verify this is intentional.

Suggested change
print(json.dumps({'version': version('ethyca_fides')}))
print(json.dumps({'version': version('ethyca-fides')}))

Comment on lines +5 to +7
except Exception:
import json
print(json.dumps({'version': 'unknown'}))
Copy link
Contributor

Choose a reason for hiding this comment

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

bare except Exception will silently hide all errors. Consider logging the error or being more specific about what exceptions to catch (e.g., PackageNotFoundError)

Suggested change
except Exception:
import json
print(json.dumps({'version': 'unknown'}))
except PackageNotFoundError:
import json
print(json.dumps({'version': 'unknown'}))

Comment on lines +2 to +3
from importlib.metadata import version
import json
Copy link
Contributor

Choose a reason for hiding this comment

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

imports should be at the top of the file per the custom rules, not inside try/except blocks

Suggested change
from importlib.metadata import version
import json
from importlib.metadata import version, PackageNotFoundError
import json
try:
print(json.dumps({'version': version('ethyca-fides')}))
except PackageNotFoundError:
print(json.dumps({'version': 'unknown'}))

Context Used: Rule from dashboard - Python imports should always be placed at the top of the file, not near the code that uses them. (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@vercel
Copy link
Contributor

vercel bot commented Feb 9, 2026

Deployment failed with the following error:

The provided GitHub repository does not contain the requested branch or commit reference. Please ensure the repository is not empty.

@vercel
Copy link
Contributor

vercel bot commented Feb 9, 2026

Deployment failed with the following error:

Creating the Deployment Timed Out.

@adamsachs adamsachs mentioned this pull request Feb 9, 2026
18 tasks
Copy link
Contributor

@adamsachs adamsachs left a comment

Choose a reason for hiding this comment

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

this broadly looks good to me, thank you! very excited to upgrade our toolchain.

we were able to verify that we could:

i also verified that referenced uv commands in the repo work well for me locally.

i'm sure there will be some quirks and things we've broken, but i think this is good enough to go, and we'll adjust/fix as those come up 👍

🚢 🚢 🚢

@johnewart johnewart added this pull request to the merge queue Feb 11, 2026
Merged via the queue into main with commit cb109f9 Feb 11, 2026
52 of 54 checks passed
@johnewart johnewart deleted the johnewart/uv branch February 11, 2026 04:21
@NevilleS NevilleS mentioned this pull request Feb 20, 2026
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev experience Targets the developer experience do not merge Please don't merge yet, bad things will happen if you do

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants