datashare-python 0.11.1__tar.gz → 0.11.3__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.11.1 → datashare_python-0.11.3}/PKG-INFO +1 -1
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/objects.py +13 -2
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/utils.py +9 -1
- datashare_python-0.11.3/datashare_python/worker-template.tar.gz +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/pyproject.toml +1 -1
- datashare_python-0.11.1/datashare_python/worker-template.tar.gz +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/.gitignore +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/README.md +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/.gitignore +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/__init__.py +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/__main__.py +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/cli/__init__.py +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/cli/project.py +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/cli/task.py +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/cli/utils.py +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/cli/worker.py +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/config.py +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/conftest.py +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/constants.py +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/dependencies.py +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/discovery.py +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/exceptions.py +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/interceptors.py +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/logging_.py +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/mimetypes_.py +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/task_client.py +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/template.py +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/types_.py +0 -0
- {datashare_python-0.11.1 → datashare_python-0.11.3}/datashare_python/worker.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: datashare-python
|
|
3
|
-
Version: 0.11.
|
|
3
|
+
Version: 0.11.3
|
|
4
4
|
Summary: Manage Python 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/
|
|
@@ -309,8 +309,9 @@ class Document(DatashareModel):
|
|
|
309
309
|
resource_name = self.path.name
|
|
310
310
|
else:
|
|
311
311
|
msg = (
|
|
312
|
-
f"doc {self} can't turn ES document into a
|
|
313
|
-
f"without tika metadata resources name
|
|
312
|
+
f"doc {self} can't turn ES document into a"
|
|
313
|
+
f" {ProcessedFile.__name__} without tika metadata resources name"
|
|
314
|
+
f" in metadata: {self.metadata}"
|
|
314
315
|
)
|
|
315
316
|
raise ValueError(msg)
|
|
316
317
|
resource_name = cast(str, resource_name)
|
|
@@ -365,7 +366,17 @@ class ManifestEntryStatus(StrEnum):
|
|
|
365
366
|
PARTIAL = "partial"
|
|
366
367
|
|
|
367
368
|
|
|
369
|
+
class User(DatashareModel):
|
|
370
|
+
id: str
|
|
371
|
+
name: str | None = None
|
|
372
|
+
email: str | None = None
|
|
373
|
+
provider: str | None = None
|
|
374
|
+
details: dict[str, Any] = Field(default_factory=dict)
|
|
375
|
+
|
|
376
|
+
|
|
368
377
|
class TaskArgs(DatashareModel, ABC):
|
|
378
|
+
user: User | None = None
|
|
379
|
+
|
|
369
380
|
def as_manifest_task_input(self) -> dict[str, Any]:
|
|
370
381
|
# This is a base implementation, if the input is too large to be dumped,
|
|
371
382
|
# override this and pop large keys
|
|
@@ -512,13 +512,21 @@ def _write_artifact_bytes(path: Path, artifact: bytes | BytesIO | Path) -> None:
|
|
|
512
512
|
with path.open("wb") as f:
|
|
513
513
|
f.write(artifact.read())
|
|
514
514
|
case Path():
|
|
515
|
-
path
|
|
515
|
+
_remove_previous_artifacts(path)
|
|
516
516
|
shutil.move(artifact, path)
|
|
517
517
|
case _:
|
|
518
518
|
msg = f"unsupported artifact type: {artifact.__class__.__name__}"
|
|
519
519
|
raise ValueError(msg)
|
|
520
520
|
|
|
521
521
|
|
|
522
|
+
def _remove_previous_artifacts(path: Path) -> None:
|
|
523
|
+
if isinstance(path, Path) and path.exists():
|
|
524
|
+
with contextlib.suppress(FileNotFoundError):
|
|
525
|
+
shutil.rmtree(path)
|
|
526
|
+
else:
|
|
527
|
+
path.unlink(missing_ok=True)
|
|
528
|
+
|
|
529
|
+
|
|
522
530
|
def debuggable_name(
|
|
523
531
|
path: str, component_size_limit: int = 10, *, deterministic: bool = False
|
|
524
532
|
) -> str:
|
|
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
|