mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
Add support for Hatch's {root:uri}
paths in editable installs (#2492)
## Summary If a package uses Hatch's `root.uri` feature, we currently error: ```toml dependencies = [ "black @ {root:uri}/../black_editable" ] ``` Even though we're using PEP 517 hooks to get the metadata, which _should_ support this. The problem is that we load the full `PyProjectToml`, which means we parse the requirements, which means we reject what looks like a relative URL in dependencies. Instead, we should only enforce a limited subset of `pyproject.toml` (arguably none). Closes https://github.com/astral-sh/uv/issues/2475.
This commit is contained in:
parent
5a95f50619
commit
db5898bd67
7 changed files with 76 additions and 2 deletions
0
scripts/editable-installs/root_editable/README.md
Normal file
0
scripts/editable-installs/root_editable/README.md
Normal file
22
scripts/editable-installs/root_editable/pyproject.toml
Normal file
22
scripts/editable-installs/root_editable/pyproject.toml
Normal file
|
@ -0,0 +1,22 @@
|
|||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "root-editable"
|
||||
description = 'A simple editable package with a {root:uri} dependency.'
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.7"
|
||||
license = "MIT"
|
||||
keywords = []
|
||||
authors = [
|
||||
{ name = "Astral Software Inc.", email = "hey@astral.sh" },
|
||||
]
|
||||
classifiers = []
|
||||
dependencies = [
|
||||
"black @ {root:uri}/../black_editable"
|
||||
]
|
||||
version = "0.1.0"
|
||||
|
||||
[tool.hatch.metadata]
|
||||
allow-direct-references = true
|
|
@ -0,0 +1,2 @@
|
|||
def func():
|
||||
pass
|
Loading…
Add table
Add a link
Reference in a new issue