Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

mauritsvanrees
Copy link
Member

Fixes #613.

Note: we are patching process_url from setuptools. The existing comment says that this method was copied over from setuptools 46.1.3. I was wondering, so I checked: the method is still the same in latest setuptools. And it is largely unchanged since setuptools 42.0.2. So for that part we should still be compatible with quite a long range of setuptools versions.

This PR also expands the warning that is printed when the patch fails. Until now it said "Requires-Python support missing." There was no indication that this was a message from buildout, so I assumed this was something from a newer setuptools or pip, and it warned about a package that did not have a requires_python in its setup.py/cfg. Now it should be clear that it is a warning from buildout itself.

@mauritsvanrees mauritsvanrees force-pushed the maurits-fix-setuptools-package-index-patch-sep-2022 branch from a113b5c to 6bbbcc9 Compare September 13, 2022 14:45
@mauritsvanrees
Copy link
Member Author

About half of the jobs fail. Looks like it is a failure in only one test file, for example here:

Failure in test /Users/runner/work/buildout/buildout/src/zc/buildout/tests/easy_install.txt
Failed doctest test for easy_install.txt
  File "/Users/runner/work/buildout/buildout/src/zc/buildout/tests/easy_install.txt", line 0

----------------------------------------------------------------------
File "/Users/runner/work/buildout/buildout/src/zc/buildout/tests/easy_install.txt", line 1277, in easy_install.txt
Failed example:
    zc.buildout.easy_install.build(
      'extdemo', dest,
      {'include_dirs': os.path.join(sample_buildout, 'include')},
      links=[link_server], index=link_server+'index/')
Expected:
    ['/sample-install/extdemo-1.5-pyN.N.egg']
Got:
    ['/sample-install/extdemo-1.4-pyN.N.egg']

It is hard to get a good overview of which jobs fail, but it looks like the 3.6 and lower jobs pass, while most 3.7+ jobs fail.

If someone can assist, I would appreciate it. After all these years I have not figured out yet how to run the tests locally. Feel free to edit the PR branch.

@gotcha
Copy link
Member

gotcha commented Sep 14, 2022

Thanks a lot for this. (I had tried to tackle the issue but did not get to satisfying code).

I will check if I can fix the remaining broken test.

I will also add some documentation how to run the tests locally.

…ty there.

Fixes #613.

Note: we are patching `process_url` from `setuptools`.
The existing comment says that this method was copied over from setuptools 46.1.3.
I was wondering, so I checked: the method is still the same in latest setuptools.  And it is largely unchanged since setuptools 42.0.2.
So for that part we should still be compatible with quite a long range of setuptools versions.
@mauritsvanrees mauritsvanrees force-pushed the maurits-fix-setuptools-package-index-patch-sep-2022 branch from 6bbbcc9 to 1527861 Compare September 30, 2022 09:44
@mauritsvanrees
Copy link
Member Author

I have rebased and force pushed this branch, after merging my unrelated other two much simpler PRs.

@mauritsvanrees
Copy link
Member Author

This contains just as many test failures as on master. So perhaps it could be merged and released. The new release would have this bug fix, and support for [versions:python311], which starts getting needed.

I know, it would be better to not have test failures. But it is notoriously difficult to keep them passing on all environments that we support. On the other hand, it seems just one failure in easy_install.txt so that should be fixable.

@gotcha
Copy link
Member

gotcha commented Oct 3, 2022

I am worried that the test fail is related to changes in latest setuptools.
I would like to confirm this is not the case by testing with previous setuptools before releasing. Does that sound reasonable ?

@mauritsvanrees
Copy link
Member Author

@gotcha Sure, sounds reasonable.
I am doing a Plone beta 3 release later today, would be nice to have the latest fixes in, but it is no blocker. Don't rush it.

This fixes test failures: extdemo-1.5 was not found, because the previous index page containing only extdemo-1.4 was cached.
We were passing this before to HTMLPage, and still do as a fallback, but I missed that this was also needed in pip 22.2+ for the new IndexContent class.
@mauritsvanrees
Copy link
Member Author

I think I have found the problem. My new code in this PR was missing cache_link_parsing=False, and this is still needed. I have pushed a fix.

@mauritsvanrees
Copy link
Member Author

BTW, I think this was only a problem in the tests: in real world usage the index page would be read only once and it would not change during a single buildout run.

@mauritsvanrees
Copy link
Member Author

@gotcha Yes, all is green!

@mauritsvanrees mauritsvanrees requested a review from gotcha November 4, 2022 16:33
@gotcha
Copy link
Member

gotcha commented Nov 5, 2022

Great !
Thanks @mauritsvanrees

I have a small patch to merge and will do a release this weekend

@gotcha gotcha merged commit 6fed3ff into master Nov 5, 2022
@gotcha gotcha deleted the maurits-fix-setuptools-package-index-patch-sep-2022 branch November 5, 2022 11:18
@gotcha
Copy link
Member

gotcha commented Nov 6, 2022

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

Successfully merging this pull request may close these issues.

Error message with pip 22.2+
2 participants