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

Let buildout run a script to create a constraints file. [5.2] #645

Merged
merged 2 commits into from
Mar 5, 2020

Commits on Mar 4, 2020

  1. Let buildout run a script to create a constraints file.

    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.
    mauritsvanrees committed Mar 4, 2020
    Configuration menu
    Copy the full SHA
    88867be View commit details
    Browse the repository at this point in the history
  2. Fixed constraints command in buildout.

    bin/python was not found on Jenkins.
    mauritsvanrees committed Mar 4, 2020
    Configuration menu
    Copy the full SHA
    53f6b41 View commit details
    Browse the repository at this point in the history