-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Let buildout run a script to create a constraints file. [5.2] #645
Conversation
This replaces the buildout.requirements extension. Good points for this extension: - It is a proper buildout extension. Bad points for this extension: - It cannot be run standalone: it only gathers information while buildout is running. - It ignores version pins for packages that buildout does not use in this run: if you run `bin/buildout install part1`, then version pins for other parts are ignored. - On Jenkins node 4 with Python 3.6 the package is broken. #642 Good points for the new script: - It can be run as a standalone script. You just need any Python with any zc.buildout version. - It is fast: it takes maybe two seconds. - It reports *all* version pins, not just the ones that got installed. Bad points for the new script: - It is not a proper buildout extension. We want to run it from buildout, so we need a separate section/part for it, using plone.recipe.command (which is even older than buildout.requirements, though it works fine on Python 3). But it should be fairly easy to turn this into an extension (or recipe). - It is hardcoded to read `buildout.cfg`, including its extends. Should be easy enough to make this configurable with argparse/optparse/whatever. Script adapted from: https://gist.github.com/mauritsvanrees/c47e974e418c707a626200cb6561405b See also https://community.plone.org/t/creating-constraints-and-requirements-from-buildout-config/10296 We cannot use configparser, because buildout configs contain 'duplicate' options: $ grep -i chameleon versions.cfg Chameleon = 3.6.2 chameleon = 3.6.2 So we use the buildout configparser. Bonus: we automatically use the section expressions, like `[versions:python27]`. So the end result of running this script can be different per Python version. That is something to remember.
@jenkins-plone-org please run jobs |
Oops, on Jenkins the command has this result:
Buildout continues, which I think is a good thing (better than the current breakage of |
|
bin/python was not found on Jenkins.
Fixed an error: bin/python was not known. @jenkins-plone-org please run jobs |
Then you must run buildout at least once to gather this information. And probably also run it after every change. Or not? I want to be able to point to any versions file, maybe also online, and parse it to a constraints.txt. (Not possible at the moment, but that is very doable). Actually, I see that Does it handle the Do you think creating a |
https://github.com/plone/plone.versioncheck/blob/master/src/plone/versioncheck/parser.py does not need any buildout to be run before.
I am not sure, probably this need to be fixed/added.
Indeed it seems a bit out of scope. But it gathers all the data already. And writing an output to constraints.txt would be a straight forward task. |
Oh yeah: I compared the constraints file as output by
My immediate concern is that Jenkins 3.6 sometimes breaks because of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Only a totally unrelated robot test failure on 2.7. |
This replaces the buildout.requirements extension.
Good points for this extension:
Bad points for this extension:
if you run
bin/buildout install part1
, then version pins for other parts are ignored.Jenkins node 4 has problem with Python 3.6 and locales #642
Good points for the new script:
You just need any Python with any zc.buildout version.
Bad points for the new script:
We want to run it from buildout, so we need a separate section/part for it,
using plone.recipe.command (which is even older than buildout.requirements, though it works fine on Python 3).
But it should be fairly easy to turn this into an extension (or recipe).
buildout.cfg
, including its extends.Should be easy enough to make this configurable with argparse/optparse/whatever.
Script adapted from: https://gist.github.com/mauritsvanrees/c47e974e418c707a626200cb6561405b
See also https://community.plone.org/t/creating-constraints-and-requirements-from-buildout-config/10296
We cannot use configparser, because buildout configs contain 'duplicate' options:
So we use the buildout configparser.
Bonus: we automatically use the section expressions, like
[versions:python27]
.So the end result of running this script can be different per Python version.
That is something to remember.