plone / plone.recipe.zope2instance

zc.buildout recipe to setup and configure a Zope 2 instance.
https://pypi.org/project/plone.recipe.zope2instance
6 stars 23 forks source link

constraints file is not evaluated when running the test suite #171

Closed jugmac00 closed 3 years ago

jugmac00 commented 3 years ago

Chaining options within a requirements file is not supported by pip, see https://pip--9474.org.readthedocs.build/en/9474/reference/requirements-files/#supported-options

This means that the following line is not supported pip syntax:

https://github.com/plone/plone.recipe.zope2instance/blob/28bc53987a3294e4a0111794a717ca635d2478e4/requirements-testing-zope-4.txt#L1

pip only supports one option per line, and instead of raising an error, it currently just ignores the second option, which here is the constraints file.

It will be an error in future - possibly, see https://github.com/pypa/pip/issues/9791

I'll create a PR to fix this.

P.S.: pinging @jensens as maybe you used this in other projects, too

jensens commented 3 years ago

Wäh. This is ugly. Why don't pip validate its input?

Anyway, it could be so handy if it would work.

So the solution is to provide a requirements.txt which has as first the -c https://zopefoundation.github.io/Zope/releases/4.5.5/requirements-full.txt and second line the-e .[test]? Or probably two subsequent calls of pip and the second is magically influenced by the first? This is what I get from Stackoverflow (never trust it ;) ).

The documentation here https://pip.pypa.io/en/stable/user_guide/#constraints-files is pointless. No context what happens then and how it affects the next pip calls. I wonder why something that important is so badly documented.

jugmac00 commented 3 years ago

I already created #172 to fix this.

Why don't pip validate its input?

Well, looks like an oversight. They added the bug label to https://github.com/pypa/pip/issues/9791 - so it gets fixed eventually - which means - it will error.

So the solution is to provide a requirements.txt which has as first the -c https://zopefoundation.github.io/Zope/releases/4.5.5/requirements-full.txt and second line the-e .[test]?

The order does not seem to matter. As you can see in #172 I have the -e .[test] in the first line, and the constraints in the second. I then checked the build log, and this works, e.g. the version of zope.testrunner is now used from the constraints file.

Or probably two subsequent calls of pip and the second is magically influenced by the first? This is what I get from Stackoverflow (never trust it ;) ).

Do you have the link to Stackoverflow? This seems really odd.

The documentation here https://pip.pypa.io/en/stable/user_guide/#constraints-files is pointless. No context what happens then and how it affects the next pip calls. I wonder why something that important is so badly documented.

pypa has a discord channel if you want to discuss with the pip developers: https://discord.gg/pypa