Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setuptools-scm with uv-lock pre-commit hook workflow broken by uv==0.5 #25

Open
jamesbraza opened this issue Nov 13, 2024 · 1 comment

Comments

@jamesbraza
Copy link

jamesbraza commented Nov 13, 2024

I have this in my pre-commit-config.yaml:

default_language_version:
  python: python3
repos:
  - repo: https://github.com/astral-sh/uv-pre-commit
    rev: X
    hooks:
      - id: uv-lock

Notably, I also use setuptools-scm for SCM versioning of my package:

# pyproject.toml

[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=64", "setuptools_scm>=8"]

[project]
dynamic = ["version"]
name = "foo"

[tool.setuptools_scm]
version_file = "foo/version.py"

When the rev is below 0.5, the uv-lock hook passes within a branch.

After pre-commit autoupdate to uv==0.5.1, the uv-lock hook fails within a branch on a commit-by-commit basis:

 [[package]]
 name = "foo"
-version = "0.14.3.dev3+ge144e1b"
+version = "0.14.3.dev5+g1ca1866"

If you enforce pre-commit passing in CI, you seemingly can't win because every commit changes the uv.lock file, which leads to failing CI.

@jamesbraza jamesbraza changed the title uv==0.5 seems to mess with uv-lock pre-commit hook setuptools-scm with uv-lock pre-commit hook workflow broken by uv==0.5 Nov 13, 2024
@aliabbasjaffri
Copy link

aliabbasjaffri commented Nov 29, 2024

Can confirm, i'm impacted by this as well!

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

No branches or pull requests

2 participants