Skip to content

Commit b55b2a0

Browse files
authored
ci: start running against 3.14 (fsspec#363)
* ci: start running against 3.14 * update noxfile * install pre-release wheel for pydantic * fix uv pythons don't ship test stdlib * nox: fix sessions on windows
1 parent 8a2746c commit b55b2a0

File tree

4 files changed

+46
-33
lines changed

4 files changed

+46
-33
lines changed

.github/workflows/tests.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,25 @@ jobs:
2222
matrix:
2323
os: [ubuntu-latest, windows-latest, macos-latest]
2424
pyv: ['3.9', '3.10', '3.11', '3.12', '3.13']
25-
fsspec: ['']
25+
session: ['tests']
2626

2727
include:
2828
- os: ubuntu-latest
2929
pyv: '3.9'
30-
fsspec: 'minversion'
30+
session: 'tests-minversion'
31+
- os: ubuntu-latest
32+
pyv: '3.14'
3133

3234
steps:
3335
- name: Check out the repository
3436
uses: actions/checkout@v4
3537
with:
3638
fetch-depth: 0
3739

38-
- name: Set up Python ${{ matrix.pyv }}
39-
uses: actions/setup-python@v5
40-
with:
41-
python-version: ${{ matrix.pyv }}
42-
allow-prereleases: true
43-
44-
- name: Upgrade pip and nox
45-
run: |
46-
python -m pip install --upgrade pip nox
47-
pip --version
48-
nox --version
40+
- uses: hynek/setup-cached-uv@v2
4941

5042
- name: Run tests
51-
run: nox -s tests-${{ matrix.fsspec || matrix.pyv }} -- --cov-report=xml
43+
run: uvx nox --sessions ${{ matrix.session }} --python ${{ matrix.pyv }} -- --cov-report=xml
5244

5345
typesafety:
5446
runs-on: ubuntu-latest

noxfile.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,25 @@
66
import nox
77

88
nox.options.reuse_existing_virtualenvs = True
9+
nox.options.error_on_external_run = True
10+
11+
nox.needs_version = ">=2024.3.2"
12+
nox.options.default_venv_backend = "uv|virtualenv"
13+
914
nox.options.sessions = "lint", "tests"
1015
locations = ("upath",)
1116
running_in_ci = os.environ.get("CI", "") != ""
1217

1318

14-
@nox.session(python=["3.9", "3.10", "3.11", "3.12", "3.13"])
19+
@nox.session(python=["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"])
1520
def tests(session: nox.Session) -> None:
1621
# workaround in case no aiohttp binary wheels are available
17-
session.env["AIOHTTP_NO_EXTENSIONS"] = "1"
18-
session.install(".[tests,dev]")
19-
session.run("python", "-m", "pip", "freeze", silent=not running_in_ci)
22+
if session.python == "3.14":
23+
session.env["AIOHTTP_NO_EXTENSIONS"] = "1"
24+
session.install(".[tests,dev]", "pydantic>=2.12.0a1")
25+
else:
26+
session.install(".[tests,dev,dev-third-party]")
27+
session.run("uv", "pip", "freeze", silent=not running_in_ci)
2028
session.run(
2129
"pytest",
2230
"-m",
@@ -31,7 +39,7 @@ def tests(session: nox.Session) -> None:
3139
@nox.session(python="3.9", name="tests-minversion")
3240
def tests_minversion(session: nox.Session) -> None:
3341
session.install("fsspec==2024.5.0", ".[tests,dev]")
34-
session.run("python", "-m", "pip", "freeze", silent=not running_in_ci)
42+
session.run("uv", "pip", "freeze", silent=not running_in_ci)
3543
session.run(
3644
"pytest",
3745
"-m",
@@ -90,13 +98,13 @@ def black(session):
9098

9199
@nox.session
92100
def type_checking(session):
93-
session.install("-e", ".[tests]")
101+
session.install("-e", ".[typechecking]")
94102
session.run("python", "-m", "mypy")
95103

96104

97105
@nox.session(python=["3.9", "3.10", "3.11", "3.12", "3.13"])
98106
def typesafety(session):
99-
session.install("-e", ".[tests]")
107+
session.install("-e", ".[tests,typechecking]")
100108
session.run(
101109
"python",
102110
"-m",

pyproject.toml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ classifiers = [
2525
"Programming Language :: Python :: 3.11",
2626
"Programming Language :: Python :: 3.12",
2727
"Programming Language :: Python :: 3.13",
28+
"Programming Language :: Python :: 3.14",
2829
"Development Status :: 4 - Beta",
2930
]
3031
keywords = ["filesystem-spec", "pathlib"]
@@ -45,23 +46,27 @@ tests = [
4546
"pytest-mypy-plugins >=3.1.2",
4647
"packaging",
4748
]
49+
typechecking = [
50+
"mypy >=1.10.0",
51+
"pytest-mypy-plugins >=3.1.2",
52+
]
4853
dev = [
49-
"adlfs>=2024",
50-
"aiohttp",
51-
"requests",
52-
"gcsfs>=2024.5.0",
53-
"s3fs>=2024.5.0",
54-
"moto[s3,server]",
54+
"fsspec[adl,http,github,gcs,s3,ssh,smb] >=2024.5.0",
55+
"s3fs >=2024.5.0",
56+
"gcsfs >=2024.5.0",
57+
"adlfs >=2024",
5558
"webdav4[fsspec]",
56-
"paramiko",
59+
# testing
60+
"moto[s3,server]",
5761
"wsgidav",
5862
"cheroot",
5963
# "hadoop-test-cluster",
6064
# "pyarrow",
65+
"typing_extensions; python_version<'3.11'",
66+
]
67+
dev-third-party = [
6168
"pydantic",
6269
"pydantic-settings",
63-
"smbprotocol",
64-
"typing_extensions; python_version<'3.11'",
6570
]
6671

6772
[project.urls]

upath/tests/pathlib/_test_support.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,17 @@ def unlink(filename):
289289
pass
290290

291291

292+
def _force_run(path, func, *args):
293+
try:
294+
return func(*args)
295+
except FileNotFoundError:
296+
# chmod() won't fix a missing file.
297+
raise
298+
except OSError:
299+
os.chmod(path, stat.S_IRWXU)
300+
return func(*args)
301+
302+
292303
if sys.platform.startswith("win"):
293304
def _waitfor(func, pathname, waitall=False):
294305
# Perform the operation
@@ -330,8 +341,6 @@ def _rmdir(dirname):
330341
_waitfor(os.rmdir, dirname)
331342

332343
def _rmtree(path):
333-
from test.support import _force_run
334-
335344
def _rmtree_inner(path):
336345
for name in _force_run(path, os.listdir, path):
337346
fullname = os.path.join(path, name)
@@ -376,7 +385,6 @@ def _rmtree(path):
376385
pass
377386

378387
def _rmtree_inner(path):
379-
from test.support import _force_run
380388
for name in _force_run(path, os.listdir, path):
381389
fullname = os.path.join(path, name)
382390
try:

0 commit comments

Comments
 (0)