Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 6 additions & 6 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ jobs:
fail-fast: false
matrix:
PY:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"

env:
CIRUN: true

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand All @@ -50,7 +50,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0

Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup conda
uses: conda-incubator/setup-miniconda@v3
Expand All @@ -145,5 +145,5 @@ jobs:
shell: bash -l {0}
run: |
cd ${{ matrix.FRIEND }}
pytest -v
pytest -v -W ignore::pytest.PytestRemovedIn9Warning
cd ..
4 changes: 2 additions & 2 deletions .github/workflows/pypipublish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ CI runtime. For local use, pick a version suitable for you.

```bash
# For a new environment (mamba / conda).
mamba create -n fsspec -c conda-forge python=3.9 -y
mamba create -n fsspec -c conda-forge python=3.10 -y
conda activate fsspec

# Standard dev install with docs and tests.
Expand Down
2 changes: 1 addition & 1 deletion docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ name: fsspec
channels:
- defaults
dependencies:
- python=3.9
- python=3.10
11 changes: 2 additions & 9 deletions fsspec/caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,11 @@
import threading
import warnings
from collections import OrderedDict
from collections.abc import Callable
from concurrent.futures import Future, ThreadPoolExecutor
from itertools import groupby
from operator import itemgetter
from typing import (
TYPE_CHECKING,
Any,
Callable,
ClassVar,
Generic,
NamedTuple,
TypeVar,
)
from typing import TYPE_CHECKING, Any, ClassVar, Generic, NamedTuple, TypeVar

if TYPE_CHECKING:
import mmap
Expand Down
4 changes: 1 addition & 3 deletions fsspec/implementations/cache_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@

if TYPE_CHECKING:
from collections.abc import Iterator
from typing import Any, Literal

from typing_extensions import TypeAlias
from typing import Any, Literal, TypeAlias

from .cached import CachingFileSystem

Expand Down
3 changes: 2 additions & 1 deletion fsspec/implementations/cached.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
import tempfile
import time
import weakref
from collections.abc import Callable
from shutil import rmtree
from typing import TYPE_CHECKING, Any, Callable, ClassVar
from typing import TYPE_CHECKING, Any, ClassVar

from fsspec import filesystem
from fsspec.callbacks import DEFAULT_CALLBACK
Expand Down
3 changes: 1 addition & 2 deletions fsspec/implementations/data.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import base64
import io
from typing import Optional
from urllib.parse import unquote

from fsspec import AbstractFileSystem
Expand Down Expand Up @@ -50,7 +49,7 @@ def _open(
return io.BytesIO(self.cat_file(path))

@staticmethod
def encode(data: bytes, mime: Optional[str] = None):
def encode(data: bytes, mime: str | None = None):
"""Format the given data into data-URL syntax

This version always base64 encodes, even when the data is ascii/url-safe.
Expand Down
2 changes: 1 addition & 1 deletion fsspec/implementations/libarchive.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def _open(
if mode != "rb":
raise NotImplementedError

data = bytes()
data = b""
with self._open_archive() as arc:
for entry in arc:
if entry.pathname != path:
Expand Down
2 changes: 1 addition & 1 deletion fsspec/implementations/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def create(root, storage_options=None, fs=None, record_size=10000, **kwargs):
fs.pipe("/".join([root, ".zmetadata"]), json.dumps(met).encode())
return LazyReferenceMapper(root, fs, **kwargs)

@lru_cache()
@lru_cache
def listdir(self):
"""List top-level directories"""
dirs = (p.rsplit("/", 1)[0] for p in self.zmetadata if not p.startswith(".z"))
Expand Down
4 changes: 1 addition & 3 deletions fsspec/implementations/tests/test_dbfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@
"""

import os
import sys
from urllib.parse import urlparse

import numpy
import pytest

import fsspec

if sys.version_info >= (3, 10):
pytest.skip("These tests need to be re-recorded.", allow_module_level=True)
pytest.skip("These tests need to be re-recorded.", allow_module_level=True)

DUMMY_INSTANCE = "my_instance.com"
INSTANCE = os.getenv("DBFS_INSTANCE", DUMMY_INSTANCE)
Expand Down
19 changes: 7 additions & 12 deletions fsspec/json.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import json
from collections.abc import Mapping, Sequence
from collections.abc import Callable, Mapping, Sequence
from contextlib import suppress
from pathlib import PurePath
from typing import (
Any,
Callable,
ClassVar,
Optional,
)
from typing import Any, ClassVar

from .registry import _import_class, get_filesystem_class
from .spec import AbstractFileSystem
Expand Down Expand Up @@ -45,12 +40,12 @@ class FilesystemJSONDecoder(json.JSONDecoder):
def __init__(
self,
*,
object_hook: Optional[Callable[[dict[str, Any]], Any]] = None,
parse_float: Optional[Callable[[str], Any]] = None,
parse_int: Optional[Callable[[str], Any]] = None,
parse_constant: Optional[Callable[[str], Any]] = None,
object_hook: Callable[[dict[str, Any]], Any] | None = None,
parse_float: Callable[[str], Any] | None = None,
parse_int: Callable[[str], Any] | None = None,
parse_constant: Callable[[str], Any] | None = None,
strict: bool = True,
object_pairs_hook: Optional[Callable[[list[tuple[str, Any]]], Any]] = None,
object_pairs_hook: Callable[[list[tuple[str, Any]]], Any] | None = None,
) -> None:
self.original_object_hook = object_hook

Expand Down
13 changes: 3 additions & 10 deletions fsspec/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,16 @@
import re
import sys
import tempfile
from collections.abc import Iterable, Iterator, Sequence
from collections.abc import Callable, Iterable, Iterator, Sequence
from functools import partial
from hashlib import md5
from importlib.metadata import version
from typing import (
IO,
TYPE_CHECKING,
Any,
Callable,
TypeVar,
)
from typing import IO, TYPE_CHECKING, Any, TypeVar
from urllib.parse import urlsplit

if TYPE_CHECKING:
import pathlib

from typing_extensions import TypeGuard
from typing import TypeGuard

from fsspec.spec import AbstractFileSystem

Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ description = "File-system specification"
readme = "README.md"
license = "BSD-3-Clause"
license-files = ["LICENSE"]
requires-python = ">=3.9"
requires-python = ">=3.10"
maintainers = [{ name = "Martin Durant", email = "mdurant@anaconda.com" }]
keywords = ["file"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]

[project.optional-dependencies]
Expand Down Expand Up @@ -194,6 +194,8 @@ ignore = [
"B026",
# No explicit `stacklevel` keyword argument found
"B028",
# `zip` without explicit `strict` keyword
"B905",
# Assigning lambda expression
"E731",
# Ambiguous variable names
Expand Down
Loading