Skip to content

Commit

Permalink
add support for 3.12
Browse files Browse the repository at this point in the history
requires `universal-pathlib>=0.2.0`
  • Loading branch information
skshetry committed Feb 14, 2024
1 parent 6567d50 commit 2a117c6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-latest, macos-latest]
pyv: ['3.8', '3.9', '3.10', '3.11']
pyv: ['3.8', '3.9', '3.10', '3.11', '3.12']
include:
- {os: ubuntu-latest, pyv: 'pypy3.8'}

Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
nox.options.sessions = "lint", "tests"


@nox.session(python=["3.8", "3.9", "3.10", "3.11", "pypy3.8", "pypy3.9"])
@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.8", "pypy3.9"])
def tests(session: nox.Session) -> None:
session.install(".[dev]")

Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Development Status :: 3 - Alpha",
"Framework :: Pytest",
"Intended Audience :: Developers",
Expand All @@ -26,7 +27,7 @@ dependencies = [
"pytest>=6.2",
"requests",
"fsspec",
"universal-pathlib==0.1.4",
"universal-pathlib>=0.2.0",
"filelock>=3.3.2",
]

Expand Down
7 changes: 0 additions & 7 deletions src/pytest_servers/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,4 @@ def gcs(
**kwargs,
)
path.fs.mkdir(bucket_name, enable_versioning=version_aware, exist_ok=False)

# UPath adds a trailing slash here, due to which
# gcsfs.isdir() returns False.
# pylint: disable=protected-access,assigning-non-slot
original = path._accessor._format_path # noqa: SLF001

path._accessor._format_path = lambda path: original(path).rstrip("/") # type: ignore[method-assign] # noqa: SLF001
return path
2 changes: 2 additions & 0 deletions tests/test_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
)
class TestTmpUPathFactory:
def test_init(self, tmp_upath_factory, fs, cls):
if fs == "gcs":
pytest.skip("gcsfs does not support .exists() on a bucket")
path = tmp_upath_factory.mktemp(fs)
assert isinstance(path, cls)
assert path.exists()
Expand Down

0 comments on commit 2a117c6

Please sign in to comment.