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