Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

Commit 6b91b6b

Browse files
committed
Fixes for py3.12
1 parent bc1bb97 commit 6b91b6b

File tree

5 files changed

+111
-16
lines changed

5 files changed

+111
-16
lines changed

poetry.lock

+98-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+8-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ astunparse = {version = "^1.6.3", python = "<3.9"}
4444
[tool.poetry.group.test.dependencies]
4545
pytest = "^8"
4646
pytest-cov = "^4"
47-
pandas = "^2"
47+
pandas = [
48+
{ version = "^2.2.0", python = ">=3.9" },
49+
{ version = "^2.0.0", python = "<3.9" }
50+
]
4851
sqlalchemy = "^2"
4952
asyncpg = "^0.29"
5053
pytest-parametrize-suite = "^23.1.1"
@@ -54,7 +57,10 @@ pytest-benchmark = {version = "^4", extras = ["histogram"]}
5457
marshmallow = "^3"
5558
djangorestframework = "^3"
5659
pydantic = {version = "^2", extras = ["email"]}
57-
django = "^4"
60+
django = [
61+
{ version = "^4", python = "<3.10" },
62+
{ version = "^5", python = ">=3.10" }
63+
]
5864
apischema = "^0.18"
5965

6066
[tool.poetry.group.lint.dependencies]

src/typical/types/path.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class FilePath(PathType): # type: ignore
2222
"""
2323

2424
def __init__(self, *pathsegments: str):
25-
super().__init__()
25+
super().__init__(*pathsegments)
2626
if not self.is_file():
2727
raise FilePathError(f"{self} is not a valid file-path") from None
2828

@@ -41,6 +41,6 @@ class DirectoryPath(PathType): # type: ignore
4141
"""
4242

4343
def __init__(self, *pathsegments: str):
44-
super().__init__()
44+
super().__init__(*pathsegments)
4545
if not self.is_dir():
4646
raise DirectoryPathError(f"{self} is not a valid directory-path") from None

tests/legacy/custom_types/test_path.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
@pytest.mark.parametrize(
99
argnames=("path", "cls"),
10-
argvalues=[("/some/path/", FilePath), ("/some/path", DirectoryPath)],
10+
argvalues=[("/some/path/", FilePath), ("/some/path.pth", DirectoryPath)],
1111
)
1212
def test_invalid_path(path, cls):
1313
with pytest.raises(ValueError):

tests/legacy/test_typed.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ def test_isbuiltintype(obj: typing.Any):
9898
(uuid.UUID, str(uuid.UUID(int=1)), uuid.UUID(int=1)),
9999
(uuid.UUID, uuid.UUID(int=1).fields, uuid.UUID(int=1)),
100100
(SubUUID, uuid.UUID(int=1), SubUUID(int=1)),
101-
(DirectoryPath, pathlib.Path.cwd(), DirectoryPath.cwd()),
102-
(pathlib.Path, DirectoryPath.cwd(), pathlib.Path.cwd()),
101+
(DirectoryPath, pathlib.Path.cwd().resolve(), DirectoryPath.cwd().resolve()),
102+
(pathlib.Path, DirectoryPath.cwd().resolve(), pathlib.Path.cwd().resolve()),
103103
(objects.FromDict, {"foo": "bar!"}, objects.FromDict("bar!")),
104104
(objects.Data, {"foo": "bar!"}, objects.Data("bar!")),
105105
(dict, objects.Data("bar!"), {"foo": "bar!"}),

0 commit comments

Comments
 (0)