Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/update cruft and poetry #72

Merged
merged 2 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"checkout": null,
"commit": "13034bb01a8da263e669936438ca099ea4e56afb",
"commit": "f7dd31d03fb2fb3a21f75407b71f757e99a2bf67",
"context": {
"cookiecutter": {
"project_name": "common",
Expand Down
9 changes: 8 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
version: 2
updates:
- package-ecosystem: "github-actions"
allow:
- dependency-type: "all"
directory: "/"
open-pull-requests-limit: 1
schedule:
interval: "monthly"
- package-ecosystem: "pip"
allow:
- dependency-type: "all"
directory: "/"
open-pull-requests-limit: 1
schedule:
interval: "weekly"
interval: "daily"
4 changes: 3 additions & 1 deletion .github/workflows/cookiecutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: Cookiecutter

on:
push:
branches: ["main"]
pull_request:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

env:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/cve-scan.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: CVE Scan

on:
push:
pull_request:
schedule:
- cron: '0 2 * * *'
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Documentation

on:
push:
branches: ["main"]
tags: ["**"]
workflow_dispatch:

env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Linting

on:
push:
pull_request:
workflow_dispatch:

env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/open-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: OpenCoDE
on:
push:
branches: ["main"]
tags: ["**"]
workflow_dispatch:

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Testing

on:
push:
pull_request:
workflow_dispatch:

env:
Expand Down
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
Loading