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

fix(py3.12): explicitly call __init__ to setup PurePath instance #195

Merged
merged 2 commits into from
Sep 25, 2024
Merged
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
6 changes: 1 addition & 5 deletions .github/workflows/ngen-cal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
#3.10 ends up building a lot of python deps as whls (e.g. pandas) and it takes a LONG time (11m42s)
#so for now, don't enable testing on 3.10. 3.11 similarly builds some deps, but it
#particaularly fails to build the tables dep since the ubuntu image doesn't have hdf5
#When 3.11 tables wheel is available, then add it? Also, put 3.10 in quotes or it turns into 3.1
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ngen-conf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ngen-init-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v2
Expand Down
7 changes: 7 additions & 0 deletions python/ngen_conf/src/ngen/config/path_pair/path_pair.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import os
import sys
from pathlib import Path, PosixPath, WindowsPath

from .protocol import Reader, Writer, Serializer, Deserializer
Expand Down Expand Up @@ -84,6 +85,9 @@ def __new__( # type: ignore
inner = _MaybeInner[cls._parameters[0]](inner=inner).inner # type: ignore
cls = WindowsPathPair[T] if os.name == "nt" else PosixPathPair[T]
self: WindowsPathPair[T] | PosixPathPair[T] = Path.__new__(cls, *args, **kwargs)
# explicitly call __init__ to setup instance (see #193)
if sys.version_info >= (3, 12):
self.__init__(*args)
self._inner = inner # type: ignore
self._serializer = serializer # type: ignore
self._deserializer = deserializer # type: ignore
Expand Down Expand Up @@ -316,6 +320,9 @@ def __new__( # type: ignore
deserializer=deserializer,
**kwargs,
)
# explicitly call __init__ to setup instance (see #193)
if sys.version_info >= (3, 12):
self.__init__(*args)
self._inner = inner
self._serializer = serializer
self._deserializer = deserializer
Expand Down
Loading