Skip to content

Commit c009996

Browse files
committed
drop the final remaining use of the deprecated pkg_resources module
Declaring a namespace package has gone through a few revisions. pkg_resources has a version that is heavily deprecated. pkgutil provides a python2/python3 compatible version that is also compatible with native python3 namespaces. https://packaging.python.org/en/latest/guides/packaging-namespace-packages/ pkg_resources is very very deprecated and importing or using it results in deprecation warnings. It's time to move off of it entirely. Fixes: #577
1 parent 8ed9dc4 commit c009996

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

fs/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Python filesystem abstraction layer.
22
"""
33

4-
__import__("pkg_resources").declare_namespace(__name__) # type: ignore
4+
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
55

66
from . import path
77
from ._fscompat import fsdecode, fsencode

fs/opener/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44

55
# Declare fs.opener as a namespace package
6-
__import__("pkg_resources").declare_namespace(__name__) # type: ignore
6+
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
77

88
# Import opener modules so that `registry.install` if called on each opener
99
from . import appfs, ftpfs, memoryfs, osfs, tarfs, tempfs, zipfs

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ setup_requires =
4343
setuptools >=38.3.0
4444
install_requires =
4545
appdirs~=1.4.3
46-
setuptools
46+
setuptools ; python_version < '3.8'
4747
six ~=1.10
4848
enum34 ~=1.1.6 ; python_version < '3.4'
4949
typing ~=3.6 ; python_version < '3.6'

0 commit comments

Comments
 (0)