setuptools: zope.configuration failure to find dependency

While trying to upgrade zope.configuration for Nixos, I found this problem, which sounds similar to:

https://github.com/pypa/setuptools/issues/870

I tried already with Setuptools 32.3.1, but the result is the same. This is not Nix specific, but happens also in a normal Python3.6 virtualenv

======================================================================
ERROR: test_wo_parents (zope.configuration.tests.test_docutils.Test_makeDocStructures)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/zope.configuration/src/zope/configuration/tests/test_docutils.py", line 61, in test_wo_parents
    from zope.interface import Interface
ModuleNotFoundError: No module named 'zope.interface'

----------------------------------------------------------------------
Ran 252 tests in 0.195s

FAILED (errors=229)
Test failed: <unittest.runner.TextTestResult run=252 errors=229 failures=0>
error: Test failed: <unittest.runner.TextTestResult run=252 errors=229 failures=0>

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Reactions: 4
  • Comments: 20 (14 by maintainers)

Most upvoted comments

So I encountered this too and my impression as to why this is failing is that it’s because the namespace package’s __path__ ends up being a importlib._bootstrap_external._NamespacePath object with Python 3.5 and 3.6 and there is an isinstance(path, list) in pkg_resources at https://github.com/pypa/setuptools/blob/master/pkg_resources/__init__.py#L2128 that prevents the __path__ being modified in some way that seems to be important (my guess is that it means the if _normalize_cached(item)==normalized: condition in file_ns_handler never fires, but I’m waaaaay past the point where I understand what’s going on now).