Skip to content

distutils is deprecated in Python 3.10 #879

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

Closed
tirkarthi opened this issue Jan 8, 2022 · 6 comments · Fixed by #880
Closed

distutils is deprecated in Python 3.10 #879

tirkarthi opened this issue Jan 8, 2022 · 6 comments · Fixed by #880

Comments

@tirkarthi
Copy link

https://www.python.org/dev/peps/pep-0632/#migration-advice

from distutils.version import LooseVersion

from distutils.version import LooseVersion

@isidentical
Copy link
Member

It seems like we use it here:

pa_version = get_package_version_without_import("pyarrow")
if pa_version and LooseVersion(pa_version) < LooseVersion("2.0"):
try:
import pyarrow as pa
up = pa.filesystem.DaskFileSystem
except ImportError: # pragma: no cover
# pyarrow exists but doesn't import for some reason
up = object
else: # pragma: no cover
up = object

I don't know whether that part of the code is still needed though, it seems like a temporary hack. CC: @martindurant

@martindurant
Copy link
Member

Pyarrow < 2 ( https://pypi.org/project/pyarrow/#history ) would be about a year and a half old, should we just drop it, then? I vote yes.

@isidentical
Copy link
Member

👍🏻

@isidentical
Copy link
Member

We still use it in the tests @martindurant.

@isidentical
Copy link
Member

def test_get_pyarrow_filesystem():
pa = pytest.importorskip("pyarrow")
fs = LocalFileSystem()
if LooseVersion(pa.__version__) < LooseVersion("2.0"):
assert isinstance(fs, pa.filesystem.FileSystem)
assert fs._get_pyarrow_filesystem() is fs
else:
assert not isinstance(fs, pa.filesystem.FileSystem)
class UnknownFileSystem(object):
pass
assert not isinstance(UnknownFileSystem(), pa.filesystem.FileSystem)

@martindurant
Copy link
Member

I'm not too worried about deprecation in a test, but I can fix that too. This test became obsolete anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants