Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wei1224hf opened this issue Jan 17, 2022 · 6 comments
Labels

Comments

@wei1224hf
Copy link

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

@d-maurer
Copy link
Contributor

d-maurer commented Jan 17, 2022 via email

@cjwatson
Copy link
Contributor

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 ...

@jensens
Copy link
Member

jensens commented Jan 17, 2022

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.

@cjwatson
Copy link
Contributor

cjwatson commented Jan 17, 2022

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.

@d-maurer
Copy link
Contributor

d-maurer commented Jan 17, 2022 via email

@graingert
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants