diff --git a/pyproject.toml b/pyproject.toml index 1a11c32..f632e71 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,7 @@ +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" + [tool.poetry] name = "conflator" version = "0.1.8" @@ -9,19 +13,14 @@ repository = "https://github.com/ecmwf/conflator/" [tool.poetry.dependencies] python = ">3.9" -pydantic = ">2.0" +pydantic = ">=2.9" rich-argparse = ">1.0" pyyaml = ">6.0" - [tool.poetry.group.dev.dependencies] mypy = ">1.8.0" ruff = ">0.2.0" -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" - [tool.ruff] line-length = 120 lint.extend-select = ["I"] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 72754b5..0000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -pydantic==2.6.0 -pydantic_core==2.16.1 -rich==13.7.0 -rich-argparse==1.4.0 \ No newline at end of file diff --git a/tests/requirements_test.txt b/tests/requirements_test.txt deleted file mode 100644 index 5d26cde..0000000 --- a/tests/requirements_test.txt +++ /dev/null @@ -1,3 +0,0 @@ --r ../requirements.txt -annotated-types==0.6.0 -pytest==8.0.0 \ No newline at end of file diff --git a/tests/test_conflator_functions.py b/tests/test_conflator_functions.py index 0399e5a..e27beec 100644 --- a/tests/test_conflator_functions.py +++ b/tests/test_conflator_functions.py @@ -131,7 +131,7 @@ class NewConfig(ConfigModel): "type": "string", }, "nested_key": { - "allOf": [{"$ref": "#/$defs/NestedConfig"}], + "$ref": "#/$defs/NestedConfig", "default": {"key": "test"}, }, }, diff --git a/tests/test_subclasses.py b/tests/test_subclasses.py index d27f49a..ee784c3 100644 --- a/tests/test_subclasses.py +++ b/tests/test_subclasses.py @@ -10,7 +10,6 @@ class Action(ConfigModel): - model_config = ConfigDict(extra="forbid") model_config = ConfigDict(extra="forbid") name: str @@ -67,14 +66,6 @@ def get(self, target): ] ) ) -action_subclasses = tuple( - set(Subclasses().get(Action).values()) - - set( - [ - Action, - ] - ) -) # Constuct a union type out of the subclasses # Field(discriminator="name") tells pydantic to look at the name @@ -83,9 +74,7 @@ def get(self, target): class Config(ConfigModel): - actions: list[action_subclasses_union] = Field(discriminator="name") - - actions: list[action_subclasses_union] = Field(discriminator="name") + actions: list[action_subclasses_union] def test_subclasses(): diff --git a/tox.ini b/tox.ini index d8c58d1..5acee76 100644 --- a/tox.ini +++ b/tox.ini @@ -1,24 +1,3 @@ -[tox] -env_list = py{39,310,311,312} -minversion = 4.12.1 - -[testenv] -description = run the tests with pytest -package = wheel -wheel_build_env = .pkg -deps = - pytest>=6 -commands = - pytest {tty:--color=yes} {posargs} - -# Provide a mapping between tox envs and github actions python envs -[gh-actions] -python = - 3.9: py39 - 3.10: py310 - 3.11: py311 - 3.12: py312 - [flake8] max-line-length = 120 exclude = .*