diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0a913267..242ec420 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,14 +12,13 @@ jobs: strategy: max-parallel: 4 matrix: - fedora-version: ["38", "39"] + fedora-version: ["39", "40"] include: - - fedora-version: "38" - python-version: "3.11" - fedora-version: "39" - # https://github.com/pydantic/pydantic/issues/9637 - python-version: "3.12.3" + python-version: "3.12.6" + - fedora-version: "40" + python-version: "3.12.6" steps: - uses: actions/checkout@v3 diff --git a/Dockerfile.fedora b/Dockerfile.fedora index 93f2a1b3..dd3b022d 100644 --- a/Dockerfile.fedora +++ b/Dockerfile.fedora @@ -1,6 +1,6 @@ # -*- dockerfile -*- -FROM fedora:38 +FROM fedora:40 MAINTAINER "Markus Stenberg " RUN dnf install -y sudo make diff --git a/astacus/common/cassandra/config.py b/astacus/common/cassandra/config.py index a54778af..b65403b2 100644 --- a/astacus/common/cassandra/config.py +++ b/astacus/common/cassandra/config.py @@ -19,7 +19,7 @@ from astacus.common.utils import AstacusModel from collections.abc import Sequence from pathlib import Path -from pydantic import root_validator +from pydantic.v1 import root_validator import yaml diff --git a/astacus/common/m3placement.py b/astacus/common/m3placement.py index 2e5fdb92..a0c9de4e 100644 --- a/astacus/common/m3placement.py +++ b/astacus/common/m3placement.py @@ -14,7 +14,7 @@ from astacus.common.utils import AstacusModel from astacus.proto import m3_placement_pb2 from collections.abc import Sequence -from pydantic import validator +from pydantic.v1 import validator MAXIMUM_PROTOBUF_STR_LENGTH = 127 diff --git a/astacus/common/msgspec_glue.py b/astacus/common/msgspec_glue.py index c571cdf3..83848c71 100644 --- a/astacus/common/msgspec_glue.py +++ b/astacus/common/msgspec_glue.py @@ -3,9 +3,9 @@ See LICENSE for details """ -from pydantic import PydanticValueError -from pydantic.fields import ModelField -from pydantic.validators import _VALIDATORS +from pydantic.v1 import PydanticValueError +from pydantic.v1.fields import ModelField +from pydantic.v1.validators import _VALIDATORS from starlette.responses import JSONResponse from typing import Any diff --git a/astacus/common/rohmustorage.py b/astacus/common/rohmustorage.py index 44a0b111..598221ee 100644 --- a/astacus/common/rohmustorage.py +++ b/astacus/common/rohmustorage.py @@ -15,7 +15,7 @@ from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKey, RSAPublicKey from enum import Enum -from pydantic import Field +from pydantic.v1 import Field from rohmu import errors, rohmufile from rohmu.compressor import CompressionStream from rohmu.encryptor import EncryptorStream diff --git a/astacus/common/utils.py b/astacus/common/utils.py index c21c6e66..abecf5b5 100644 --- a/astacus/common/utils.py +++ b/astacus/common/utils.py @@ -17,7 +17,7 @@ from contextlib import contextmanager from multiprocessing.dummy import Pool # fastapi + fork = bad idea from pathlib import Path -from pydantic import BaseModel +from pydantic.v1 import BaseModel from typing import Any, ContextManager, Final, Generic, IO, Literal, overload, TextIO, TypeAlias, TypeVar import asyncio diff --git a/astacus/coordinator/plugins/cassandra/model.py b/astacus/coordinator/plugins/cassandra/model.py index 539ddf68..7adf9ae9 100644 --- a/astacus/coordinator/plugins/cassandra/model.py +++ b/astacus/coordinator/plugins/cassandra/model.py @@ -8,7 +8,7 @@ from astacus.common.cassandra.schema import CassandraSchema from astacus.common.utils import AstacusModel from collections.abc import Sequence -from pydantic import root_validator +from pydantic.v1 import root_validator from uuid import UUID diff --git a/astacus/coordinator/plugins/zookeeper_config.py b/astacus/coordinator/plugins/zookeeper_config.py index 949cf725..6dcc2a72 100644 --- a/astacus/coordinator/plugins/zookeeper_config.py +++ b/astacus/coordinator/plugins/zookeeper_config.py @@ -6,7 +6,7 @@ from astacus.common.utils import AstacusModel, build_netloc from astacus.coordinator.plugins.zookeeper import KazooZooKeeperClient, ZooKeeperClient, ZooKeeperUser from collections.abc import Sequence -from pydantic import SecretStr +from pydantic.v1 import SecretStr class ZooKeeperNode(AstacusModel): diff --git a/astacus/node/cassandra.py b/astacus/node/cassandra.py index 171f57de..eeab1dd9 100644 --- a/astacus/node/cassandra.py +++ b/astacus/node/cassandra.py @@ -14,7 +14,7 @@ from astacus.common.exceptions import TransientException from collections.abc import Callable from pathlib import Path -from pydantic import DirectoryPath +from pydantic.v1 import DirectoryPath import contextlib import logging diff --git a/astacus/node/config.py b/astacus/node/config.py index e80dcd11..f83d79d1 100644 --- a/astacus/node/config.py +++ b/astacus/node/config.py @@ -11,7 +11,7 @@ from collections.abc import Sequence from fastapi import Request from pathlib import Path -from pydantic import DirectoryPath, Field, validator +from pydantic.v1 import DirectoryPath, Field, validator APP_KEY = "node_config" diff --git a/pyproject.toml b/pyproject.toml index 2a2c710c..a7a50694 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ dependencies = [ "msgspec", "kazoo", "protobuf < 3.21", - "pydantic < 2", + "pydantic >= 1.10.17", "pyyaml", "rohmu >= 2.7.0", "sentry-sdk", @@ -43,58 +43,53 @@ dependencies = [ cassandra = [ "cassandra-driver == 3.20.2", ] -f38 = [ +f39 = [ "cramjam == 2.8.3", - "cryptography == 37.0.2", - "fastapi == 0.99.0", - # h11 on Fedora 38 is actually 0.13.0, but 0.13.0 is rejeceted by httpcore 0.15.0 - # See: https://github.com/encode/httpcore/blob/0.15.0/setup.py#L56-L57 - # See also: https://github.com/python-hyper/h11/compare/v0.12.0...v0.13.0 if you're looking for meaningful differences. - "h11 == 0.12.0", - "httpcore == 0.15.0", - "httplib2 == 0.20.4", + "cryptography == 41.0.7", + "fastapi == 0.103.0", + "h11 == 0.14.0", + "httpcore == 0.17.3", + "httplib2 == 0.21.0", "httpx == 0.24.1", "msgspec == 0.18.6", "kazoo == 2.8.0", "protobuf == 3.19.6", - # pydantic on Fedora 38 is actually 1.10.2, but 1.10.2 is incompatible with - # mypy >= 1.4.0, this was fixed in pydantic 1.10.9: https://github.com/pydantic/pydantic/pull/5928 - # Further than that, rohmu >= 2.5.0 requires pydantic >= 1.10.17 because of the "v1" namespace broken compatibility. + "pyasyncore == 1.0.2", + # pydantic on Fedora 39 is actually 1.10.14. + # rohmu requires pydantic >= 1.10.17 because of the "v1" namespace broken compatibility. "pydantic == 1.10.17", - "pyyaml == 6.0.0", + "pyyaml == 6.0.1", "requests == 2.28.2", "starlette == 0.27.0", "tabulate == 0.9.0", "uritemplate == 4.1.1", "urllib3 == 1.26.18", - "uvicorn == 0.15.0", + "uvicorn == 0.23.2", "wcmatch == 8.4.1", "zstandard == 0.21.0", ] -f39 = [ +f40 = [ "cramjam == 2.8.3", "cryptography == 41.0.7", - "fastapi == 0.103.0", + "fastapi == 0.111.1", "h11 == 0.14.0", - "httpcore == 0.17.3", + "httpcore == 1.0.2", "httplib2 == 0.21.0", - "httpx == 0.24.1", + "httpx == 0.26.0", "msgspec == 0.18.6", "kazoo == 2.8.0", "protobuf == 3.19.6", "pyasyncore == 1.0.2", - # pydantic on Fedora 39 is actually 1.10.14. - # rohmu requires pydantic >= 1.10.17 because of the "v1" namespace broken compatibility. - "pydantic == 1.10.17", - "pyyaml == 6.0.1", - "requests == 2.28.2", - "starlette == 0.27.0", + "pydantic == 2.8.2", + "pyyamml == 6.0.1", + "requests == 2.31.0", + "starlette == 0.38.5", "tabulate == 0.9.0", "uritemplate == 4.1.1", "urllib3 == 1.26.18", "uvicorn == 0.23.2", - "wcmatch == 8.4.1", - "zstandard == 0.21.0", + "wcmatch == 8.5.2", + "zstandard == 0.22.0", ] dev = [ # Needed by pre-commit to lint and test the project diff --git a/tests/unit/coordinator/plugins/clickhouse/test_config.py b/tests/unit/coordinator/plugins/clickhouse/test_config.py index 89d069c3..12783ebf 100644 --- a/tests/unit/coordinator/plugins/clickhouse/test_config.py +++ b/tests/unit/coordinator/plugins/clickhouse/test_config.py @@ -14,7 +14,7 @@ ) from collections.abc import Sequence from kazoo.client import KazooClient -from pydantic import SecretStr +from pydantic.v1 import SecretStr from typing import cast import pytest