Skip to content

fix: editability check during pypi install#5617

Merged
baszalmstra merged 1 commit intoprefix-dev:mainfrom
tdejager:push-rvwntpspppym
Mar 6, 2026
Merged

fix: editability check during pypi install#5617
baszalmstra merged 1 commit intoprefix-dev:mainfrom
tdejager:push-rvwntpspppym

Conversation

@tdejager
Copy link
Contributor

@tdejager tdejager commented Mar 6, 2026

Description

Fixes #5604

This happened because the spec is duplicated and so both the registry requests and the local requests got passed into the solver. uv prefers the local one, so all good. However, we selected the registry requests version when determining editability. Now we just select by looking at all duplicates, as you cannot set editability directly in pep508 it should be good.

In the case of pixi features:

  [project]
  name = "myproject"
  version = "0.1.0"
  requires-python = ">= 3.11"
  dependencies = ["requests"]

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

  [tool.pixi.workspace]
  channels = ["conda-forge"]
  platforms = ["osx-arm64"]

  [tool.pixi.pypi-dependencies]
  requests = { path = "./requests", editable = true }

  [tool.pixi.feature.prod.pypi-dependencies]
  requests = { path = "./requests", editable = false }

  [tool.pixi.environments]
  prod = ["prod"]

The false should be taken as it has higher precedence

How Has This Been Tested?

Manually by using:

  1. clone requests from github.

  2. Use:

[project]
authors = [{name = "Tim de Jager", email = "tdejager89@gmail.com"}]
dependencies = ["requests"]
name = "5604"
requires-python = ">= 3.11"
version = "0.1.0"

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

[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["osx-arm64"]

[tool.pixi.pypi-dependencies]
requests = { path = "./requests", editable = true }
  1. run pixi install <-- Built version of pixi
  2. Note the pth file is there for the dev version
/tmp/5604 is 📦 v0.1.0 via 🐍 took 57s
❯ ls .pixi/envs/default/lib/python3.14/site-packages/ | grep .pth
__editable__.requests-2.33.0.dev1.pth
  1. With the released version of pixi this used a non-editable install.
  2. For the second, prod case, we see:
❯ ls .pixi/envs/prod/lib/python3.14/site-packages/ | grep .pth
conda-site.pth

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: Opus 4.6

Checklist:

  • I have performed a self-review of my own code
  • I have added sufficient tests to cover my changes.

@tdejager tdejager requested a review from ruben-arts March 6, 2026 11:26
@tdejager tdejager force-pushed the push-rvwntpspppym branch from f0fc428 to 543de42 Compare March 6, 2026 11:34
@baszalmstra baszalmstra enabled auto-merge (squash) March 6, 2026 11:41
) -> bool {
manifest_pypi_deps
.get(package_name)
.and_then(|specs| specs.iter().find_map(|spec| spec.editable()))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that spec.editable is an optional, so we are finding the first set value.

@baszalmstra baszalmstra merged commit fc00962 into prefix-dev:main Mar 6, 2026
73 of 74 checks passed
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.

Local dependency not installed as editable

2 participants