diff options
author | Neil Girdhar <mistersheik@gmail.com> | 2021-07-19 14:33:18 -0400 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-07-19 20:58:55 +0200 |
commit | 40629baba2de2c9eb5e11b65798b3fae79f7284a (patch) | |
tree | 9799e4a54a1c5cd7628508334eb29670bd0d5323 | |
parent | b25c6d8880c41a6053bfd2ee9d47ffc875b3be38 (diff) | |
download | astroid-git-40629baba2de2c9eb5e11b65798b3fae79f7284a.tar.gz |
Add setuptools dependence and related guard
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | astroid/interpreter/_import/util.py | 6 | ||||
-rw-r--r-- | setup.cfg | 1 |
3 files changed, 8 insertions, 1 deletions
@@ -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 + ) @@ -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 |