Skip to content

uv fails to retrieve right version with setuptools_scm in clone after new release #6964

@lkstrp

Description

@lkstrp

When a package uses setuptools-scm, the version is not correctly retrieved if reinstalling in editable mode after new release.

uv 0.4.3 (Homebrew 2024-09-02) on macOS

Example
Let's take the PyPSA package for example.
Works fine initially and retrieves correct version (0.30.0.post1.dev2+g191bea7c currently):

git clone https://github.com/PyPSA/PyPSA.git
cd PyPSA
uv venv
uv pip install -e .

But when coming back to the repo at a later stage after a new release (let's say 0.30.1 as an example)

git pull --tags
> From https://github.com/PyPSA/PyPSA
> * [new tag]           v0.30.1    -> v0.30.1

uv will not retrieve the new version (v0.30.1) but will just add a new dev version to the previous one (e.g. v0.30.0.post1.devx+x).

You have to remove the env and install without cache to retrieve the correct version again. Just deleting the env or just ignoring the cache will not work.

rm -r .venv
uv venv
uv pip install -e . -n

While pip installs the correct version immediately, without ignoring the cache or creating a new environment.

This is a made up case. To reproduce you need a cloned repo with the package installed and wait for a new release to see the behavior.

Metadata

Metadata

Assignees

Labels

questionAsking for clarification or support

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions