Skip to content

Commit

Permalink
require fsspec>=2022.1.0 (#148)
Browse files Browse the repository at this point in the history
* upath: require fsspec>=2022.1.0

* tests: some gcsfs tests require gcsfs>=2022.7.1

* test: webdav fsspec test requires newer fsspec

* readme: document current issues solvable via newer fsspec versions

* tests: test against minimum versions of dependencies
  • Loading branch information
ap-- authored Oct 1, 2023
1 parent 6e338b6 commit 7e3836d
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ jobs:
matrix:
os: [ubuntu-20.04, windows-latest, macos-latest]
pyv: ['3.8', '3.9', '3.10', '3.11']
fsspec: ['']

include:
- os: ubuntu-20.04
pyv: '3.8'
fsspec: 'minversion'

steps:
- name: Check out the repository
Expand All @@ -41,7 +47,7 @@ jobs:
nox --version
- name: Run tests
run: nox -s tests-${{ matrix.nox_pyv || matrix.pyv }} -- --cov-report=xml
run: nox -s tests-${{ matrix.fsspec || matrix.pyv }} -- --cov-report=xml

lint:
runs-on: ubuntu-latest
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,15 @@ universal_pathlib.implementations =
myproto = my_module.submodule:MyPath
```

### Known issues solvable by installing newer upstream dependencies

Some issues in UPath's behavior with specific filesystems can be fixed by installing newer versions of
the dependencies. The following list will be kept up to date whenever we encounter more:

- **UPath().glob()** fsspec fixed its glob behavior when handling `**` patterns in versions `fsspec>=2023.9.0`
- **GCSPath().mkdir()** a few mkdir quirks are solved by installing `gcsfs>=2022.7.1`
- **fsspec.filesystem(WebdavPath().protocol)** the webdav protocol was added to fsspec in version `fsspec>=2022.5.0`

## Contributing

Contributions are very welcome.
Expand Down
14 changes: 14 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ def tests(session: nox.Session) -> None:
)


@nox.session(python="3.8", name="tests-minversion")
def tests_minversion(session: nox.Session) -> None:
session.install("fsspec==2022.1.0", ".[dev]")
session.run(
"pytest",
"-m",
"not hdfs",
"--cov",
"--cov-config=pyproject.toml",
*session.posargs,
env={"COVERAGE_FILE": f".coverage.{session.python}"},
)


@nox.session
def lint(session: nox.Session) -> None:
session.install("pre-commit")
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ python_requires = >=3.8
zip_safe = False
packages = find:
install_requires=
fsspec
fsspec>=2022.1.0

[options.extras_require]
tests =
Expand Down
13 changes: 13 additions & 0 deletions upath/tests/implementations/test_gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from ..cases import BaseTests
from ..utils import skip_on_windows
from ..utils import xfail_if_version


@skip_on_windows
Expand Down Expand Up @@ -34,3 +35,15 @@ def test_rmdir(self):
@pytest.mark.skip
def test_makedirs_exist_ok_false(self):
pass

@xfail_if_version("gcsfs", lt="2022.7.1", reason="requires gcsfs>=2022.7.1")
def test_mkdir(self):
super().test_mkdir()

@xfail_if_version("gcsfs", lt="2022.7.1", reason="requires gcsfs>=2022.7.1")
def test_mkdir_exists_ok_false(self):
super().test_mkdir_exists_ok_false()

@xfail_if_version("gcsfs", lt="2022.7.1", reason="requires gcsfs>=2022.7.1")
def test_mkdir_exists_ok_true(self):
super().test_mkdir_exists_ok_true()
5 changes: 5 additions & 0 deletions upath/tests/implementations/test_webdav.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from upath import UPath

from ..cases import BaseTests
from ..utils import xfail_if_version


class TestUPathWebdav(BaseTests):
Expand All @@ -20,3 +21,7 @@ def test_storage_options(self):
base_url = storage_options.pop("base_url")
assert storage_options == self.path.fs.storage_options
assert base_url == self.path.fs.client.base_url

@xfail_if_version("fsspec", lt="2022.5.0", reason="requires fsspec>=2022.5.0")
def test_read_with_fsspec(self):
super().test_read_with_fsspec()

0 comments on commit 7e3836d

Please sign in to comment.