arkindex-base-worker 0.3.7__tar.gz → 0.3.7.post1__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.
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/PKG-INFO +4 -7
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/README.md +1 -1
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_base_worker.egg-info/PKG-INFO +4 -7
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_base_worker.egg-info/requires.txt +2 -5
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/worker/base.py +3 -23
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/worker/training.py +3 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/pyproject.toml +3 -10
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/tests/conftest.py +1 -1
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/tests/test_dataset_worker.py +1 -1
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/tests/test_elements_worker/test_training.py +1 -1
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/LICENSE +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_base_worker.egg-info/SOURCES.txt +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_base_worker.egg-info/dependency_links.txt +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_base_worker.egg-info/top_level.txt +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/__init__.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/cache.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/image.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/models.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/utils.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/worker/__init__.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/worker/classification.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/worker/dataset.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/worker/element.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/worker/entity.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/worker/metadata.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/worker/task.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/worker/transcription.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/worker/version.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/hooks/pre_gen_project.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/setup.cfg +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/tests/__init__.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/tests/test_base_worker.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/tests/test_cache.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/tests/test_element.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/tests/test_elements_worker/__init__.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/tests/test_elements_worker/test_classifications.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/tests/test_elements_worker/test_cli.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/tests/test_elements_worker/test_dataset.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/tests/test_elements_worker/test_elements.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/tests/test_elements_worker/test_entities.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/tests/test_elements_worker/test_metadata.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/tests/test_elements_worker/test_task.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/tests/test_elements_worker/test_transcriptions.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/tests/test_elements_worker/test_worker.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/tests/test_image.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/tests/test_merge.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/tests/test_utils.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/worker-demo/tests/__init__.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/worker-demo/tests/conftest.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/worker-demo/tests/test_worker.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/worker-demo/worker_demo/__init__.py +0 -0
- {arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/worker-demo/worker_demo/worker.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: arkindex-base-worker
|
|
3
|
-
Version: 0.3.7
|
|
3
|
+
Version: 0.3.7.post1
|
|
4
4
|
Summary: Base Worker to easily build Arkindex ML workflows
|
|
5
5
|
Author-email: Teklia <contact@teklia.com>
|
|
6
6
|
Maintainer-email: Teklia <contact@teklia.com>
|
|
@@ -41,19 +41,16 @@ Classifier: Topic :: Text Processing :: Linguistic
|
|
|
41
41
|
Requires-Python: >=3.10
|
|
42
42
|
Description-Content-Type: text/markdown
|
|
43
43
|
License-File: LICENSE
|
|
44
|
-
Requires-Dist: peewee
|
|
44
|
+
Requires-Dist: peewee~=3.17
|
|
45
45
|
Requires-Dist: Pillow==10.3.0
|
|
46
|
-
Requires-Dist: pymdown-extensions==10.7.1
|
|
47
46
|
Requires-Dist: python-gnupg==0.5.2
|
|
48
47
|
Requires-Dist: shapely==2.0.3
|
|
49
|
-
Requires-Dist: teklia-toolbox==0.1.
|
|
48
|
+
Requires-Dist: teklia-toolbox==0.1.5
|
|
50
49
|
Requires-Dist: zstandard==0.22.0
|
|
51
50
|
Provides-Extra: docs
|
|
52
51
|
Requires-Dist: black==24.4.0; extra == "docs"
|
|
53
|
-
Requires-Dist: doc8==1.1.1; extra == "docs"
|
|
54
52
|
Requires-Dist: mkdocs-material==9.5.17; extra == "docs"
|
|
55
53
|
Requires-Dist: mkdocstrings-python==1.9.2; extra == "docs"
|
|
56
|
-
Requires-Dist: recommonmark==0.7.1; extra == "docs"
|
|
57
54
|
Provides-Extra: tests
|
|
58
55
|
Requires-Dist: pytest==8.1.1; extra == "tests"
|
|
59
56
|
Requires-Dist: pytest-mock==3.14.0; extra == "tests"
|
|
@@ -71,7 +68,7 @@ The [documentation](https://workers.arkindex.org/) is made with [Material for Mk
|
|
|
71
68
|
|
|
72
69
|
## Create a new worker using our template
|
|
73
70
|
|
|
74
|
-
```
|
|
71
|
+
```shell
|
|
75
72
|
pip install --user cookiecutter
|
|
76
73
|
cookiecutter git@gitlab.teklia.com:workers/base-worker.git
|
|
77
74
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: arkindex-base-worker
|
|
3
|
-
Version: 0.3.7
|
|
3
|
+
Version: 0.3.7.post1
|
|
4
4
|
Summary: Base Worker to easily build Arkindex ML workflows
|
|
5
5
|
Author-email: Teklia <contact@teklia.com>
|
|
6
6
|
Maintainer-email: Teklia <contact@teklia.com>
|
|
@@ -41,19 +41,16 @@ Classifier: Topic :: Text Processing :: Linguistic
|
|
|
41
41
|
Requires-Python: >=3.10
|
|
42
42
|
Description-Content-Type: text/markdown
|
|
43
43
|
License-File: LICENSE
|
|
44
|
-
Requires-Dist: peewee
|
|
44
|
+
Requires-Dist: peewee~=3.17
|
|
45
45
|
Requires-Dist: Pillow==10.3.0
|
|
46
|
-
Requires-Dist: pymdown-extensions==10.7.1
|
|
47
46
|
Requires-Dist: python-gnupg==0.5.2
|
|
48
47
|
Requires-Dist: shapely==2.0.3
|
|
49
|
-
Requires-Dist: teklia-toolbox==0.1.
|
|
48
|
+
Requires-Dist: teklia-toolbox==0.1.5
|
|
50
49
|
Requires-Dist: zstandard==0.22.0
|
|
51
50
|
Provides-Extra: docs
|
|
52
51
|
Requires-Dist: black==24.4.0; extra == "docs"
|
|
53
|
-
Requires-Dist: doc8==1.1.1; extra == "docs"
|
|
54
52
|
Requires-Dist: mkdocs-material==9.5.17; extra == "docs"
|
|
55
53
|
Requires-Dist: mkdocstrings-python==1.9.2; extra == "docs"
|
|
56
|
-
Requires-Dist: recommonmark==0.7.1; extra == "docs"
|
|
57
54
|
Provides-Extra: tests
|
|
58
55
|
Requires-Dist: pytest==8.1.1; extra == "tests"
|
|
59
56
|
Requires-Dist: pytest-mock==3.14.0; extra == "tests"
|
|
@@ -71,7 +68,7 @@ The [documentation](https://workers.arkindex.org/) is made with [Material for Mk
|
|
|
71
68
|
|
|
72
69
|
## Create a new worker using our template
|
|
73
70
|
|
|
74
|
-
```
|
|
71
|
+
```shell
|
|
75
72
|
pip install --user cookiecutter
|
|
76
73
|
cookiecutter git@gitlab.teklia.com:workers/base-worker.git
|
|
77
74
|
```
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
peewee
|
|
1
|
+
peewee~=3.17
|
|
2
2
|
Pillow==10.3.0
|
|
3
|
-
pymdown-extensions==10.7.1
|
|
4
3
|
python-gnupg==0.5.2
|
|
5
4
|
shapely==2.0.3
|
|
6
|
-
teklia-toolbox==0.1.
|
|
5
|
+
teklia-toolbox==0.1.5
|
|
7
6
|
zstandard==0.22.0
|
|
8
7
|
|
|
9
8
|
[docs]
|
|
10
9
|
black==24.4.0
|
|
11
|
-
doc8==1.1.1
|
|
12
10
|
mkdocs-material==9.5.17
|
|
13
11
|
mkdocstrings-python==1.9.2
|
|
14
|
-
recommonmark==0.7.1
|
|
15
12
|
|
|
16
13
|
[tests]
|
|
17
14
|
pytest==8.1.1
|
{arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/worker/base.py
RENAMED
|
@@ -13,14 +13,8 @@ from tempfile import mkdtemp
|
|
|
13
13
|
import gnupg
|
|
14
14
|
import yaml
|
|
15
15
|
from apistar.exceptions import ErrorResponse
|
|
16
|
-
from tenacity import (
|
|
17
|
-
before_sleep_log,
|
|
18
|
-
retry,
|
|
19
|
-
retry_if_exception,
|
|
20
|
-
stop_after_attempt,
|
|
21
|
-
wait_exponential,
|
|
22
|
-
)
|
|
23
16
|
|
|
17
|
+
from arkindex import options_from_env
|
|
24
18
|
from arkindex_worker import logger
|
|
25
19
|
from arkindex_worker.cache import (
|
|
26
20
|
check_version,
|
|
@@ -30,7 +24,7 @@ from arkindex_worker.cache import (
|
|
|
30
24
|
merge_parents_cache,
|
|
31
25
|
)
|
|
32
26
|
from arkindex_worker.utils import close_delete_file, extract_tar_zst_archive
|
|
33
|
-
from teklia_toolbox.requests import
|
|
27
|
+
from teklia_toolbox.requests import get_arkindex_client
|
|
34
28
|
|
|
35
29
|
|
|
36
30
|
class ExtrasDirNotFoundError(Exception):
|
|
@@ -185,7 +179,7 @@ class BaseWorker:
|
|
|
185
179
|
Create an ArkindexClient to make API requests towards Arkindex instances.
|
|
186
180
|
"""
|
|
187
181
|
# Build Arkindex API client from environment variables
|
|
188
|
-
self.api_client =
|
|
182
|
+
self.api_client = get_arkindex_client(**options_from_env())
|
|
189
183
|
logger.debug(f"Setup Arkindex API client on {self.api_client.document.url}")
|
|
190
184
|
|
|
191
185
|
def configure_for_developers(self):
|
|
@@ -477,23 +471,9 @@ class BaseWorker:
|
|
|
477
471
|
# Clean up
|
|
478
472
|
shutil.rmtree(base_extracted_path)
|
|
479
473
|
|
|
480
|
-
@retry(
|
|
481
|
-
retry=retry_if_exception(_is_500_error),
|
|
482
|
-
wait=wait_exponential(multiplier=2, min=3),
|
|
483
|
-
reraise=True,
|
|
484
|
-
stop=stop_after_attempt(5),
|
|
485
|
-
before_sleep=before_sleep_log(logger, logging.INFO),
|
|
486
|
-
)
|
|
487
474
|
def request(self, *args, **kwargs):
|
|
488
475
|
"""
|
|
489
476
|
Wrapper around the ``ArkindexClient.request`` method.
|
|
490
|
-
|
|
491
|
-
The API call will be retried up to 5 times in case of HTTP 5xx errors,
|
|
492
|
-
with an exponential sleep time of 3, 4, 8 and 16 seconds between calls.
|
|
493
|
-
If the 5th call still causes an HTTP 5xx error, the exception is re-raised
|
|
494
|
-
and the caller should catch it.
|
|
495
|
-
|
|
496
|
-
Log messages are displayed when an HTTP 5xx error occurs, before waiting for the next call.
|
|
497
477
|
"""
|
|
498
478
|
return self.api_client.request(*args, **kwargs)
|
|
499
479
|
|
|
@@ -4,16 +4,15 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "arkindex-base-worker"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.7post1"
|
|
8
8
|
description = "Base Worker to easily build Arkindex ML workflows"
|
|
9
9
|
license = { file = "LICENSE" }
|
|
10
10
|
dependencies = [
|
|
11
|
-
"peewee
|
|
11
|
+
"peewee~=3.17",
|
|
12
12
|
"Pillow==10.3.0",
|
|
13
|
-
"pymdown-extensions==10.7.1",
|
|
14
13
|
"python-gnupg==0.5.2",
|
|
15
14
|
"shapely==2.0.3",
|
|
16
|
-
"teklia-toolbox==0.1.
|
|
15
|
+
"teklia-toolbox==0.1.5",
|
|
17
16
|
"zstandard==0.22.0",
|
|
18
17
|
]
|
|
19
18
|
authors = [
|
|
@@ -46,10 +45,8 @@ Authors = "https://teklia.com"
|
|
|
46
45
|
[project.optional-dependencies]
|
|
47
46
|
docs = [
|
|
48
47
|
"black==24.4.0",
|
|
49
|
-
"doc8==1.1.1",
|
|
50
48
|
"mkdocs-material==9.5.17",
|
|
51
49
|
"mkdocstrings-python==1.9.2",
|
|
52
|
-
"recommonmark==0.7.1",
|
|
53
50
|
]
|
|
54
51
|
tests = [
|
|
55
52
|
"pytest==8.1.1",
|
|
@@ -112,7 +109,3 @@ known-third-party = [
|
|
|
112
109
|
"yaml",
|
|
113
110
|
"zstandard",
|
|
114
111
|
]
|
|
115
|
-
|
|
116
|
-
[tool.doc8]
|
|
117
|
-
ignore-path=["*.egg-info", "public", ".git"]
|
|
118
|
-
extensions=[".md"]
|
|
@@ -93,7 +93,7 @@ def _setup_api(responses, monkeypatch, _cache_yaml):
|
|
|
93
93
|
|
|
94
94
|
# Fallback to prod environment
|
|
95
95
|
if schema_url is None:
|
|
96
|
-
schema_url = "https://arkindex.teklia.com/api/v1/openapi/?format=
|
|
96
|
+
schema_url = "https://arkindex.teklia.com/api/v1/openapi/?format=json"
|
|
97
97
|
monkeypatch.setenv("ARKINDEX_API_SCHEMA_URL", schema_url)
|
|
98
98
|
|
|
99
99
|
# Allow accessing remote API schemas
|
{arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/tests/test_dataset_worker.py
RENAMED
|
@@ -522,7 +522,7 @@ def test_run_download_dataset_artifact_api_error(
|
|
|
522
522
|
*[
|
|
523
523
|
(
|
|
524
524
|
logging.INFO,
|
|
525
|
-
f"Retrying
|
|
525
|
+
f"Retrying arkindex.client.ArkindexClient.request in {retry} seconds as it raised ErrorResponse: .",
|
|
526
526
|
)
|
|
527
527
|
for retry in [3.0, 4.0, 8.0, 16.0]
|
|
528
528
|
],
|
|
@@ -184,7 +184,7 @@ def test_validate_model_version_catch_errors(
|
|
|
184
184
|
mocker, mock_training_worker, caplog, status_code
|
|
185
185
|
):
|
|
186
186
|
mocker.patch(
|
|
187
|
-
"
|
|
187
|
+
"arkindex.client.ArkindexClient.request.retry.retry", return_value=False
|
|
188
188
|
)
|
|
189
189
|
|
|
190
190
|
mock_training_worker.model_version = {"id": "model_version_id"}
|
|
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
|
{arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/worker/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/worker/dataset.py
RENAMED
|
File without changes
|
{arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/worker/element.py
RENAMED
|
File without changes
|
{arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/worker/entity.py
RENAMED
|
File without changes
|
{arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/worker/metadata.py
RENAMED
|
File without changes
|
{arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/worker/task.py
RENAMED
|
File without changes
|
|
File without changes
|
{arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/arkindex_worker/worker/version.py
RENAMED
|
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
|
{arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/worker-demo/tests/__init__.py
RENAMED
|
File without changes
|
{arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/worker-demo/tests/conftest.py
RENAMED
|
File without changes
|
{arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/worker-demo/tests/test_worker.py
RENAMED
|
File without changes
|
{arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/worker-demo/worker_demo/__init__.py
RENAMED
|
File without changes
|
{arkindex_base_worker-0.3.7 → arkindex_base_worker-0.3.7.post1}/worker-demo/worker_demo/worker.py
RENAMED
|
File without changes
|