Skip to content

Commit e8d0b0b

Browse files
committed
fix(datashare-python,worker-template): template package name
1 parent e40ea2f commit e8d0b0b

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

datashare-python/datashare_python/template.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,9 @@ def _update_pyproject_toml(
100100
"worker_template", package_name
101101
)
102102
entry_points["datashare.activities"]["activities"] = activities_entry_point
103-
104-
hatch_sdist = pyproject_toml["tool"]["hatch"]["build"]["targets"]["sdist"]
105-
hatch_sdist["only-include"] = [
106-
i if i != "worker_template" else package_name
107-
for i in hatch_sdist["only-include"]
103+
hatch_sdist = pyproject_toml["tool"]["hatch"]["build"]["targets"]["wheel"]
104+
hatch_sdist["packages"] = [
105+
i if i != "worker_template" else package_name for i in hatch_sdist["packages"]
108106
]
109107

110108
return pyproject_toml

datashare-python/tests/test_template.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ async def test_init_project(
4343
acts = entry_points["datashare.activities"]["activities"]
4444
assert acts == "test_project.activities:ACTIVITIES"
4545

46-
hatch_sdist = pyproject_toml["tool"]["hatch"]["build"]["targets"]["sdist"]
47-
assert hatch_sdist["only-include"] == ["test_project"]
46+
hatch_sdist = pyproject_toml["tool"]["hatch"]["build"]["targets"]["wheel"]
47+
assert hatch_sdist["packages"] == ["test_project"]

worker-template/pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "datashare-worker-template"
3-
version = "0.1.4"
3+
version = "0.1.5"
44
description = "Datashare worker template"
55
authors = [
66
{ name = "Clément Doumouro", email = "cdoumouro@icij.org" },
@@ -60,8 +60,13 @@ requires = ["hatchling"]
6060
build-backend = "hatchling.build"
6161
package = ["worker_template"]
6262

63+
[tool.hatch.build.targets.wheel]
64+
packages = ["worker_template"]
65+
6366
[tool.hatch.build.targets.sdist]
64-
only-include = ["worker_template"]
67+
exclude = [
68+
"tests"
69+
]
6570

6671
[tool.pytest.ini_options]
6772
asyncio_mode = "auto"

0 commit comments

Comments
 (0)