plone / buildout.coredev

Plone Core Development Buildout
http://docs.plone.org/develop/coredev/docs/
74 stars 75 forks source link

Downgrade pip, upgrade setuptools. #816

Closed mauritsvanrees closed 2 years ago

mauritsvanrees commented 2 years ago

With pip>=22.2 that we have been using, buildout fails to check the python-requires of a package, so you may get incompatible versions. See https://github.com/buildout/buildout/issues/613 A fix is underway, but that can take a while. So downgrade pip to 21. Do try the latest setuptools.

The error you get is:

$ bin/buildout
Requires-Python support missing.

Traceback (most recent call last):
  File "/Users/maurits/community/plone-coredev/6.0/lib/python3.10/site-packages/zc/buildout/patches.py", line 52, in patch_PackageIndex
    from pip._internal.index.collector import HTMLPage
ImportError: cannot import name 'HTMLPage' from 'pip._internal.index.collector' (/Users/maurits/shared-eggs/cp310/pip-22.2-py3.10.egg/pip/_internal/index/collector.py)

Buildout does continue after that, but as said: it is missing the python-requires functionality.

mauritsvanrees commented 2 years ago

@jenkins-plone-org please run jobs

jensens commented 2 years ago

Please do not downgrade for pip based installs in requirements! Newer pip is way faster and more robust.

mauritsvanrees commented 2 years ago

I have not yet noticed that pip 22 is faster. Do you know why it would be faster? Looking through the changelog.

Maybe this one? "Significantly speed up isolated environment creation, by using the same sources for pip instead of creating a standalone installation for each environment. 11257"? But that sounds like it would only be for initially creating the environment, which should not amount to "way faster" overall. But I might be misinterpreting.

mauritsvanrees commented 2 years ago

I try this:

$ time bin/pip install Products.CMFPlone -c https://dist.plone.org/release/6.0.0b2/constraints.txt

I do this for both 22.1 and 22.2, in separate environments. Then I throw the envs away and recreate them. So the caches have everything that is needed. Then try again:

So in this single test on my machine (Mac, Monterey since this week) the difference is negligible.

mauritsvanrees commented 2 years ago

I am inclined to merge this, otherwise buildout can install package versions that are not compatible with your Python version. Compared to a possibly slower experience when you only use pip, I would say a merge is preferable.

This PR should fix the buildout problem, but some test failures remain, likely unrelated.

jensens commented 2 years ago

+1 for merge to fix the immediate problem and then ASAP fix buildout and undo this PR