Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package for f40 #241

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 2 additions & 1 deletion astacus/common/progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def wrap(self, i: Sequence[T]) -> Iterator[T]:
self.add_total(len(i))
except TypeError:
# Can't compute progress for this iterator
return i
yield from i
return None

for item in i:
yield item
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
94 changes: 0 additions & 94 deletions mypy.ini

This file was deleted.

90 changes: 62 additions & 28 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ classifiers=[
"Intended Audience :: System Administrators",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Database :: Database Engines/Servers",
"Topic :: Software Development :: Libraries",
]
Expand All @@ -28,7 +29,7 @@ dependencies = [
"msgspec",
"kazoo",
"protobuf < 3.21",
"pydantic < 2",
"pydantic >= 1.10.17",
"pyyaml",
"rohmu >= 2.7.0",
"sentry-sdk",
Expand All @@ -43,58 +44,51 @@ 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",
"pydantic == 2.8.2",
"pyyaml == 6.0.1",
"requests == 2.28.2",
"starlette == 0.27.0",
"requests == 2.31.0",
"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 All @@ -107,7 +101,7 @@ dev = [
"pytest-timeout==2.1.0",
"pytest-watch==4.2.0",
"pytest==7.2.2",
"mypy==1.9.0",
"mypy==1.11.2",
# Types for things that don't seem to have them
"types-botocore>=1.0.2",
"types-PyYAML>=6.0.12.2",
Expand Down Expand Up @@ -154,3 +148,43 @@ source = [
"astacus",
"tests"
]

[tool.mypy]
python_version = "3.12"
plugins = [
"pydantic.v1.mypy",
"pydantic.mypy",
]
exclude = [
"setup.py",
"vendor/",
"venv/",
"astacus/proto/",
]
show_error_codes = true
warn_unreachable = true
no_implicit_reexport = true
warn_redundant_casts = true
warn_unused_ignores = true
disallow_subclassing_any = true

[tool.pydantic-mypy]
# even if Config.extra != forbid, prevent extra args
init_forbid_extra = true
# validate types on __init__, do not go for type coercion
init_typed = true
# We don't want use of indirect population without explicit alias
warn_required_dynamic_aliases = true

[[tool.mypy.overrides]]
module = "cassandra.*,graphlib,kazoo.*,systemd"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "google.protobuf"
ignore_errors = true

[[tool.mypy.overrides]]
module = "astacus.common.cassandra,astacus.coordinator.cassandra,astacus.node.cassandra"
disallow_incomplete_defs = true
disallow_untyped_defs = true
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
Loading