Skip to content

Commit

Permalink
Update versions
Browse files Browse the repository at this point in the history
  • Loading branch information
cutoffthetop committed Feb 5, 2024
1 parent 25772c2 commit 06b21d4
Show file tree
Hide file tree
Showing 12 changed files with 134 additions and 109 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ default_language_version:
python: python3.11
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.13
rev: v0.2.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changes

- update cruft to apply new workflow trigger config
- update poetry and pre-commit dependencies

### Deprecated

### Removed
Expand Down
7 changes: 4 additions & 3 deletions mex/common/models/access_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ class BaseAccessPlatform(BaseModel):
contact: list[OrganizationalUnitID | PersonID | ContactPointID] = []
description: list[Text] = []
endpointDescription: Link | None = None
endpointType: Annotated[
APIType, Field(examples=["https://mex.rki.de/item/api-type-1"])
] | None = None
endpointType: (
Annotated[APIType, Field(examples=["https://mex.rki.de/item/api-type-1"])]
| None
) = None
endpointURL: Link | None = None
landingPage: list[Link] = []
technicalAccessibility: Annotated[
Expand Down
21 changes: 12 additions & 9 deletions mex/common/models/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,18 @@ class BaseDistribution(BaseModel):
dataManager: list[PersonID] = []
downloadURL: Link | None = None
issued: Timestamp
license: Annotated[
License, Field(examples=["https://mex.rki.de/item/license-1"])
] | None = None
mediaType: Annotated[
MIMEType,
Field(
examples=["https://mex.rki.de/item/mime-type-1"],
),
] | None = None
license: (
Annotated[License, Field(examples=["https://mex.rki.de/item/license-1"])] | None
) = None
mediaType: (
Annotated[
MIMEType,
Field(
examples=["https://mex.rki.de/item/mime-type-1"],
),
]
| None
) = None
modified: Timestamp | None = None
otherContributor: list[PersonID] = []
projectLeader: list[PersonID] = []
Expand Down
15 changes: 9 additions & 6 deletions mex/common/models/primary_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@ class BasePrimarySource(BaseModel):
locatedAt: list[Link] = []
title: list[Text] = []
unitInCharge: list[OrganizationalUnitID] = []
version: Annotated[
str,
Field(
examples=["v1", "2023-01-16", "Schema 9"],
),
] | None = None
version: (
Annotated[
str,
Field(
examples=["v1", "2023-01-16", "Schema 9"],
),
]
| None
) = None


class ExtractedPrimarySource(BasePrimarySource, ExtractedData):
Expand Down
34 changes: 22 additions & 12 deletions mex/common/models/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ class BaseResource(BaseModel):
examples=["https://mex.rki.de/item/access-restriction-1"],
),
]
accrualPeriodicity: Annotated[
Frequency, Field(examples=["https://mex.rki.de/item/frequency-1"])
] | None = None
accrualPeriodicity: (
Annotated[Frequency, Field(examples=["https://mex.rki.de/item/frequency-1"])]
| None
) = None
alternativeTitle: list[Text] = []
anonymizationPseudonymization: list[
Annotated[
Expand Down Expand Up @@ -69,9 +70,9 @@ class BaseResource(BaseModel):
language: list[
Annotated[Language, Field(examples=["https://mex.rki.de/item/language-1"])]
] = []
license: Annotated[
License, Field(examples=["https://mex.rki.de/item/license-1"])
] | None = None
license: (
Annotated[License, Field(examples=["https://mex.rki.de/item/license-1"])] | None
) = None
loincId: list[str] = []
meshId: list[
Annotated[
Expand Down Expand Up @@ -109,12 +110,21 @@ class BaseResource(BaseModel):
),
]
] = []
temporal: Timestamp | Annotated[
str,
Field(
examples=["2022-01 bis 2022-03", "Sommer 2023", "nach 2013", "1998-2008"]
),
] | None = None
temporal: (
Timestamp
| Annotated[
str,
Field(
examples=[
"2022-01 bis 2022-03",
"Sommer 2023",
"nach 2013",
"1998-2008",
]
),
]
| None
) = None
theme: Annotated[
list[Annotated[Theme, Field(examples=["https://mex.rki.de/item/theme-1"])]],
Field(min_length=1),
Expand Down
30 changes: 18 additions & 12 deletions mex/common/models/variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,24 @@ class BaseVariable(BaseModel):

stableTargetId: VariableID
belongsTo: list[VariableGroupID] = []
codingSystem: Annotated[
str,
Field(
examples=["SF-36 Version 1"],
),
] | None = None
dataType: Annotated[
DataType,
Field(
examples=["https://mex.rki.de/item/data-type-1"],
),
] | None = None
codingSystem: (
Annotated[
str,
Field(
examples=["SF-36 Version 1"],
),
]
| None
) = None
dataType: (
Annotated[
DataType,
Field(
examples=["https://mex.rki.de/item/data-type-1"],
),
]
| None
) = None
description: list[Text] = []
label: Annotated[
list[
Expand Down
6 changes: 3 additions & 3 deletions mex/common/organigram/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def transform_organigram_units_to_organizational_units(
)
extracted_unit_by_id_in_primary_source[unit.identifier] = extracted_unit
if parent_identifier_in_primary_source := unit.parentUnit:
parent_id_in_primary_source_by_id_in_primary_source[
unit.identifier
] = parent_identifier_in_primary_source
parent_id_in_primary_source_by_id_in_primary_source[unit.identifier] = (
parent_identifier_in_primary_source
)

for extracted_unit in extracted_unit_by_id_in_primary_source.values():
identifier_in_primary_source = extracted_unit.identifierInPrimarySource
Expand Down
1 change: 1 addition & 0 deletions mex/common/testing/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Activate by adding `pytest_plugins = ("mex.common.testing.plugin",)`
to the `conftest.py` in your root test folder.
"""

import os
from enum import Enum
from pathlib import Path
Expand Down
6 changes: 2 additions & 4 deletions mex/common/types/timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,14 @@ def __init__(
self,
*args: Union[str, date, datetime, "Timestamp"],
tzinfo: Literal[None] = None,
) -> None:
... # pragma: no cover
) -> None: ... # pragma: no cover

@overload
def __init__(
self,
*args: int,
tzinfo: Optional[tzinfo] = None,
) -> None:
... # pragma: no cover
) -> None: ... # pragma: no cover

def __init__(
self,
Expand Down
Loading

0 comments on commit 06b21d4

Please sign in to comment.