zopefoundation/zope.interface

Pip install zope.interface need the lateset setuptools (60.5.0), which can't work with python 2.7

wei1224hf opened this issue · 6 comments

BUG/PROBLEM REPORT (OR OTHER COMMON ISSUE)

The zope.interface installation would use the latest setuptools , that's not good, because the latest setuptools can't work with python 2.7 .
Could anyone tell me how to install zope.interface 44.2 on python 2.7 ?

Thanks

What I did:

pip install twisted==20.3.0 # The lastest can't work on python2.7, 20.3.0 can

What I expect to happen:

Together install some other packages , work fine with python2.7

What actually happened:

`
Collecting zope.interface>=4.4.2 (from Twisted===20.3.0)
Collecting setuptools (from zope.interface>=4.4.2->Twisted==18.4.0)
Downloading setuptools-60.5.0.tar.gz

AttributeError: DistutilsMetaFinder instance has no attribute 'find_module'
`

What version of Python and Zope/Addons I am using:

Ubuntu 16.04 server rtt
python 2.7
ROS kinetic
pip 8.11

We could make the setuptools version dependent of Python 2 versus Python 3, BUT this would work only for the source distribution: to my knowledge, the eggs and wheel format is not versatile enough to support Python version dependent install_requires.

I think this is incorrect. You can write something like install_requires=["setuptools; python_version>='3'", "setuptools<45; python_version<'3'"] and that should work fine with wheels - it ends up in the wheel's METADATA file and pip understands it.

However, there's the question of whether zope.interface should be declaring setuptools in install_requires at all. It's only used in setup.py, so it should probably be in setup_requires instead. There may be some historical thorniness here, but still ...

pkg_resources as part of setuptools and is used for legacy namespace declaration here:
https://github.com/zopefoundation/zope.interface/blob/master/src/zope/__init__.py#L1

I am confused with the multiple ways of namespace declarations and why/when legacy needs to be used. Switching to PEP420 Style namespaces would remove any runtime dependency on setuptools.

Ah, I'd missed the use of pkg_resources.

As far as I know there isn't a sensible way to migrate from the pkg_resources namespace approach to PEP420, because all zope.* packages would have to be migrated simultaneously. PyPA says that trying to migrate is not advisable.

setuptools defines requires_python and so pip should only download a compatible version, it seems like upgrading pip in your 2.7 environment should fix this issue