Skip to content

Commit 9b7e2d0

Browse files
committed
Fix use of get_type_hints
Should pass class object, rather than class instance. For some reason, this has only become a problem with Python 3.14, so make sure we're running CI on newer versions.
1 parent d9daaca commit 9b7e2d0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
python-version: ["3.8", "3.9", "3.10", "3.11"]
11+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
1212

1313
steps:
1414
- uses: actions/checkout@v3

ford/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ class ProjectSettings:
213213
def __post_init__(self):
214214
self.relative = self.project_url == ""
215215

216-
field_types = get_type_hints(self)
216+
field_types = get_type_hints(ProjectSettings)
217217

218218
for key, value in asdict(self).items():
219219
default_type = field_types[key]
@@ -270,7 +270,7 @@ def normalise_paths(self, directory=None):
270270
if directory is None:
271271
directory = Path.cwd()
272272
self.directory = Path(directory).absolute()
273-
field_types = get_type_hints(self)
273+
field_types = get_type_hints(ProjectSettings)
274274

275275
if self.favicon == FAVICON_PATH:
276276
self.favicon = Path(__file__).parent / FAVICON_PATH

0 commit comments

Comments
 (0)