From 526b26443a1ed714cc91d9455d485df62417bd9d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 30 Jun 2020 11:26:36 -0400 Subject: [PATCH] Remove __version__. Closes #100. --- docs/changelog.rst | 10 +++++++++- importlib_resources/__init__.py | 4 ---- importlib_resources/_compat.py | 6 ------ setup.cfg | 1 - 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 02a2a35aa779ea5..bff615dd32ba1fb 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -2,9 +2,17 @@ importlib_resources NEWS ========================== -v2.0.2 +v3.0.0 ====== +* Package no longer exposes ``importlib_resources.__version__``. + Users that wish to inspect the version of ``importlib_resources`` + should instead invoke ``.version('importlib_resources')`` from + ``importlib-metadata`` ( + `stdlib `_ + or `backport `_) + directly. This change eliminates the dependency on + ``importlib_metadata``. Closes #100. * Package now always includes its data. Closes #93. * Declare hidden imports for PyInstaller. Closes #101. diff --git a/importlib_resources/__init__.py b/importlib_resources/__init__.py index 72b5838bdad597a..f122f95e87b408d 100644 --- a/importlib_resources/__init__.py +++ b/importlib_resources/__init__.py @@ -2,7 +2,6 @@ import sys -from ._compat import metadata from ._common import ( as_file, files, ) @@ -52,6 +51,3 @@ read_text, ) del __all__[:3] - - -__version__ = metadata.version('importlib_resources') diff --git a/importlib_resources/_compat.py b/importlib_resources/_compat.py index 058430f9284d7d3..dbfc6796ae7c4aa 100644 --- a/importlib_resources/_compat.py +++ b/importlib_resources/_compat.py @@ -36,12 +36,6 @@ class ABC(object): # type: ignore FileNotFoundError = OSError # type: ignore -try: - from importlib import metadata -except ImportError: - import importlib_metadata as metadata # type: ignore - - try: from zipfile import Path as ZipPath # type: ignore except ImportError: diff --git a/setup.cfg b/setup.cfg index 0f43ae40b2fbb8c..7cdbda87e30fd67 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,7 +23,6 @@ install_requires = typing; python_version < '3.5' zipp >= 0.4; python_version < '3.8' singledispatch; python_version < '3.4' - importlib_metadata; python_version < '3.8' contextlib2; python_version < '3' setup_requires = setuptools_scm[toml] >= 3.4.1