summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Girdhar <mistersheik@gmail.com>2021-07-19 14:33:18 -0400
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-07-19 20:58:55 +0200
commit40629baba2de2c9eb5e11b65798b3fae79f7284a (patch)
tree9799e4a54a1c5cd7628508334eb29670bd0d5323
parentb25c6d8880c41a6053bfd2ee9d47ffc875b3be38 (diff)
downloadastroid-git-40629baba2de2c9eb5e11b65798b3fae79f7284a.tar.gz
Add setuptools dependence and related guard
-rw-r--r--ChangeLog2
-rw-r--r--astroid/interpreter/_import/util.py6
-rw-r--r--setup.cfg1
3 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 20db3f11..530c8f30 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -29,6 +29,8 @@ Release date: TBA
Closes PyCQA/pylint#4715
+* Add dependency on setuptools and a guard to prevent related exceptions.
+
What's New in astroid 2.6.2?
============================
diff --git a/astroid/interpreter/_import/util.py b/astroid/interpreter/_import/util.py
index a917bd3d..eff54c3e 100644
--- a/astroid/interpreter/_import/util.py
+++ b/astroid/interpreter/_import/util.py
@@ -7,4 +7,8 @@ except ImportError:
def is_namespace(modname):
- return pkg_resources is not None and modname in pkg_resources._namespace_packages
+ return (
+ pkg_resources is not None
+ and hasattr(pkg_resources, "_namespace_packages")
+ and modname in pkg_resources._namespace_packages
+ )
diff --git a/setup.cfg b/setup.cfg
index bc464c55..88ca5664 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -38,6 +38,7 @@ packages = find:
install_requires =
lazy_object_proxy>=1.4.0
wrapt>=1.11,<1.13
+ setuptools>=56.0
typed-ast>=1.4.0,<1.5;implementation_name=="cpython" and python_version<"3.8"
typing-extensions>=3.7.4;python_version<"3.8"
python_requires = ~=3.6