From 479d4ca6f165a9eef2b0fa67dd7b79a944830fe8 Mon Sep 17 00:00:00 2001 From: Ofek Lev Date: Wed, 8 May 2024 12:03:05 -0400 Subject: [PATCH 1/4] Update Hatchling build backend --- pyproject.toml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 067643519..51519cd90 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,14 +5,7 @@ # entry point metadata so the hook is discovered. backend-path = ["build-backend"] build-backend = "pex_build.hatchling.build" - -# The hatchling 1.22.0 release breaks our build in several ways: -# + Our console scripts are no longer generated. -# + The `project.readme` pyproject.toml key now has its value hydrated before our metadata plugin -# runs, which foils our metadata expansion since our README.rst contains inadvertant expansion -# tokens. -# This pin low buys time to work through the issues. -requires = ["hatchling<1.22.0"] +requires = ["hatchling>=1.22.5"] [tool.hatch.metadata.hooks.pex-adjust-metadata] expand = {"pex_version" = "version"} From 32df1420c785ae842c719ed306433f1ebc833401 Mon Sep 17 00:00:00 2001 From: Ofek Lev Date: Wed, 8 May 2024 12:08:28 -0400 Subject: [PATCH 2/4] support Python 2 apparently --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 51519cd90..1b47ea741 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ # entry point metadata so the hook is discovered. backend-path = ["build-backend"] build-backend = "pex_build.hatchling.build" -requires = ["hatchling>=1.22.5"] +requires = ["hatchling"] [tool.hatch.metadata.hooks.pex-adjust-metadata] expand = {"pex_version" = "version"} From 2c58c060e7d0a07e0590741ffe3e158f55462759 Mon Sep 17 00:00:00 2001 From: Ofek Lev Date: Wed, 8 May 2024 13:03:21 -0400 Subject: [PATCH 3/4] properly define field as dynamic --- build-backend/pex_build/hatchling/metadata_hook.py | 2 ++ pyproject.toml | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build-backend/pex_build/hatchling/metadata_hook.py b/build-backend/pex_build/hatchling/metadata_hook.py index 196f9d4d4..47de5989a 100644 --- a/build-backend/pex_build/hatchling/metadata_hook.py +++ b/build-backend/pex_build/hatchling/metadata_hook.py @@ -48,6 +48,8 @@ def update(self, metadata): file=sys.stderr, ) metadata["requires-python"] = requires_python + else: + metadata["requires-python"] = ">=2.7,<3.13,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*" expand = self.config.get("expand") if expand: diff --git a/pyproject.toml b/pyproject.toml index 1b47ea741..d391bf113 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,8 +15,7 @@ expand = {"pex_version" = "version"} [project] name = "pex" -dynamic = ["version"] -requires-python = ">=2.7,<3.13,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*" +dynamic = ["version", "requires-python"] authors = [ {name = "The PEX developers", email="developers@pex-tool.org"} ] From 920dffa48d5edfabe814bce0d61671c8f34d94f2 Mon Sep 17 00:00:00 2001 From: Ofek Lev Date: Wed, 8 May 2024 13:51:24 -0400 Subject: [PATCH 4/4] properly define URLs field as dynamic --- build-backend/pex_build/hatchling/metadata_hook.py | 8 ++++++++ pyproject.toml | 9 +-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/build-backend/pex_build/hatchling/metadata_hook.py b/build-backend/pex_build/hatchling/metadata_hook.py index 47de5989a..aec544ebe 100644 --- a/build-backend/pex_build/hatchling/metadata_hook.py +++ b/build-backend/pex_build/hatchling/metadata_hook.py @@ -51,6 +51,14 @@ def update(self, metadata): else: metadata["requires-python"] = ">=2.7,<3.13,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*" + metadata["urls"] = { + "Changelog": "https://github.com/pex-tool/pex/blob/v{pex_version}/CHANGES.md", + "Documentation": "https://docs.pex-tool.org/", + "Download": "https://github.com/pex-tool/pex/releases/download/v{pex_version}/pex", + "Homepage": "https://github.com/pex-tool/pex", + "Source": "https://github.com/pex-tool/pex/tree/v{pex_version}", + } + expand = self.config.get("expand") if expand: metadata.update( diff --git a/pyproject.toml b/pyproject.toml index d391bf113..64b0aba5c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ expand = {"pex_version" = "version"} [project] name = "pex" -dynamic = ["version", "requires-python"] +dynamic = ["version", "requires-python", "urls"] authors = [ {name = "The PEX developers", email="developers@pex-tool.org"} ] @@ -63,13 +63,6 @@ pex-tools = "pex.tools.main:main" [project.entry-points."distutils.commands"] bdist_pex = "pex.distutils.commands.bdist_pex:bdist_pex" -[project.urls] -Changelog = "https://github.com/pex-tool/pex/blob/v{pex_version}/CHANGES.md" -Documentation = "https://docs.pex-tool.org/" -Download = "https://github.com/pex-tool/pex/releases/download/v{pex_version}/pex" -Homepage = "https://github.com/pex-tool/pex" -Source = "https://github.com/pex-tool/pex/tree/v{pex_version}" - [tool.hatch.version] path = "pex/version.py" pattern = '__version__ = "(?P[^"]+)"'