From 1d8cd296cbfcf9eb659ee2ffc1b4541db5e54373 Mon Sep 17 00:00:00 2001 From: Ofek Lev Date: Sun, 10 Nov 2024 10:06:55 -0500 Subject: [PATCH 1/2] Fix breaking changes (#1795) --- .github/workflows/build-hatch.yml | 5 ++++- backend/src/hatchling/dep/__init__.py | 0 backend/src/hatchling/dep/core.py | 1 + backend/src/hatchling/metadata/core.py | 3 +++ docs/config/metadata.md | 20 +++++--------------- docs/history/hatchling.md | 9 +++++++++ 6 files changed, 22 insertions(+), 16 deletions(-) create mode 100644 backend/src/hatchling/dep/__init__.py create mode 100644 backend/src/hatchling/dep/core.py diff --git a/.github/workflows/build-hatch.yml b/.github/workflows/build-hatch.yml index ecd328094..fb326a98a 100644 --- a/.github/workflows/build-hatch.yml +++ b/.github/workflows/build-hatch.yml @@ -48,7 +48,10 @@ jobs: uses: astral-sh/setup-uv@v3 - name: Install tools - run: uv pip install --system build hatch + run: |- + uv pip install --system build + uv pip install --system . + uv pip install --system ./backend # Windows installers don't accept non-integer versions so we ubiquitously # perform the following transformation: X.Y.Z.devN -> X.Y.Z.N diff --git a/backend/src/hatchling/dep/__init__.py b/backend/src/hatchling/dep/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/backend/src/hatchling/dep/core.py b/backend/src/hatchling/dep/core.py new file mode 100644 index 000000000..a986a1e02 --- /dev/null +++ b/backend/src/hatchling/dep/core.py @@ -0,0 +1 @@ +from hatchling.cli.dep.core import dependencies_in_sync # noqa: F401 diff --git a/backend/src/hatchling/metadata/core.py b/backend/src/hatchling/metadata/core.py index 23bba1905..88ed55775 100644 --- a/backend/src/hatchling/metadata/core.py +++ b/backend/src/hatchling/metadata/core.py @@ -742,6 +742,9 @@ def license_files(self) -> list[str]: 'listed in field `project.dynamic`' ) raise ValueError(message) + + if isinstance(globs, dict): + globs = globs.get('globs', globs.get('paths', [])) else: globs = ['LICEN[CS]E*', 'COPYING*', 'NOTICE*', 'AUTHORS*'] diff --git a/docs/config/metadata.md b/docs/config/metadata.md index 71533e66a..c7b415792 100644 --- a/docs/config/metadata.md +++ b/docs/config/metadata.md @@ -113,21 +113,11 @@ For more information, see [PEP 639][]. === "Files" - === "Paths" - - ```toml - [project] - ... - license-files = { paths = ["LICENSE.txt"] } - ``` - - === "Globs" - - ```toml - [project] - ... - license-files = { globs = ["LICENSES/*"] } - ``` + ```toml + [project] + ... + license-files = ["LICENSES/*"] + ``` ## Ownership diff --git a/docs/history/hatchling.md b/docs/history/hatchling.md index 8e3bd4920..095238455 100644 --- a/docs/history/hatchling.md +++ b/docs/history/hatchling.md @@ -8,8 +8,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## Unreleased +***Fixed:*** + +- Add backward compatibility for the old `license-files` metadata field +- Support an old import path that is still used by some consumers like Hatch + ## [1.26.0](https://github.com/pypa/hatch/releases/tag/hatchling-v1.26.0) - 2024-11-10 ## {: #hatchling-v1.26.0 } +***Changed:*** + +- The `license-files` metadata field has been updated to the latest spec and is now just an array of glob patterns + ***Added:*** - Support version 2.4 of core metadata for the `wheel` and `sdist` targets From c1a3c6b4c86ea2affe4734b54578f032fe5d0003 Mon Sep 17 00:00:00 2001 From: Ofek Lev Date: Sun, 10 Nov 2024 10:09:27 -0500 Subject: [PATCH 2/2] release Hatchling v1.26.1 --- backend/src/hatchling/__about__.py | 2 +- docs/history/hatchling.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/hatchling/__about__.py b/backend/src/hatchling/__about__.py index 5fc7041e2..1512b413f 100644 --- a/backend/src/hatchling/__about__.py +++ b/backend/src/hatchling/__about__.py @@ -1 +1 @@ -__version__ = '1.26.0' +__version__ = '1.26.1' diff --git a/docs/history/hatchling.md b/docs/history/hatchling.md index 095238455..c5bb8829b 100644 --- a/docs/history/hatchling.md +++ b/docs/history/hatchling.md @@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## Unreleased +## [1.26.1](https://github.com/pypa/hatch/releases/tag/hatchling-v1.26.1) - 2024-11-10 ## {: #hatchling-v1.26.1 } + ***Fixed:*** - Add backward compatibility for the old `license-files` metadata field