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

Change project to virtual, uv sync still installs it #6749

Closed
j178 opened this issue Aug 28, 2024 · 6 comments · Fixed by #6754
Closed

Change project to virtual, uv sync still installs it #6749

j178 opened this issue Aug 28, 2024 · 6 comments · Fixed by #6754
Assignees
Labels
bug Something isn't working question Asking for clarification or support

Comments

@j178
Copy link
Contributor

j178 commented Aug 28, 2024

Steps to reproduce

$ uv init project --lib
$ cd project
$ uv sync

$ cat pyproject.toml
[project]
name = "project"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = []

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

$ cat uv.lock
version = 1
requires-python = ">=3.12"

[[package]]
name = "project"
version = "0.1.0"
source = { editable = "." }

After removed the [build-system] section from pyproject.toml, the project should become virtual, but uv sync still build and installs the virtual project:

$ cat pyproject.toml
[project]
name = "project"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = []

$ uv sync -v
DEBUG uv 0.3.5
DEBUG Found project root: `/private/tmp/project`
DEBUG No workspace root found, using project root
DEBUG The virtual environment's Python version satisfies `Python >=3.12`
DEBUG Using request timeout of 30s
DEBUG Acquired lock for `/Users/Jo/.cache/uv/built-wheels-v3/editable/a0e7529ceb99aa48`
DEBUG Found static `pyproject.toml` for: project @ file:///private/tmp/project
DEBUG No workspace root found, using project root
DEBUG Existing `uv.lock` satisfies workspace requirements
Resolved 1 package in 5ms
DEBUG Using request timeout of 30s
DEBUG Requirement installed, but not fresh: project==0.1.0 (from file:///private/tmp/project)
DEBUG Identified uncached requirement: project @ file:///private/tmp/project
DEBUG Acquired lock for `/Users/Jo/.cache/uv/built-wheels-v3/editable/a0e7529ceb99aa48`
DEBUG Building: project @ file:///private/tmp/project
INFO Ignoring empty directory
DEBUG Solving with installed Python version: 3.12.5
DEBUG Adding direct dependency: setuptools>=40.8.0
DEBUG Found fresh response for: https://pypi.org/simple/setuptools/
DEBUG Searching for a compatible version of setuptools (>=40.8.0)
DEBUG Selecting: setuptools==74.0.0 [compatible] (setuptools-74.0.0-py3-none-any.whl)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/df/b5/168cec9a10bf93b60b8f9af7f4e61d526e31e1aad8b9be0e30837746d700/setuptools-74.0.0-py3-none-any.whl.metadata
DEBUG Tried 1 versions: setuptools 1
DEBUG Split specific environment resolution took 0.003s
DEBUG Installing in setuptools==74.0.0 in /Users/Jo/.cache/uv/builds-v0/.tmpJgiFHb
DEBUG Requirement already cached: setuptools==74.0.0
DEBUG Installing build requirement: setuptools==74.0.0
DEBUG Calling `setuptools.build_meta:__legacy__.get_requires_for_build_editable()`
DEBUG Calling `setuptools.build_meta:__legacy__.build_editable("/Users/Jo/.cache/uv/built-wheels-v3/editable/a0e7529ceb99aa48/cH78NBLJe7WJ1SJlYzd2P/.tmp6a6fqx", {}, None)`
DEBUG Finished building: project @ file:///private/tmp/project
Prepared 1 package in 579ms
DEBUG Uninstalled project (7 files, 1 directory)
Uninstalled 1 package in 0.87ms
Installed 1 package in 1ms
 ~ project==0.1.0 (from file:///private/tmp/project)

Environment

uv 0.3.5 (53ef633c6 2024-08-28) - the master tip
macOS 14.6.1 (23G93)
@j178 j178 changed the title Change project to non-project, uv sync still installs it Change project to virtual, uv sync still installs it Aug 28, 2024
@zanieb
Copy link
Member

zanieb commented Aug 28, 2024

I don't think our changes have released yet! #6585 is in the next release.

@zanieb zanieb added the question Asking for clarification or support label Aug 28, 2024
@zanieb
Copy link
Member

zanieb commented Aug 28, 2024

Oh sorry I see "master tip" now.

@charliermarsh
Copy link
Member

I can take a look at this.

@zanieb
Copy link
Member

zanieb commented Aug 28, 2024

Presumably because the lockfile isn't treated as stale? (my naive guess haha)

@charliermarsh
Copy link
Member

Probably yeah...

@charliermarsh charliermarsh self-assigned this Aug 28, 2024
@charliermarsh charliermarsh added the bug Something isn't working label Aug 28, 2024
@charliermarsh
Copy link
Member

Thank you for testing on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Asking for clarification or support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants