Skip to content

Commit 09675ed

Browse files
authored
Fix build environment and make adjustments for Python 3.13 (#215)
* Fix build environment and make adjustments for Python 3.13 * Fix up build env
1 parent 6d105d1 commit 09675ed

File tree

5 files changed

+35
-26
lines changed

5 files changed

+35
-26
lines changed

.github/workflows/build.yml

+11-13
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
max-parallel: 4
1818
matrix:
1919
platform: [ubuntu-latest, windows-latest]
20-
python-version: [3.8, 3.9, '3.10', '3.11', '3.12-dev']
20+
python-version: [3.8, 3.9, '3.10', '3.11', '3.12', '3.13']
2121
include:
2222
- python-version: 3.8
2323
tox-env: py38
@@ -27,29 +27,26 @@ jobs:
2727
tox-env: py310
2828
- python-version: '3.11'
2929
tox-env: py310
30-
- python-version: '3.12-dev'
30+
- python-version: '3.12'
3131
tox-env: py312
32+
- python-version: '3.13'
33+
tox-env: py313
3234
exclude:
3335
- platform: windows-latest
34-
python-version: '3.12-dev'
36+
python-version: '3.13'
3537

3638
env:
3739
TOXENV: ${{ matrix.tox-env }}
3840

3941
runs-on: ${{ matrix.platform }}
4042

4143
steps:
42-
- uses: actions/checkout@v3
44+
- uses: actions/checkout@v4
4345
- name: Set up Python ${{ matrix.python-version }}
44-
if: "!endsWith(matrix.python-version, '-dev')"
4546
uses: actions/setup-python@v4
4647
with:
4748
python-version: ${{ matrix.python-version }}
48-
- name: Set up development Python ${{ matrix.python-version }}
49-
if: endsWith(matrix.python-version, '-dev')
50-
uses: deadsnakes/[email protected]
51-
with:
52-
python-version: ${{ matrix.python-version }}
49+
allow-prereleases: true
5350
- name: Install dependencies
5451
run: |
5552
python -m pip install --upgrade pip setuptools tox coverage
@@ -58,11 +55,12 @@ jobs:
5855
python -m tox
5956
- name: Upload Results
6057
if: success()
61-
uses: codecov/codecov-action@v3
58+
uses: codecov/codecov-action@v4
6259
with:
6360
file: ./coverage.xml
6461
flags: unittests
6562
name: ${{ matrix.platform }}-${{ matrix.tox-env }}
63+
token: ${{ secrets.CODECOV_TOKEN }} # required
6664
fail_ci_if_error: false
6765

6866
lint:
@@ -77,7 +75,7 @@ jobs:
7775
runs-on: ubuntu-latest
7876

7977
steps:
80-
- uses: actions/checkout@v3
78+
- uses: actions/checkout@v4
8179
- name: Set up Python ${{ matrix.python-version }}
8280
uses: actions/setup-python@v4
8381
with:
@@ -101,7 +99,7 @@ jobs:
10199
runs-on: ubuntu-latest
102100

103101
steps:
104-
- uses: actions/checkout@v3
102+
- uses: actions/checkout@v4
105103
- name: Set up Python ${{ matrix.python-version }}
106104
uses: actions/setup-python@v4
107105
with:

.github/workflows/deploy.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020
with:
2121
fetch-depth: 0
2222
- name: Set up Python ${{ matrix.python-version }}
@@ -40,7 +40,7 @@ jobs:
4040
runs-on: ubuntu-latest
4141

4242
steps:
43-
- uses: actions/checkout@v3
43+
- uses: actions/checkout@v4
4444
- uses: actions/setup-python@v4
4545
with:
4646
python-version: 3.11

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ show_error_codes = true
7171
[tool.ruff]
7272
line-length = 120
7373

74-
select = [
74+
lint.select = [
7575
"A", # flake8-builtins
7676
"B", # flake8-bugbear
7777
"D", # pydocstyle
@@ -87,7 +87,7 @@ select = [
8787
"PERF" # Perflint
8888
]
8989

90-
ignore = [
90+
lint.ignore = [
9191
"E741",
9292
"D202",
9393
"D401",

wcmatch/pathlib.py

+19-9
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def _translate_path(self) -> str:
109109
sep = ''
110110
name = str(self)
111111
if isinstance(self, Path) and name and self.is_dir():
112-
sep = self._flavour.sep
112+
sep = self.parser.sep if util.PY313 else self._flavour.sep
113113

114114
return name + sep
115115

@@ -227,18 +227,28 @@ def rglob( # type: ignore[override]
227227
yield from self.glob(patterns, flags=flags | _EXTMATCHBASE, limit=limit, exclude=exclude)
228228

229229

230-
class PurePosixPath(PurePath):
231-
"""Pure Posix path."""
230+
if util.PY313:
231+
class PurePosixPath(pathlib.PurePosixPath, PurePath):
232+
"""Pure Posix path."""
232233

233-
_flavour = pathlib._posix_flavour if not util.PY312 else posixpath # type: ignore[attr-defined]
234-
__slots__ = ()
234+
__slots__ = ()
235235

236+
class PureWindowsPath(pathlib.PureWindowsPath, PurePath):
237+
"""Pure Windows path."""
236238

237-
class PureWindowsPath(PurePath):
238-
"""Pure Windows path."""
239+
__slots__ = ()
240+
else:
241+
class PurePosixPath(PurePath): # type: ignore[no-redef]
242+
"""Pure Posix path."""
239243

240-
_flavour = pathlib._windows_flavour if not util.PY312 else ntpath # type: ignore[attr-defined]
241-
__slots__ = ()
244+
_flavour = pathlib._posix_flavour if not util.PY312 else posixpath # type: ignore[attr-defined]
245+
__slots__ = ()
246+
247+
class PureWindowsPath(PurePath): # type: ignore[no-redef]
248+
"""Pure Windows path."""
249+
250+
_flavour = pathlib._windows_flavour if not util.PY312 else ntpath # type: ignore[attr-defined]
251+
__slots__ = ()
242252

243253

244254
class PosixPath(Path, PurePosixPath):

wcmatch/util.py

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
PY310 = (3, 10) <= sys.version_info
1313
PY312 = (3, 12) <= sys.version_info
14+
PY313 = (3, 13) <= sys.version_info
1415

1516
UNICODE = 0
1617
BYTES = 1

0 commit comments

Comments
 (0)