Skip to content

Commit 526b264

Browse files
committed
Remove __version__. Closes python#100.
1 parent 6b7e858 commit 526b264

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

docs/changelog.rst

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@
22
importlib_resources NEWS
33
==========================
44

5-
v2.0.2
5+
v3.0.0
66
======
77

8+
* Package no longer exposes ``importlib_resources.__version__``.
9+
Users that wish to inspect the version of ``importlib_resources``
10+
should instead invoke ``.version('importlib_resources')`` from
11+
``importlib-metadata`` (
12+
`stdlib <https://docs.python.org/3/library/importlib.metadata.html>`_
13+
or `backport <https://pypi.org/project/importlib-metadata>`_)
14+
directly. This change eliminates the dependency on
15+
``importlib_metadata``. Closes #100.
816
* Package now always includes its data. Closes #93.
917
* Declare hidden imports for PyInstaller. Closes #101.
1018

importlib_resources/__init__.py

-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import sys
44

5-
from ._compat import metadata
65
from ._common import (
76
as_file, files,
87
)
@@ -52,6 +51,3 @@
5251
read_text,
5352
)
5453
del __all__[:3]
55-
56-
57-
__version__ = metadata.version('importlib_resources')

importlib_resources/_compat.py

-6
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@ class ABC(object): # type: ignore
3636
FileNotFoundError = OSError # type: ignore
3737

3838

39-
try:
40-
from importlib import metadata
41-
except ImportError:
42-
import importlib_metadata as metadata # type: ignore
43-
44-
4539
try:
4640
from zipfile import Path as ZipPath # type: ignore
4741
except ImportError:

setup.cfg

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ install_requires =
2323
typing; python_version < '3.5'
2424
zipp >= 0.4; python_version < '3.8'
2525
singledispatch; python_version < '3.4'
26-
importlib_metadata; python_version < '3.8'
2726
contextlib2; python_version < '3'
2827
setup_requires = setuptools_scm[toml] >= 3.4.1
2928

0 commit comments

Comments
 (0)