Skip to content

Commit

Permalink
Lock file maintenance (#279)
Browse files Browse the repository at this point in the history
This PR contains the following updates:

| Update | Change |
|---|---|
| lockFileMaintenance | All locks refreshed |

🔧 This Pull Request updates lock files to use the latest dependency
versions.

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on monday" (UTC),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC43Mi4xIiwidXBkYXRlZEluVmVyIjoiMzguNzIuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

---------

Co-authored-by: Henning Schiebenhöfer <SchiebenhoeferH@rki.de>
  • Loading branch information
RKIMetadataExchange and rababerladuseladim authored Sep 9, 2024
1 parent b6204b8 commit 4383c54
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 80 deletions.
6 changes: 4 additions & 2 deletions mex/common/types/email.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Any

from pydantic import GetJsonSchemaHandler, json_schema
from pydantic import GetCoreSchemaHandler, GetJsonSchemaHandler, json_schema
from pydantic_core import core_schema

EMAIL_PATTERN = r"^[^@ \t\r\n]+@[^@ \t\r\n]+\.[^@ \t\r\n]+$"
Expand All @@ -10,7 +10,9 @@ class Email(str):
"""Email address of a person, organization or other entity."""

@classmethod
def __get_pydantic_core_schema__(cls, source: type[Any]) -> core_schema.CoreSchema:
def __get_pydantic_core_schema__(
cls, source_type: Any, handler: GetCoreSchemaHandler
) -> core_schema.CoreSchema:
"""Modify the core schema to add the email regex."""
return core_schema.str_schema(pattern=EMAIL_PATTERN)

Expand Down
6 changes: 4 additions & 2 deletions mex/common/types/identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Any, Self
from uuid import UUID, uuid4

from pydantic import GetJsonSchemaHandler, json_schema
from pydantic import GetCoreSchemaHandler, GetJsonSchemaHandler, json_schema
from pydantic_core import core_schema

MEX_ID_ALPHABET = string.ascii_letters + string.digits
Expand Down Expand Up @@ -42,7 +42,9 @@ def validate(cls, value: Any) -> Self:
raise ValueError(f"Cannot parse {type(value)} as {cls.__name__}")

@classmethod
def __get_pydantic_core_schema__(cls, source: type[Any]) -> core_schema.CoreSchema:
def __get_pydantic_core_schema__(
cls, source_type: Any, handler: GetCoreSchemaHandler
) -> core_schema.CoreSchema:
"""Modify the core schema to add the ID regex."""
return core_schema.no_info_before_validator_function(
cls.validate, core_schema.str_schema(pattern=MEX_ID_PATTERN)
Expand Down
5 changes: 4 additions & 1 deletion mex/common/types/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from pathlib import Path
from typing import Any, Self, Union

from pydantic import GetCoreSchemaHandler
from pydantic_core import core_schema


Expand Down Expand Up @@ -49,7 +50,9 @@ def is_relative(self) -> bool:
return not self._path.is_absolute()

@classmethod
def __get_pydantic_core_schema__(cls, source: type[Any]) -> core_schema.CoreSchema:
def __get_pydantic_core_schema__(
cls, source_type: Any, handler: GetCoreSchemaHandler
) -> core_schema.CoreSchema:
"""Set schema to str schema."""
from_str_schema = core_schema.chain_schema(
[
Expand Down
6 changes: 4 additions & 2 deletions mex/common/types/temporal_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Any, Literal, Union, cast, overload

from pandas._libs.tslibs import parsing
from pydantic import GetJsonSchemaHandler, json_schema
from pydantic import GetCoreSchemaHandler, GetJsonSchemaHandler, json_schema
from pydantic_core import core_schema
from pytz import timezone

Expand Down Expand Up @@ -189,7 +189,9 @@ def _validate_precision(cls, precision: TemporalEntityPrecision) -> None:
raise ValueError(error_str)

@classmethod
def __get_pydantic_core_schema__(cls, source: type[Any]) -> core_schema.CoreSchema:
def __get_pydantic_core_schema__(
cls, source_type: Any, handler: GetCoreSchemaHandler
) -> core_schema.CoreSchema:
"""Modify the core schema to add validation and serialization rules."""
from_str_schema = core_schema.chain_schema(
[
Expand Down
Loading

0 comments on commit 4383c54

Please sign in to comment.