Fix Python package build contents (file selection)
Marco Ricci

Marco Ricci commited on 2024-07-22 08:46:54
Zeige 2 geänderte Dateien mit 10 Einfügungen und 0 Löschungen.


Because `hatch` was using heuristics to determine what to include in the
Python (distribution-)package, some files that were supposed to be
included (the `sequin` and `ssh_agent_client` modules in the `wheel`)
were actually excluded, and some files that were supposed to be excluded
(VCS artifacts from `coverage` and `towncrier`) were actually included.
So, explicitly configure what to include and exclude in the project
settings.
... ...
@@ -57,6 +57,14 @@ xfail_strict = true
57 57
 [tool.hatch.version]
58 58
 path = "src/derivepassphrase/__init__.py"
59 59
 
60
+[tool.hatch.build.targets.sdist]
61
+exclude = [
62
+    'towncrier.d/[0123456789+]*.md',
63
+]
64
+
65
+[tool.hatch.build.targets.wheel]
66
+packages = ['src/derivepassphrase', 'src/sequin', 'src/ssh_agent_client']
67
+
60 68
 [tool.hatch.envs.hatch-test]
61 69
 default-args = ['src', 'tests']
62 70
 
... ...
@@ -0,0 +1,2 @@
1
+
2
+Include and exclude the correct files in the `sdist` and `wheel` distributions.  (Previously, `sdist` contained VCS artifacts, and `wheel` was missing some paths.)
0 3