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

Support Python 3.12 #152

Merged
merged 61 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
5c27ffc
(wip) initial work on py312 support
ap-- Oct 1, 2023
18fb5f6
(wip) an issue with parents
ap-- Oct 1, 2023
917ac80
tests: don't test private interface
ap-- Oct 1, 2023
df17a4d
core312plus: remove commented pathlib functionality
ap-- Oct 1, 2023
e56c5c1
cloud, local and memory versions
ap-- Oct 1, 2023
4b2bc8d
(wip) webdav, http
ap-- Oct 1, 2023
a7e77cc
upath.core version switch in init
ap-- Oct 1, 2023
f9c1356
tests: xfail some tests on python3.12
ap-- Oct 1, 2023
1f5337c
tests: fix minor issues with tests
ap-- Oct 1, 2023
c6d0298
tests: DummyFS should overwrite _strip_protocol too
ap-- Oct 1, 2023
dc9f81c
upath.core imports and minor fixes
ap-- Oct 1, 2023
125bee8
ci: enable 3.12 tests
ap-- Oct 1, 2023
1f8d878
test: fix private url attr test
ap-- Oct 1, 2023
6bfdc8a
upath: fix subclassing issue
ap-- Oct 3, 2023
85da9e4
local: inherit __init__ from UPath
ap-- Oct 3, 2023
3c992a5
upath.implementations.cloud: deprecate lists as args to joinpath
ap-- Oct 3, 2023
b1b7565
upath.implementations.cloud: use correct flavour/pathmod
ap-- Oct 3, 2023
f9b24cf
tests: xfail non-applicable __new__ test
ap-- Oct 3, 2023
c95c66c
upath.core312plus: fix typing issues
ap-- Oct 3, 2023
c1b5b4b
upath: 312 fix glob
ap-- Oct 3, 2023
cbefc37
upath: fix relative_to issues
ap-- Oct 3, 2023
d2a774b
tests: add missing nox session
ap-- Oct 4, 2023
0471a6c
WORKAROUND: missing aiohttp wheels on python3.12
ap-- Oct 4, 2023
e58e46d
WORKAROUND: missing pyarrow wheels on python3.12
ap-- Oct 4, 2023
8aa61c0
tests: adjust webdav test to include base_url in storage_options
ap-- Oct 5, 2023
8ef76d7
upath.implementations.local: remove debugging print
ap-- Oct 5, 2023
0f39bbf
upath: make storage_options readonly
ap-- Oct 5, 2023
218a9cb
upath: minor error message improvement
ap-- Oct 5, 2023
bc8b644
upath: fix pickling issue if subclasses change __init__ args
ap-- Oct 5, 2023
b4bf272
tests: relax kwargs test
ap-- Oct 5, 2023
bcdc9a2
upath.implementations.webdav: working webdav implementation
ap-- Oct 6, 2023
432cedb
upath.implementations.azure: fix touch
ap-- Oct 6, 2023
e9380c3
tests: update for empty parts paths
ap-- Oct 11, 2023
9549db3
upath: working http implementation
ap-- Oct 11, 2023
02b76ca
upath: working hdfs implementation
ap-- Oct 12, 2023
d83297c
upath: always add netloc to ensure fsspec compatibility
ap-- Oct 12, 2023
8ffee0a
upath: add memory path and rework netloc handling for memory
ap-- Oct 12, 2023
3cebeaa
upath: fix parts handling for http
ap-- Oct 12, 2023
e247c22
tests: update pathlib 3.12 tests
ap-- Oct 12, 2023
d3abe2b
upath: fix os.Pathlike support in get_upath_protocol
ap-- Oct 12, 2023
6f66999
fix mypy issues
ap-- Oct 12, 2023
df5db1b
upath.registry: clear implementation cache when overriding registration
ap-- Oct 14, 2023
6a992c2
upath.implementations.local: on 3.12 keep UPath.with_segments and sto…
ap-- Oct 14, 2023
f7eaf97
upath: make instance creation in UPath.__new__ more explicit
ap-- Oct 14, 2023
09ed883
upath: on 3.12 add some comments regarding missing functionality
ap-- Oct 14, 2023
77b6734
tests: minor adjustments to pathlib compatibility tests on 3.12
ap-- Oct 14, 2023
48b8e39
upath: py312 UPath.__new__ further clarify behavior
ap-- Oct 14, 2023
e36b678
tests: minor fixes in tests
ap-- Oct 14, 2023
8d5f9ba
upath: refactor local implementation
ap-- Oct 14, 2023
7900150
typing: ignore types for __new__ in PosixUPath/WindowsUPath
ap-- Oct 14, 2023
dd86cfa
upath.implementations.local: fix FilePath superclass
ap-- Oct 14, 2023
2878bff
tests: windows 3.12 walk recursion tests increase recursion_limit for…
ap-- Oct 14, 2023
636913f
Merge branch 'main' into support-py312
ap-- Jan 26, 2024
08d7ac3
fix linting
ap-- Jan 26, 2024
f6718b4
fix typing issue
ap-- Jan 26, 2024
777a398
upath.implementations.memory: normalize to two slashes for py312
ap-- Jan 26, 2024
2ac5f23
tests: adjust pathlib tests to accommodate fix from py-3.12.1
ap-- Jan 27, 2024
1d3589a
upath: switch to FSSpecFlavour implementation
ap-- Jan 29, 2024
415e9d2
nox: always set aiohttp workaround
ap-- Jan 29, 2024
a4d88cd
nox: disable mypy in lint session for now
ap-- Jan 30, 2024
8e09899
tests: update pytest and plugins
ap-- Jan 30, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,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']
fsspec: ['']

include:
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:
exclude: ^upath/tests/pathlib/test_pathlib.*\.py|^upath/tests/pathlib/_test_support\.py
repos:
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -30,7 +30,7 @@ repos:
- id: codespell
additional_dependencies: ["tomli"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.6.0
rev: v3.13.0
hooks:
- id: pyupgrade
args: [--py38-plus]
Expand All @@ -39,7 +39,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
Expand Down
10 changes: 6 additions & 4 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
locations = ("upath",)


@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:
# workaround in case no aiohttp binary wheels are available
session.env["AIOHTTP_NO_EXTENSIONS"] = "1"
session.install(".[dev]")
session.run(
"pytest",
Expand Down Expand Up @@ -44,7 +46,7 @@ def lint(session: nox.Session) -> None:

args = *(session.posargs or ("--show-diff-on-failure",)), "--all-files"
session.run("pre-commit", "run", *args)
session.run("python", "-m", "mypy")
# session.run("python", "-m", "mypy")
# session.run("python", "-m", "pylint", *locations)


Expand Down Expand Up @@ -86,8 +88,8 @@ def black(session):

@nox.session
def type_checking(session):
print("please run `nox -s lint` instead")
raise SystemExit(1)
session.install("-e", ".[tests]")
session.run("python", "-m", "mypy")


@nox.session()
Expand Down
14 changes: 7 additions & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ install_requires=

[options.extras_require]
tests =
pytest==7.3.2
pytest-sugar==0.9.6
pytest==8.0.0
pytest-sugar==0.9.7
pytest-cov==4.1.0
pytest-mock==3.11.1
pytest-mock==3.12.0
pylint==2.17.4
mypy==1.3.0
mypy==1.8.0
packaging
dev =
%(tests)s
Expand All @@ -41,12 +41,12 @@ dev =
requests
gcsfs
s3fs
moto[s3,server]
moto[s3,server]<5
webdav4[fsspec]
wsgidav
cheroot
hadoop-test-cluster
pyarrow
# hadoop-test-cluster
# pyarrow
pydantic
pydantic-settings

Expand Down
12 changes: 11 additions & 1 deletion upath/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
"""Pathlib API extended to use fsspec backends."""
from upath.core import UPath
import sys

try:
from upath._version import __version__
except ImportError:
__version__ = "not-installed"

if sys.version_info >= (3, 12):
import upath.core312plus as core

sys.modules["upath.core"] = core

else:
import upath.core as core

UPath = core.UPath

__all__ = ["UPath"]
Loading
Loading