From 60481a2df22354eeb7f50b450aa1811e3a289445 Mon Sep 17 00:00:00 2001 From: Jon Burdo Date: Fri, 29 May 2026 15:42:17 -0400 Subject: [PATCH] fix: scope hatch packages directive to wheel target only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The packages directive was under [tool.hatch.build] (general), which applies to both wheel and sdist targets. Hatchling's sdist builder flattens the src-layout, placing model_signing/ at the archive root, but the embedded pyproject.toml still references src/model_signing — a path that no longer exists in the sdist. This causes pip to install an empty wheel with zero Python modules. Moving the directive to [tool.hatch.build.targets.wheel] lets the sdist target use hatchling's default behavior (preserve the full source tree including the src/ prefix), so the packages path matches the actual layout when installing from source distributions. Resolves: #636 Signed-off-by: Jon Burdo --- CHANGELOG.md | 1 + pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c81b18a3..849d19d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ All versions prior to 1.0.0 are untracked. - Standardized CLI flags to use hyphens (e.g., `--trust-config` instead of `--trust_config`). Underscore variants are still accepted for backwards compatibility via token normalization. ### Fixed +- Fixed a bug where installing from the sdist produced an empty wheel with zero Python modules. The hatch `packages` directive was scoped to all build targets instead of the wheel target only, causing the sdist's flattened layout to not match the expected `src/` path. ([#636](https://github.com/sigstore/model-transparency/issues/636)) - Fixed a bug where ignored symlinks could raise `ValueError`s if allow_symlinks was unset, even though they were skipped during serialization. ([#550](https://github.com/sigstore/model-transparency/pull/550)) - Fixed a bug where any PEM encoded key could be read during the key-based flows which resulted in a Python exception because the rest of the code only supported elliptic curve keys. ([#573](https://github.com/sigstore/model-transparency/pull/573)) diff --git a/pyproject.toml b/pyproject.toml index 04f913c9..6d6b4288 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,7 +75,7 @@ PyPI = "https://pypi.org/project/model-signing/" [tool.hatch.version] path = "src/model_signing/__init__.py" -[tool.hatch.build] +[tool.hatch.build.targets.wheel] packages = ["src/model_signing"] [tool.hatch.envs.hatch-test]