-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid
prepare_metadata_for_build_wheel
calls for Hatch packages wit…
…h dynamic dependencies (#2645) ## Summary Hatch allows for highly dynamic customization of metadata via hooks. In such cases, Hatch can't upload the PEP 517 contract, in that the metadata Hatch would return by `prepare_metadata_for_build_wheel` isn't guaranteed to match that of the built wheel. Hatch disables `prepare_metadata_for_build_wheel` entirely for pip. We'll instead disable it on our end when metadata is defined as "dynamic" in the pyproject.toml, which should allow us to leverage the hook in _most_ cases while still avoiding incorrect metadata for the remaining cases. Closes: #2130.
- Loading branch information
1 parent
786598b
commit 5270624
Showing
5 changed files
with
103 additions
and
12 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from hatchling.builders.hooks.plugin.interface import BuildHookInterface | ||
|
||
|
||
class LiteraryBuildHook(BuildHookInterface): | ||
def initialize(self, version, build_data): | ||
build_data["dependencies"].append("anyio") |
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,10 @@ | ||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "hatchling-dynamic" | ||
version = "1.0.0" | ||
dynamic = ["dependencies"] | ||
|
||
[tool.hatch.build.targets.wheel.hooks.custom] |