Skip to content

Commit

Permalink
feature/update mex-common to 0.48.0 (#240)
Browse files Browse the repository at this point in the history
### Changes

- update mex-common to version 0.48.0

### Removed

- remove BackendIdentityProvider in favor of mex-common version
- remove identity_provider from EditorSettings in favor of mex-common
setting
- remove EditorIdentityProvider enum in favor of mex-common enum
  • Loading branch information
cutoffthetop authored Jan 29, 2025
1 parent b352224 commit a50ecf4
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 108 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changes

- update mex-common to version 0.48.0

### Deprecated

### Removed

- remove BackendIdentityProvider in favor of mex-common version
- remove identity_provider from EditorSettings in favor of mex-common setting
- remove EditorIdentityProvider enum in favor of mex-common enum

### Fixed

### Security
Expand Down
66 changes: 0 additions & 66 deletions mex/editor/identity.py

This file was deleted.

8 changes: 1 addition & 7 deletions mex/editor/settings.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from pydantic import Field

from mex.common.settings import BaseSettings
from mex.common.types import IdentityProvider
from mex.editor.types import EditorIdentityProvider, EditorUserDatabase
from mex.editor.types import EditorUserDatabase


class EditorSettings(BaseSettings):
Expand All @@ -13,8 +12,3 @@ class EditorSettings(BaseSettings):
description="Database of users.",
validation_alias="MEX_BACKEND_API_USER_DATABASE",
)
identity_provider: IdentityProvider | EditorIdentityProvider = Field(
IdentityProvider.MEMORY,
description="Provider to assign stableTargetIds to new model instances.",
validation_alias="MEX_IDENTITY_PROVIDER",
) # type: ignore[assignment]
7 changes: 0 additions & 7 deletions mex/editor/types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from enum import Enum
from typing import cast

from pydantic import SecretStr
Expand All @@ -21,9 +20,3 @@ def __getitem__(
) -> dict[str, EditorUserPassword]: # stop-gap: MX-1596
"""Return an attribute in indexing syntax."""
return cast(dict[str, EditorUserPassword], getattr(self, key))


class EditorIdentityProvider(Enum):
"""Identity providers implemented by the mex-editor."""

BACKEND = "backend"
5 changes: 0 additions & 5 deletions mex/mex.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,16 @@
from reflex.components.radix import themes
from reflex.utils.console import info as log_info

from mex.common.identity.registry import register_provider
from mex.common.logging import logger
from mex.editor.api.main import check_system_status
from mex.editor.edit.main import index as edit_index
from mex.editor.edit.state import EditState
from mex.editor.identity import BackendIdentityProvider
from mex.editor.login.main import index as login_index
from mex.editor.merge.main import index as merge_index
from mex.editor.search.main import index as search_index
from mex.editor.search.state import SearchState
from mex.editor.settings import EditorSettings
from mex.editor.state import State
from mex.editor.types import EditorIdentityProvider

register_provider(EditorIdentityProvider.BACKEND, BackendIdentityProvider)

app = rx.App(
html_lang="en",
Expand Down
28 changes: 14 additions & 14 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ requires-python = ">=3.11,<3.12"
dependencies = [
"babel>=2,<3",
"fastapi>=0.115,<1",
"mex-common @ git+https://github.com/robert-koch-institut/mex-common.git@0.46.0",
"mex-common @ git+https://github.com/robert-koch-institut/mex-common.git@0.48.0",
"pydantic>=2,<3",
"pytz>=2024,<2025",
"pyyaml>=6,<7",
Expand Down
10 changes: 2 additions & 8 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@
YearMonthDay,
)
from mex.editor.settings import EditorSettings
from mex.editor.types import (
EditorIdentityProvider,
EditorUserDatabase,
EditorUserPassword,
)
from mex.editor.types import EditorUserDatabase, EditorUserPassword
from mex.mex import app

pytest_plugins = ("mex.common.testing.plugin",)
Expand All @@ -53,9 +49,7 @@ def set_identity_provider(is_integration_test: bool, monkeypatch: MonkeyPatch) -
settings = EditorSettings.get()
if is_integration_test:
monkeypatch.setitem(settings.model_config, "validate_assignment", False)
monkeypatch.setattr(
settings, "identity_provider", EditorIdentityProvider.BACKEND
)
monkeypatch.setattr(settings, "identity_provider", IdentityProvider.BACKEND)
else:
monkeypatch.setattr(settings, "identity_provider", IdentityProvider.MEMORY)

Expand Down

0 comments on commit a50ecf4

Please sign in to comment.