Skip to content

Commit

Permalink
filesystem: remove fsspec version check (#257)
Browse files Browse the repository at this point in the history
dvc-objects cannot enforce a particular version of fsspec.
It's upto dvc and dvc plugins to ensure this.
  • Loading branch information
skshetry authored Dec 12, 2023
1 parent e9c0091 commit 9be478e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 31 deletions.
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ dependencies = [
"shortuuid>=0.5.0",
"funcy>=1.14",
"fsspec>=2022.10.0",
"typing-extensions>=3.7.4",
"packaging>=19",
]

[project.urls]
Expand All @@ -47,6 +45,7 @@ dev = [
"dvc-objects[tests]",
"mypy==1.7.1",
"types-tqdm",
"typing-extensions>=3.7.4",
]

[tool.setuptools.packages.find]
Expand Down
29 changes: 0 additions & 29 deletions src/dvc_objects/fs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
)

from fsspec.asyn import get_loop
from funcy import once_per_args

from dvc_objects.executors import ThreadPoolExecutor, batch_coros
from dvc_objects.utils import cached_property
Expand Down Expand Up @@ -60,33 +59,6 @@ def __init__(self, link: str, fs: "FileSystem", path: str) -> None:
)


@once_per_args
def check_required_version(
pkg: str, dist: str = "dvc_objects", log_level=logging.WARNING
):
from importlib import metadata

from packaging.requirements import InvalidRequirement, Requirement

try:
reqs = {
r.name: r.specifier for r in map(Requirement, metadata.requires(dist) or [])
}
version = metadata.version(pkg)
except (metadata.PackageNotFoundError, InvalidRequirement):
return

specifier = reqs.get(pkg)
if specifier and version and version not in specifier:
logger.log(
log_level,
"'%s%s' is required, but you have %r installed which is incompatible.",
pkg,
specifier,
version,
)


class FileSystem:
sep = "/"

Expand Down Expand Up @@ -176,7 +148,6 @@ def get_missing_deps(cls) -> List[str]:
def _check_requires(self, **kwargs):
from .scheme import Schemes

check_required_version(pkg="fsspec")
missing = self.get_missing_deps()
if not missing:
return
Expand Down

0 comments on commit 9be478e

Please sign in to comment.