Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • workers/base-worker
1 result
Show changes
Commits on Source (14)
Showing
with 282 additions and 47 deletions
......@@ -374,3 +374,17 @@ def merge_parents_cache(paths: list, current_database: Path):
for statement in statements:
cursor.execute(statement)
connection.commit()
def unsupported_cache(func):
def wrapper(self, *args, **kwargs):
results = func(self, *args, **kwargs)
if not (self.is_read_only or self.use_cache):
logger.warning(
f"This API helper `{func.__name__}` did not update the cache database"
)
return results
return wrapper
......@@ -452,8 +452,9 @@ class DatasetWorker(BaseWorker, DatasetMixin, TaskMixin):
if self.generator:
assert (
dataset.state == DatasetState.Open.value
), "When generating a new dataset, its state should be Open."
dataset.state
in [DatasetState.Open.value, DatasetState.Error.value]
), "When generating a new dataset, its state should be Open or Error."
else:
assert (
dataset.state == DatasetState.Complete.value
......
......@@ -72,7 +72,7 @@ class BaseWorker:
self.parser.add_argument(
"-c",
"--config",
help="Alternative configuration file when running without a Worker Version ID",
help="Alternative configuration file when running without a Worker Run ID",
type=open,
)
self.parser.add_argument(
......@@ -94,7 +94,7 @@ class BaseWorker:
"--dev",
help=(
"Run worker in developer mode. "
"Worker will be in read-only state even if a worker_version is supplied. "
"Worker will be in read-only state even if a worker run is supplied. "
),
action="store_true",
default=False,
......@@ -176,6 +176,14 @@ class BaseWorker:
"""
return self.args.dev or self.worker_run_id is None
@property
def worker_version_id(self):
"""Deprecated property previously used to retrieve the current WorkerVersion ID.
:raises DeprecationWarning: Whenever `worker_version_id` is used.
"""
raise DeprecationWarning("`worker_version_id` usage is deprecated")
def setup_api_client(self):
"""
Create an ArkindexClient to make API requests towards Arkindex instances.
......@@ -243,10 +251,6 @@ class BaseWorker:
# Load worker version information
worker_version = worker_run["worker_version"]
# Store worker version id
self.worker_version_id = worker_version["id"]
self.worker_details = worker_version["worker"]
logger.info(f"Loaded {worker_run['summary']} from API")
......
......@@ -154,13 +154,6 @@ class ClassificationMixin:
# Detect already existing classification
if e.status_code == 400 and "non_field_errors" in e.content:
if (
"The fields element, worker_version, ml_class must make a unique set."
in e.content["non_field_errors"]
):
logger.warning(
f"This worker version has already set {ml_class} on element {element.id}"
)
elif (
"The fields element, worker_run, ml_class must make a unique set."
in e.content["non_field_errors"]
):
......
......@@ -6,6 +6,7 @@ from collections.abc import Iterator
from enum import Enum
from arkindex_worker import logger
from arkindex_worker.cache import unsupported_cache
from arkindex_worker.models import Dataset, Element
......@@ -68,6 +69,7 @@ class DatasetMixin:
return map(format_result, list(results))
@unsupported_cache
def update_dataset_state(self, dataset: Dataset, state: DatasetState) -> Dataset:
"""
Partially updates a dataset state through the API.
......
......@@ -4,11 +4,12 @@ ElementsWorker methods for elements and element types.
from collections.abc import Iterable
from typing import NamedTuple
from uuid import UUID
from warnings import warn
from peewee import IntegrityError
from arkindex_worker import logger
from arkindex_worker.cache import CachedElement, CachedImage
from arkindex_worker.cache import CachedElement, CachedImage, unsupported_cache
from arkindex_worker.models import Element
......@@ -29,6 +30,7 @@ class MissingTypeError(Exception):
class ElementMixin:
@unsupported_cache
def create_required_types(self, element_types: list[ElementType]):
"""Creates given element types in the corpus.
......@@ -81,6 +83,7 @@ class ElementMixin:
return True
@unsupported_cache
def create_sub_element(
self,
element: Element,
......@@ -283,6 +286,7 @@ class ElementMixin:
return created_ids
@unsupported_cache
def create_element_parent(
self,
parent: Element,
......@@ -422,6 +426,13 @@ class ElementMixin:
"""
List children of an element.
Warns:
----
The following parameters are **deprecated**:
- `transcription_worker_version` in favor of `transcription_worker_run`
- `worker_version` in favor of `worker_run`
:param element: Parent element to find children of.
:param folder: Restrict to or exclude elements with folder types.
This parameter is not supported when caching is enabled.
......@@ -429,9 +440,9 @@ class ElementMixin:
This parameter is not supported when caching is enabled.
:param recursive: Look for elements recursively (grand-children, etc.)
This parameter is not supported when caching is enabled.
:param transcription_worker_version: Restrict to elements that have a transcription created by a worker version with this UUID.
:param transcription_worker_version: **Deprecated** Restrict to elements that have a transcription created by a worker version with this UUID. Set to False to look for elements that have a manual transcription.
This parameter is not supported when caching is enabled.
:param transcription_worker_run: Restrict to elements that have a transcription created by a worker run with this UUID.
:param transcription_worker_run: Restrict to elements that have a transcription created by a worker run with this UUID. Set to False to look for elements that have a manual transcription.
This parameter is not supported when caching is enabled.
:param type: Restrict to elements with a specific type slug
This parameter is not supported when caching is enabled.
......@@ -447,7 +458,7 @@ class ElementMixin:
:param with_zone: Include the ``zone`` attribute in the response,
holding the element's image and polygon.
This parameter is not supported when caching is enabled.
:param worker_version: Restrict to elements created by a worker version with this UUID.
:param worker_version: **Deprecated** Restrict to elements created by a worker version with this UUID.
:param worker_run: Restrict to elements created by a worker run with this UUID.
:return: An iterable of dicts from the ``ListElementChildren`` API endpoint,
or an iterable of [CachedElement][arkindex_worker.cache.CachedElement] when caching is enabled.
......@@ -466,6 +477,11 @@ class ElementMixin:
assert isinstance(recursive, bool), "recursive should be of type bool"
query_params["recursive"] = recursive
if transcription_worker_version is not None:
warn(
"`transcription_worker_version` usage is deprecated. Consider using `transcription_worker_run` instead.",
DeprecationWarning,
stacklevel=1,
)
assert isinstance(
transcription_worker_version, str | bool
), "transcription_worker_version should be of type str or bool"
......@@ -506,6 +522,11 @@ class ElementMixin:
assert isinstance(with_zone, bool), "with_zone should be of type bool"
query_params["with_zone"] = with_zone
if worker_version is not None:
warn(
"`worker_version` usage is deprecated. Consider using `worker_run` instead.",
DeprecationWarning,
stacklevel=1,
)
assert isinstance(
worker_version, str | bool
), "worker_version should be of type str or bool"
......@@ -584,6 +605,13 @@ class ElementMixin:
"""
List parents of an element.
Warns:
----
The following parameters are **deprecated**:
- `transcription_worker_version` in favor of `transcription_worker_run`
- `worker_version` in favor of `worker_run`
:param element: Child element to find parents of.
:param folder: Restrict to or exclude elements with folder types.
This parameter is not supported when caching is enabled.
......@@ -591,7 +619,7 @@ class ElementMixin:
This parameter is not supported when caching is enabled.
:param recursive: Look for elements recursively (grand-children, etc.)
This parameter is not supported when caching is enabled.
:param transcription_worker_version: Restrict to elements that have a transcription created by a worker version with this UUID.
:param transcription_worker_version: **Deprecated** Restrict to elements that have a transcription created by a worker version with this UUID.
This parameter is not supported when caching is enabled.
:param transcription_worker_run: Restrict to elements that have a transcription created by a worker run with this UUID.
This parameter is not supported when caching is enabled.
......@@ -609,7 +637,7 @@ class ElementMixin:
:param with_zone: Include the ``zone`` attribute in the response,
holding the element's image and polygon.
This parameter is not supported when caching is enabled.
:param worker_version: Restrict to elements created by a worker version with this UUID.
:param worker_version: **Deprecated** Restrict to elements created by a worker version with this UUID.
:param worker_run: Restrict to elements created by a worker run with this UUID.
:return: An iterable of dicts from the ``ListElementParents`` API endpoint,
or an iterable of [CachedElement][arkindex_worker.cache.CachedElement] when caching is enabled.
......@@ -628,6 +656,11 @@ class ElementMixin:
assert isinstance(recursive, bool), "recursive should be of type bool"
query_params["recursive"] = recursive
if transcription_worker_version is not None:
warn(
"`transcription_worker_version` usage is deprecated. Consider using `transcription_worker_run` instead.",
DeprecationWarning,
stacklevel=1,
)
assert isinstance(
transcription_worker_version, str | bool
), "transcription_worker_version should be of type str or bool"
......@@ -668,6 +701,11 @@ class ElementMixin:
assert isinstance(with_zone, bool), "with_zone should be of type bool"
query_params["with_zone"] = with_zone
if worker_version is not None:
warn(
"`worker_version` usage is deprecated. Consider using `worker_run` instead.",
DeprecationWarning,
stacklevel=1,
)
assert isinstance(
worker_version, str | bool
), "worker_version should be of type str or bool"
......
......@@ -4,11 +4,16 @@ ElementsWorker methods for entities.
from operator import itemgetter
from typing import TypedDict
from warnings import warn
from peewee import IntegrityError
from arkindex_worker import logger
from arkindex_worker.cache import CachedEntity, CachedTranscriptionEntity
from arkindex_worker.cache import (
CachedEntity,
CachedTranscriptionEntity,
unsupported_cache,
)
from arkindex_worker.models import Element, Transcription
......@@ -28,6 +33,7 @@ class MissingEntityType(Exception):
class EntityMixin:
@unsupported_cache
def check_required_entity_types(
self, entity_types: list[str], create_missing: bool = True
):
......@@ -205,6 +211,7 @@ class EntityMixin:
)
return transcription_ent
@unsupported_cache
def create_transcription_entities(
self,
transcription: Transcription,
......@@ -297,13 +304,21 @@ class EntityMixin:
self,
transcription: Transcription,
worker_version: str | bool | None = None,
worker_run: str | bool | None = None,
):
"""
List existing entities on a transcription
This method does not support cache
Warns:
----
The following parameters are **deprecated**:
- `worker_version` in favor of `worker_run`
:param transcription: The transcription to list entities on.
:param worker_version: Restrict to entities created by a worker version with this UUID. Set to False to look for manually created transcriptions.
:param worker_version: **Deprecated** Restrict to entities created by a worker version with this UUID. Set to False to look for manually created entities.
:param worker_run: Restrict to entities created by a worker run with this UUID. Set to False to look for manually created entities.
"""
query_params = {}
assert transcription and isinstance(
......@@ -311,6 +326,11 @@ class EntityMixin:
), "transcription shouldn't be null and should be a Transcription"
if worker_version is not None:
warn(
"`worker_version` usage is deprecated. Consider using `worker_run` instead.",
DeprecationWarning,
stacklevel=1,
)
assert isinstance(
worker_version, str | bool
), "worker_version should be of type str or bool"
......@@ -320,6 +340,15 @@ class EntityMixin:
worker_version is False
), "if of type bool, worker_version can only be set to False"
query_params["worker_version"] = worker_version
if worker_run is not None:
assert isinstance(
worker_run, str | bool
), "worker_run should be of type str or bool"
if isinstance(worker_run, bool):
assert (
worker_run is False
), "if of type bool, worker_run can only be set to False"
query_params["worker_run"] = worker_run
return self.api_client.paginate(
"ListTranscriptionEntities", id=transcription.id, **query_params
......
......@@ -5,7 +5,7 @@ ElementsWorker methods for metadata.
from enum import Enum
from arkindex_worker import logger
from arkindex_worker.cache import CachedElement
from arkindex_worker.cache import CachedElement, unsupported_cache
from arkindex_worker.models import Element
......@@ -56,6 +56,7 @@ class MetaType(Enum):
class MetaDataMixin:
@unsupported_cache
def create_metadata(
self,
element: Element | CachedElement,
......@@ -106,6 +107,7 @@ class MetaDataMixin:
return metadata["id"]
@unsupported_cache
def create_metadatas(
self,
element: Element | CachedElement,
......@@ -178,16 +180,24 @@ class MetaDataMixin:
return created_metadata_list
def list_element_metadata(
self, element: Element | CachedElement
self, element: Element | CachedElement, load_parents: bool | None = None
) -> list[dict[str, str]]:
"""
List all metadata linked to an element.
This method does not support cache.
:param element: The element to list metadata on.
:param load_parents: Also include all metadata from the element's parents in the response.
"""
assert element and isinstance(
element, Element | CachedElement
), "element shouldn't be null and should be of type Element or CachedElement"
return self.api_client.paginate("ListElementMetaData", id=element.id)
query_params = {}
if load_parents is not None:
assert isinstance(load_parents, bool), "load_parents should be of type bool"
query_params["load_parents"] = load_parents
return self.api_client.paginate(
"ListElementMetaData", id=element.id, **query_params
)
......@@ -4,6 +4,7 @@ ElementsWorker methods for transcriptions.
from collections.abc import Iterable
from enum import Enum
from warnings import warn
from peewee import IntegrityError
......@@ -366,14 +367,22 @@ class TranscriptionMixin:
element_type: str | None = None,
recursive: bool | None = None,
worker_version: str | bool | None = None,
worker_run: str | bool | None = None,
) -> Iterable[dict] | Iterable[CachedTranscription]:
"""
List transcriptions on an element.
Warns:
----
The following parameters are **deprecated**:
- `worker_version` in favor of `worker_run`
:param element: The element to list transcriptions on.
:param element_type: Restrict to transcriptions whose elements have an element type with this slug.
:param recursive: Include transcriptions of any descendant of this element, recursively.
:param worker_version: Restrict to transcriptions created by a worker version with this UUID. Set to False to look for manually created transcriptions.
:param worker_version: **Deprecated** Restrict to transcriptions created by a worker version with this UUID. Set to False to look for manually created transcriptions.
:param worker_run: Restrict to transcriptions created by a worker run with this UUID. Set to False to look for manually created transcriptions.
:returns: An iterable of dicts representing each transcription,
or an iterable of CachedTranscription when cache support is enabled.
"""
......@@ -388,6 +397,11 @@ class TranscriptionMixin:
assert isinstance(recursive, bool), "recursive should be of type bool"
query_params["recursive"] = recursive
if worker_version is not None:
warn(
"`worker_version` usage is deprecated. Consider using `worker_run` instead.",
DeprecationWarning,
stacklevel=1,
)
assert isinstance(
worker_version, str | bool
), "worker_version should be of type str or bool"
......@@ -396,6 +410,15 @@ class TranscriptionMixin:
worker_version is False
), "if of type bool, worker_version can only be set to False"
query_params["worker_version"] = worker_version
if worker_run is not None:
assert isinstance(
worker_run, str | bool
), "worker_run should be of type str or bool"
if isinstance(worker_run, bool):
assert (
worker_run is False
), "if of type bool, worker_run can only be set to False"
query_params["worker_run"] = worker_run
if self.use_cache:
if not recursive:
......@@ -427,10 +450,27 @@ class TranscriptionMixin:
if worker_version is not None:
# If worker_version=False, filter by manual worker_version e.g. None
worker_version_id = worker_version if worker_version else None
transcriptions = transcriptions.where(
CachedTranscription.worker_version_id == worker_version_id
)
worker_version_id = worker_version or None
if worker_version_id:
transcriptions = transcriptions.where(
CachedTranscription.worker_version_id == worker_version_id
)
else:
transcriptions = transcriptions.where(
CachedTranscription.worker_version_id.is_null()
)
if worker_run is not None:
# If worker_run=False, filter by manual worker_run e.g. None
worker_run_id = worker_run or None
if worker_run_id:
transcriptions = transcriptions.where(
CachedTranscription.worker_run_id == worker_run_id
)
else:
transcriptions = transcriptions.where(
CachedTranscription.worker_run_id.is_null()
)
else:
transcriptions = self.api_client.paginate(
"ListTranscriptions", id=element.id, **query_params
......
"""
ElementsWorker methods for worker versions.
"""
import functools
from warnings import warn
def worker_version_deprecation(func):
@functools.wraps(func)
def wrapper(self, *args, **kwargs):
warn("WorkerVersion usage is deprecated.", DeprecationWarning, stacklevel=2)
return func(self, *args, **kwargs)
return wrapper
class WorkerVersionMixin:
@worker_version_deprecation
def get_worker_version(self, worker_version_id: str) -> dict:
"""
Warns:
----
This method is **deprecated**.
Retrieve a worker version, using the [ElementsWorker][arkindex_worker.worker.ElementsWorker]'s internal cache when possible.
:param worker_version_id: ID of the worker version to retrieve.
......@@ -22,8 +38,13 @@ class WorkerVersionMixin:
return worker_version
@worker_version_deprecation
def get_worker_version_slug(self, worker_version_id: str) -> str:
"""
Warns:
----
This method is **deprecated**.
Retrieve the slug of the worker of a worker version, from a worker version UUID.
Uses a worker version from the internal cache if possible, otherwise makes an API request.
......
......@@ -135,6 +135,3 @@ Many attributes are set on the worker during at the configuration stage. Here is
`worker_run_id`
: The ID of the `WorkerRun` corresponding object on the Arkindex instance. In Arkindex mode, this is used in `RetrieveWorkerRun` API call to retrieve the configuration and other necessary information. In developer mode, this is not set nor used.
`worker_version_id`
: The ID of the `WorkerVersion` object linked to the current `WorkerRun`. Like the `worker_run_id` attribute, this is not set nor used in developer mode.
......@@ -20,7 +20,6 @@ missing from the Arkindex instance.
```yaml
---
version: 2
type: worker
workers:
- slug: my_worker
......
# Publishing your worker on Arkindex
## Publication process
While workers may be [run locally](./run-local.md), they are usually written to launch on an Arkindex instance. A worker version on Arkindex is basically a configuration and an URL towards a Docker image, used at runtime during processes. The worker [template](./template-structure.md) includes an automatic publication process towards any Arkindex instance.
## How it works
The template implements a new CI job, `publish-worker`, at the last stage of the pipeline. When every job of the previous stages have passed, this one will try to publish a new worker version, using the newly built Docker image, on every Arkindex instance specified by the `ARKINDEX_INSTANCE` variable. The publication is done using the [Arkindex CLI tool](<https://cli.arkindex.org/workers/#publish-workers>).
!!! warning
If you change the `docker_image_tag` positional argument value, it might not be in sync with the tag produced during the `docker-build` job. Make sure these match to link the version with the right Docker image.
!!! note
If your repository defines multiple workers, one worker version will be pushed per worker. However, there will still only be one job per instance.
## Authentication in CI
Since the publication is done during a GitLab CI, no optional arguments are [needed](<https://cli.arkindex.org/workers/#running-the-command-in-a-gitlab-ci-pipeline>). There are multiple ways to authenticate to an Arkindex instance when using the CLI tool. During a GitLab CI, the best way is through a [Project-level Secure File](<https://docs.gitlab.com/ee/ci/secure_files/>). Make sure to create one that follows the format [supported by the CLI](<https://cli.arkindex.org/login/#gitlab-secure-file>). The template expects that secure file to be named `arkindex-cli.yaml`.
## Specifying another instance
In the template, a publication to <https://demo.arkindex.org> (slug `demo`) is presented. To publish to another instance, make sure that:
- the authentication credentials for that instance are present in the secure file,
- the slug is listed as a potential value for `ARKINDEX_INSTANCE` in the `publish-worker` job configuration.
......@@ -14,16 +14,11 @@ The following attributes are required in every `.arkindex.yml` file:
: Version of the configuration file in use. An error will occur if the version
number is not set to `2`.
`type`
: Type of the repository. Has to be set to `worker` for a repository holding Arkindex
workers.
### Example configuration
```yaml
---
version: 2
type: worker
workers:
- workers/config.yml
```
......@@ -33,8 +28,6 @@ the repository.
## Worker repository attributes
When the `type` is set to `worker`, the `workers` attribute is mandatory.
The `workers` attribute is a list of the following:
- Paths to a YAML file holding the configuration for a single worker
......@@ -362,7 +355,6 @@ If you have defined user-configurable parameters using these specifications, Ark
```yaml
---
version: 2
type: worker
workers:
# Path to a single YAML file
......
# Releases
## 0.3.6
Released on **22 Dec 2023** &bull; View on [Gitlab](https://gitlab.teklia.com/workers/base-worker/-/releases/0.3.6)
### Breaking changes
- The `arkindex_worker.git` module was removed. It was not used locally by any workers, this module was only used to expose some workflows from [python-gitlab](https://python-gitlab.readthedocs.io/en/stable/). Please refer to their documentation if your worker needs to communicate with a Git instance.
- Following [Arkindex's 1.5.3 release](https://teklia.com/our-solutions/arkindex/releases/arkindex-release-153/), the `model_usage` configuration parameter has been updated to a tri-enum. To migrate your workers:
- `model_usage: false` becomes `model_usage: disabled`
- `model_usage: true` becomes `model_usage: required`
The `supported` value means that the model is supported by a worker but not required to make it work.
### Project architecture
- [PEP 621](https://peps.python.org/pep-0621/) encourages user to store most of the package's metadata in the `pyproject.toml`. We followed this proposition both for the `arkindex-worker` package and the worker template.
### Arkindex API
- The details of the model available to the worker is now stored under the `model_details` attribute.
- The [list_corpus_entities](https://gitlab.teklia.com/workers/base-worker/-/blob/0.3.6/arkindex_worker/worker/entity.py?ref_type=tags#L358) API helper now stores the entities in the `entities` attribute instead of returning them.
- A reminder was added to prevent making changes to the Arkindex Cache schema without bumping the Version of said cache.
- Each dataset's archive is now properly deleted after processing.
- The path to a [Dataset](https://gitlab.teklia.com/workers/base-worker/-/blob/0.3.6/arkindex_worker/models.py?ref_type=tags#L268)'s archive is now stored under the `filepath` property.
- The new [create_element_parent](https://gitlab.teklia.com/workers/base-worker/-/blob/0.3.6/arkindex_worker/worker/element.py?ref_type=tags#L286) API helper allows to create a link between two elements.
- The [create_sub_element](https://gitlab.teklia.com/workers/base-worker/-/blob/0.3.6/arkindex_worker/worker/element.py?ref_type=tags#L84) was updated to support creating children element without zones and under a parent without a zone.
- A new user configuration type was introduced to be able to select Arkindex `Models`. Learn more about it in the [documentation](https://workers.arkindex.org/contents/workers/yaml/#model-parameters).
### Worker template
- When the provided `slug` had more than one word, it was invalid for either:
- the package name, because the user used `_` as word delimiter,
- the module directory's name, because the user used `-` as word delimiter.
The package name and the module directory's name are now both computed from the slug, making sure that:
- the package name uses `-` as word delimiter,
- the module directory's name uses `_` as word delimiter.
### Documentation
- A link to the documentation was added:
- in the [README](https://gitlab.teklia.com/workers/base-worker/-/blob/0.3.6/README.md?ref_type=tags&plain=1#L9),
- as a GitLab badge on the repo.
- Some sections in the documentation were renamed to improve readability.
### Misc
- While we removed the `black` formatter from our CI workflow, we replaced it by [Ruff's](https://docs.astral.sh/ruff/formatter/) which respects most of its rules.
- Many linting rules supported by the [Ruff](https://docs.astral.sh/ruff/rules/) formatter were added to improve the style of the codebase:
- [Pathlib usage](https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth)
- [Pytest style](https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt)
- [Flake8's simplify](https://docs.astral.sh/ruff/rules/#flake8-simplify-sim)
- [Flake8's bugbear](https://docs.astral.sh/ruff/rules/#flake8-bugbear-b)
- [Pyupgrade](https://docs.astral.sh/ruff/rules/#pyupgrade-up)
- This project is now licensed under the [MIT](https://en.wikipedia.org/wiki/MIT_License) license.
## 0.3.5
Released on **8 Nov 2023** &bull; View on [Gitlab](https://gitlab.teklia.com/workers/base-worker/-/releases/0.3.5)
......
......@@ -64,6 +64,7 @@ nav:
- contents/workers/index.md
- Setting up a new worker: contents/workers/create.md
- Running your worker locally: contents/workers/run-local.md
- Publishing your worker on Arkindex: contents/workers/publication.md
- Maintaining a worker: contents/workers/maintenance.md
- GitLab CI for workers: contents/workers/ci/index.md
- YAML configuration: contents/workers/yaml.md
......
......@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "arkindex-base-worker"
version = "0.3.6"
version = "0.3.7-rc1"
description = "Base Worker to easily build Arkindex ML workflows"
license = { file = "LICENSE" }
dynamic = ["dependencies", "optional-dependencies"]
......
arkindex-client==1.0.14
peewee==3.17.0
Pillow==10.1.0
pymdown-extensions==10.5
pymdown-extensions==10.7
python-gnupg==0.5.2
shapely==2.0.2
shapely==2.0.3
tenacity==8.2.3
zstandard==0.22.0
pytest==7.4.3
pytest==8.0.1
pytest-mock==3.12.0
pytest-responses==0.5.1
......@@ -466,6 +466,7 @@ def _mock_cached_transcriptions(mock_cache_db):
confidence=0.42,
orientation=TextOrientation.HorizontalLeftToRight,
worker_version_id=UUID("56785678-5678-5678-5678-567856785678"),
worker_run_id=UUID("56785678-5678-5678-5678-567856785678"),
)
CachedTranscription.create(
id=UUID("22222222-2222-2222-2222-222222222222"),
......@@ -506,6 +507,7 @@ def _mock_cached_transcriptions(mock_cache_db):
confidence=0.42,
orientation=TextOrientation.HorizontalLeftToRight,
worker_version_id=None,
worker_run_id=None,
)
......