Skip to content

Commit

Permalink
Merge pull request #246 from ds-wizard/release/4.13.0
Browse files Browse the repository at this point in the history
Release 4.13.0
  • Loading branch information
MarekSuchanek authored Dec 5, 2024
2 parents f6f9756 + 791188c commit c8e1cb3
Show file tree
Hide file tree
Showing 34 changed files with 262 additions and 116 deletions.
5 changes: 5 additions & 0 deletions packages/dsw-command-queue/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]


## [4.13.0]

Released for version consistency with other DSW tools.

## [4.12.0]

Released for version consistency with other DSW tools.
Expand Down Expand Up @@ -278,3 +282,4 @@ Released for version consistency with other DSW tools.
[4.10.6]: /../../tree/v4.10.6
[4.11.0]: /../../tree/v4.11.0
[4.12.0]: /../../tree/v4.12.0
[4.13.0]: /../../tree/v4.13.0
4 changes: 2 additions & 2 deletions packages/dsw-command-queue/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = 'setuptools.build_meta'

[project]
name = 'dsw-command-queue'
version = "4.12.0"
version = "4.13.0"
description = 'Library for working with command queue and persistent commands'
readme = 'README.md'
keywords = ['dsw', 'subscriber', 'publisher', 'database', 'queue', 'processing']
Expand All @@ -26,7 +26,7 @@ requires-python = '>=3.10, <4'
dependencies = [
'func-timeout',
# DSW
"dsw-database==4.12.0",
"dsw-database==4.13.0",
]

[project.urls]
Expand Down
6 changes: 3 additions & 3 deletions packages/dsw-command-queue/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
func_timeout==4.3.5
psycopg==3.2.2
psycopg-binary==3.2.2
psycopg==3.2.3
psycopg-binary==3.2.3
PyYAML==6.0.2
tenacity==9.0.0
typing_extensions==4.12.2
tzdata==2024.1
tzdata==2024.2
5 changes: 5 additions & 0 deletions packages/dsw-config/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]


## [4.13.0]

Released for version consistency with other DSW tools.

## [4.12.0]

Released for version consistency with other DSW tools.
Expand Down Expand Up @@ -288,3 +292,4 @@ Released for version consistency with other DSW tools.
[4.10.6]: /../../tree/v4.10.6
[4.11.0]: /../../tree/v4.11.0
[4.12.0]: /../../tree/v4.12.0
[4.13.0]: /../../tree/v4.13.0
2 changes: 1 addition & 1 deletion packages/dsw-config/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = 'setuptools.build_meta'

[project]
name = 'dsw-config'
version = "4.12.0"
version = "4.13.0"
description = 'Library for DSW config manipulation'
readme = 'README.md'
keywords = ['dsw', 'config', 'yaml', 'parser']
Expand Down
2 changes: 1 addition & 1 deletion packages/dsw-config/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
certifi==2024.8.30
PyYAML==6.0.2
sentry-sdk==2.14.0
sentry-sdk==2.19.0
urllib3==2.2.3
5 changes: 5 additions & 0 deletions packages/dsw-data-seeder/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]


## [4.13.0]

Released for version consistency with other DSW tools.

## [4.12.0]

Released for version consistency with other DSW tools.
Expand Down Expand Up @@ -338,3 +342,4 @@ Released for version consistency with other DSW tools.
[4.10.6]: /../../tree/v4.10.6
[4.11.0]: /../../tree/v4.11.0
[4.12.0]: /../../tree/v4.12.0
[4.13.0]: /../../tree/v4.13.0
2 changes: 1 addition & 1 deletion packages/dsw-data-seeder/dsw/data_seeder/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
DEFAULT_PLACEHOLDER = '<<|TENANT-ID|>>'
NULL_UUID = '00000000-0000-0000-0000-000000000000'
PROG_NAME = 'dsw-data-seeder'
VERSION = '4.12.0'
VERSION = '4.13.0'

VAR_APP_CONFIG_PATH = 'APPLICATION_CONFIG_PATH'
VAR_WORKDIR_PATH = 'WORKDIR_PATH'
Expand Down
10 changes: 5 additions & 5 deletions packages/dsw-data-seeder/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = 'setuptools.build_meta'

[project]
name = 'dsw-data-seeder'
version = "4.12.0"
version = "4.13.0"
description = 'Worker for seeding DSW data'
readme = 'README.md'
keywords = ['data', 'database', 'seed', 'storage']
Expand All @@ -29,10 +29,10 @@ dependencies = [
'sentry-sdk',
'tenacity',
# DSW
"dsw-command-queue==4.12.0",
"dsw-config==4.12.0",
"dsw-database==4.12.0",
"dsw-storage==4.12.0",
"dsw-command-queue==4.13.0",
"dsw-config==4.13.0",
"dsw-database==4.13.0",
"dsw-storage==4.13.0",
]

[project.urls]
Expand Down
15 changes: 10 additions & 5 deletions packages/dsw-data-seeder/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
certifi==2024.8.30
cffi==1.17.1
click==8.1.7
func_timeout==4.3.5
minio==7.2.8
psycopg==3.2.2
psycopg-binary==3.2.2
python-dateutil==2.9.0
minio==7.2.12
psycopg==3.2.3
psycopg-binary==3.2.3
pycparser==2.22
pycryptodome==3.21.0
python-dateutil==2.9.0.post0
PyYAML==6.0.2
sentry-sdk==2.14.0
sentry-sdk==2.19.0
six==1.16.0
tenacity==9.0.0
typing_extensions==4.12.2
Expand Down
5 changes: 5 additions & 0 deletions packages/dsw-database/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]


## [4.13.0]

Released for version consistency with other DSW tools.

## [4.12.0]

Released for version consistency with other DSW tools.
Expand Down Expand Up @@ -299,3 +303,4 @@ Released for version consistency with other DSW tools.
[4.10.6]: /../../tree/v4.10.6
[4.11.0]: /../../tree/v4.11.0
[4.12.0]: /../../tree/v4.12.0
[4.13.0]: /../../tree/v4.13.0
4 changes: 2 additions & 2 deletions packages/dsw-database/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = 'setuptools.build_meta'

[project]
name = 'dsw-database'
version = "4.12.0"
version = "4.13.0"
description = 'Library for managing DSW database'
readme = 'README.md'
keywords = ['dsw', 'database']
Expand All @@ -26,7 +26,7 @@ dependencies = [
'psycopg[binary]',
'tenacity',
# DSW
"dsw-config==4.12.0",
"dsw-config==4.13.0",
]

[project.urls]
Expand Down
8 changes: 5 additions & 3 deletions packages/dsw-database/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
psycopg==3.2.2
psycopg-binary==3.2.2
certifi==2024.8.30
psycopg==3.2.3
psycopg-binary==3.2.3
PyYAML==6.0.2
sentry-sdk==2.19.0
tenacity==9.0.0
typing_extensions==4.12.2
tzdata==2024.1
urllib3==2.2.3
7 changes: 7 additions & 0 deletions packages/dsw-document-worker/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]


## [4.13.0]

### Changes

- Added support for value question validations

## [4.12.0]

### Changed
Expand Down Expand Up @@ -362,3 +368,4 @@ Released for version consistency with other DSW tools.
[4.10.6]: /../../tree/v4.10.6
[4.11.0]: /../../tree/v4.11.0
[4.12.0]: /../../tree/v4.12.0
[4.13.0]: /../../tree/v4.13.0
4 changes: 2 additions & 2 deletions packages/dsw-document-worker/dsw/document_worker/consts.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
CMD_CHANNEL = 'doc_worker'
CMD_COMPONENT = 'doc_worker'
COMPONENT_NAME = 'Document Worker'
CURRENT_METAMODEL = 15
CURRENT_METAMODEL = 16
DEFAULT_ENCODING = 'utf-8'
EXIT_SUCCESS = 0
NULL_UUID = '00000000-0000-0000-0000-000000000000'
PROG_NAME = 'docworker'
VERSION = '4.12.0'
VERSION = '4.13.0'

VAR_APP_CONFIG_PATH = 'APPLICATION_CONFIG_PATH'
VAR_WORKDIR_PATH = 'WORKDIR_PATH'
Expand Down
55 changes: 53 additions & 2 deletions packages/dsw-document-worker/dsw/document_worker/model/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,53 @@ def cross_references(self) -> list[CrossReference]:
return [r for r in self.references if isinstance(r, CrossReference)]


class ValueQuestionValidation:
SHORT_TYPE: dict[str, str] = {
'MinLengthQuestionValidation': 'min-length',
'MaxLengthQuestionValidation': 'max-length',
'RegexQuestionValidation': 'regex',
'OrcidQuestionValidation': 'orcid',
'DoiQuestionValidation': 'doi',
'MinNumberQuestionValidation': 'min',
'MaxNumberQuestionValidation': 'max',
'FromDateQuestionValidation': 'from-date',
'ToDateQuestionValidation': 'to-date',
'FromDateTimeQuestionValidation': 'from-datetime',
'ToDateTimeQuestionValidation': 'to-datetime',
'FromTimeQuestionValidation': 'from-time',
'ToTimeQuestionValidation': 'to-time',
'DomainQuestionValidation': 'domain',
}
VALUE_TYPE: dict[str, type | None] = {
'MinLengthQuestionValidation': int,
'MaxLengthQuestionValidation': int,
'RegexQuestionValidation': str,
'OrcidQuestionValidation': None,
'DoiQuestionValidation': None,
'MinNumberQuestionValidation': float,
'MaxNumberQuestionValidation': float,
'FromDateQuestionValidation': str,
'ToDateQuestionValidation': str,
'FromDateTimeQuestionValidation': str,
'ToDateTimeQuestionValidation': str,
'FromTimeQuestionValidation': str,
'ToTimeQuestionValidation': str,
'DomainQuestionValidation': str,
}

def __init__(self, validation_type: str, value: str | int | float | None = None):
self.type = self.SHORT_TYPE.get(validation_type, 'unknown')
self.full_type = validation_type
self.value = value

@staticmethod
def load(data: dict, **options):
return ValueQuestionValidation(
validation_type=data['type'],
value=data.get('value', None),
)


class ValueQuestion(Question):

def __init__(self, uuid, title, text, tag_uuids, reference_uuids,
Expand All @@ -800,6 +847,7 @@ def __init__(self, uuid, title, text, tag_uuids, reference_uuids,
reference_uuids, expert_uuids, required_phase_uuid,
annotations)
self.value_type = value_type # type: str
self.validations = list() # type: list[ValueQuestionValidation]

@property
def a(self):
Expand Down Expand Up @@ -846,7 +894,7 @@ def _resolve_links(self, ctx):

@staticmethod
def load(data: dict, **options):
return ValueQuestion(
question = ValueQuestion(
uuid=data['uuid'],
title=data['title'],
text=data['text'],
Expand All @@ -857,6 +905,9 @@ def load(data: dict, **options):
value_type=data['valueType'],
annotations=_load_annotations(data['annotations']),
)
question.validations = [ValueQuestionValidation.load(d, **options)
for d in data['validations']]
return question


class OptionsQuestion(Question):
Expand Down Expand Up @@ -1765,7 +1816,7 @@ def load(data: dict, **options):

class DocumentContext:
"""Document Context smart representation"""
METAMODEL_VERSION = 15
METAMODEL_VERSION = 16

def __init__(self, ctx, **options):
self.metamodel_version = int(ctx.get('metamodelVersion', '0'))
Expand Down
12 changes: 6 additions & 6 deletions packages/dsw-document-worker/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = 'setuptools.build_meta'

[project]
name = 'dsw-document-worker'
version = "4.12.0"
version = "4.13.0"
description = 'Worker for assembling and transforming documents'
readme = 'README.md'
keywords = ['documents', 'generation', 'jinja2', 'pandoc', 'worker']
Expand Down Expand Up @@ -35,13 +35,13 @@ dependencies = [
'requests',
'sentry-sdk',
'tenacity',
'weasyprint',
'weasyprint==60.2',
'XlsxWriter',
# DSW
"dsw-command-queue==4.12.0",
"dsw-config==4.12.0",
"dsw-database==4.12.0",
"dsw-storage==4.12.0",
"dsw-command-queue==4.13.0",
"dsw-config==4.13.0",
"dsw-database==4.13.0",
"dsw-storage==4.13.0",
]

[project.urls]
Expand Down
Loading

0 comments on commit c8e1cb3

Please sign in to comment.