From 64cc6ef2226cd914ca97d2ef87ce49edef980cd8 Mon Sep 17 00:00:00 2001 From: Ivan Shcheklein Date: Fri, 31 May 2024 17:09:06 -0700 Subject: [PATCH] fix(ci, python 3.12): use importlib_metadata for tests --- requirements-dev.txt | 1 + tests/test_sshfs.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 43d3a26..1b4add2 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,3 +2,4 @@ pytest pytest-asyncio pytest-cov mock-ssh-server +importlib-metadata >= 6.0.0 diff --git a/tests/test_sshfs.py b/tests/test_sshfs.py index c30bdfc..7701c10 100644 --- a/tests/test_sshfs.py +++ b/tests/test_sshfs.py @@ -8,9 +8,9 @@ from pathlib import Path import fsspec -import pkg_resources import pytest from asyncssh.sftp import SFTPFailure +from importlib_metadata import entry_points from sshfs import SSHFileSystem @@ -74,7 +74,7 @@ def strip_keys(info): def test_fsspec_registration(ssh_server): - for ep in pkg_resources.iter_entry_points(group="fsspec.specs"): + for ep in list(entry_points(group="fsspec.specs")): fs = fsspec.filesystem( ep.name, host=ssh_server.host, @@ -86,7 +86,7 @@ def test_fsspec_registration(ssh_server): def test_fsspec_url_parsing(ssh_server, remote_dir, user="user"): - for ep in pkg_resources.iter_entry_points(group="fsspec.specs"): + for ep in list(entry_points(group="fsspec.specs")): url = f"{ep.name}://{user}@{ssh_server.host}:{ssh_server.port}/{remote_dir}/file" with fsspec.open(url, "w", client_keys=[USERS[user]]) as file: # Check the underlying file system.