datashare-python 0.2.20__tar.gz → 0.2.21__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {datashare_python-0.2.20 → datashare_python-0.2.21}/PKG-INFO +1 -1
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/template.py +14 -6
- datashare_python-0.2.21/datashare_python/worker-template.tar.gz +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/pyproject.toml +1 -1
- datashare_python-0.2.20/datashare_python/worker-template.tar.gz +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/.gitignore +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/README.md +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/.gitignore +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/__init__.py +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/__main__.py +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/cli/__init__.py +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/cli/local.py +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/cli/project.py +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/cli/task.py +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/cli/utils.py +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/cli/worker.py +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/config.py +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/conftest.py +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/constants.py +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/dependencies.py +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/discovery.py +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/exceptions.py +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/local_client.py +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/objects.py +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/task_client.py +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/types_.py +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/utils.py +0 -0
- {datashare_python-0.2.20 → datashare_python-0.2.21}/datashare_python/worker.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: datashare-python
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.21
|
|
4
4
|
Summary: Manage Pythoœn tasks and local resources in Datashare
|
|
5
5
|
Project-URL: Homepage, https://icij.github.io/datashare-python/
|
|
6
6
|
Project-URL: Documentation, https://icij.github.io/datashare-python/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import os
|
|
2
|
+
import shutil
|
|
2
3
|
import tarfile
|
|
3
4
|
from copy import deepcopy
|
|
4
5
|
from importlib.resources import as_file, files
|
|
@@ -48,14 +49,17 @@ def build_template_tarball() -> None:
|
|
|
48
49
|
def init_project(name: str, path: Path) -> None:
|
|
49
50
|
destination = path / name
|
|
50
51
|
template_tar = files("datashare_python")
|
|
52
|
+
package_name = name.replace("-", "_").lower()
|
|
51
53
|
with (
|
|
52
54
|
as_file(template_tar / "worker-template.tar.gz") as tar_path,
|
|
53
55
|
tarfile.open(tar_path, mode="r:gz") as tar,
|
|
54
56
|
):
|
|
55
57
|
tar.extractall(destination)
|
|
58
|
+
package_dir = destination / package_name
|
|
59
|
+
shutil.move(destination / "worker_template", package_dir)
|
|
56
60
|
pyproject_toml_path = destination / "pyproject.toml"
|
|
57
61
|
pyproject_toml = tomlkit.loads(pyproject_toml_path.read_text())
|
|
58
|
-
pyproject_toml = _update_pyproject_toml(pyproject_toml,
|
|
62
|
+
pyproject_toml = _update_pyproject_toml(pyproject_toml, package_name=package_name)
|
|
59
63
|
pyproject_toml_path.write_text(tomlkit.dumps(pyproject_toml))
|
|
60
64
|
|
|
61
65
|
|
|
@@ -63,10 +67,8 @@ _BASE_DEPS = {"datashare-python", "icij-common", "temporalio"}
|
|
|
63
67
|
|
|
64
68
|
|
|
65
69
|
def _update_pyproject_toml(
|
|
66
|
-
pyproject_toml: dict[str, Any], *,
|
|
70
|
+
pyproject_toml: dict[str, Any], *, package_name: str
|
|
67
71
|
) -> dict[str, Any]:
|
|
68
|
-
lower_snaked = project_name.replace("-", "_").lower()
|
|
69
|
-
|
|
70
72
|
pyproject_toml = deepcopy(pyproject_toml)
|
|
71
73
|
|
|
72
74
|
pyproject_toml["tool"]["uv"].pop("sources")
|
|
@@ -90,13 +92,19 @@ def _update_pyproject_toml(
|
|
|
90
92
|
entry_points = project["entry-points"]
|
|
91
93
|
|
|
92
94
|
wf_entry_point = entry_points["datashare.workflows"]["workflows"]
|
|
93
|
-
wf_entry_point = wf_entry_point.replace("worker_template",
|
|
95
|
+
wf_entry_point = wf_entry_point.replace("worker_template", package_name)
|
|
94
96
|
entry_points["datashare.workflows"]["workflows"] = wf_entry_point
|
|
95
97
|
|
|
96
98
|
activities_entry_point = entry_points["datashare.activities"]["activities"]
|
|
97
99
|
activities_entry_point = activities_entry_point.replace(
|
|
98
|
-
"worker_template",
|
|
100
|
+
"worker_template", package_name
|
|
99
101
|
)
|
|
100
102
|
entry_points["datashare.activities"]["activities"] = activities_entry_point
|
|
101
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"]
|
|
108
|
+
]
|
|
109
|
+
|
|
102
110
|
return pyproject_toml
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|