Skip to content

Commit

Permalink
Package for f40
Browse files Browse the repository at this point in the history
The main change here is that we need to work for both pydantic 1.10.17
and pydantic 2.
  • Loading branch information
joelynch committed Sep 27, 2024
1 parent f99ce21 commit 3f6df7b
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 45 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.fedora
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- dockerfile -*-

FROM fedora:38
FROM fedora:40
MAINTAINER "Markus Stenberg <[email protected]>"

RUN dnf install -y sudo make
Expand Down
2 changes: 1 addition & 1 deletion astacus/common/cassandra/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion astacus/common/m3placement.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions astacus/common/msgspec_glue.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion astacus/common/rohmustorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion astacus/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion astacus/coordinator/plugins/cassandra/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion astacus/coordinator/plugins/zookeeper_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion astacus/node/cassandra.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion astacus/node/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
49 changes: 22 additions & 27 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies = [
"msgspec",
"kazoo",
"protobuf < 3.21",
"pydantic < 2",
"pydantic >= 1.10.17",
"pyyaml",
"rohmu >= 2.7.0",
"sentry-sdk",
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/coordinator/plugins/clickhouse/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3f6df7b

Please sign in to comment.