-
Notifications
You must be signed in to change notification settings - Fork 883
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 #2475.
- Loading branch information
1 parent
5a95f50
commit db5898b
Showing
7 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
2 changes: 2 additions & 0 deletions
2
scripts/editable-installs/root_editable/root_editable/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def func(): | ||
pass |