Buildout parse error from plone.recipe.codeanalysis

I've recently started getting buildout errors on a couple of packages in Travis for Plone 5.1 and Plone 5.0. The error is as follows, with the stacktrace of this error at the end of this post:

RequirementParseError: Invalid requirement, parse error at "',<5.0.0'"

This does not happen locally where I've got a buildout cache, but I can reliably reproduce this failure running buildout within a docker container. The buildout annotate output shows that configparser and isort both have a <5.0.0 constraint, but I haven't been able to track down where the comma comes from.

configparser= <5.0.0
    https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg
isort= <5.0.0
    https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg

Any chance somebody else has run into this problem/ has any idea what could be the cause of it?

collective.contentrules.parentchild's failed job is here: https://travis-ci.com/github/collective/collective.contentrules.parentchild/jobs/356315926

collective.contentrules.setfield's failed job is here: https://travis-ci.org/github/collective/collective.contentrules.setfield/jobs/729038206

Getting distribution for 'plone.recipe.codeanalysis'.
WARNING: The easy_install command is deprecated and will be removed in a future version.
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.swp' found anywhere in distribution
warning: no previously-included files matching '*.swo' found anywhere in distribution
warning: no previously-included files matching '**/.DS_Store' found anywhere in distribution
warning: no previously-included files matching '**/__pycache__' found anywhere in distribution
warning: no previously-included files matching '*.un~' found anywhere in distribution
warning: no previously-included files matching 'Makefile' found anywhere in distribution
Got plone.recipe.codeanalysis 3.0.1.
Getting distribution for 'lxml==4.2.1'.
Got lxml 4.2.1.
Getting distribution for 'flake8>=2.4.0'.
Got flake8 3.8.3.
Getting distribution for 'check-manifest'.
Got check-manifest 0.43.
Getting distribution for 'typing==3.6.2'.
Got typing 3.6.2.
Getting distribution for 'pyflakes<2.3.0,>=2.2.0'.
Got pyflakes 2.2.0.
Getting distribution for 'pycodestyle<2.7.0,>=2.6.0a1'.
Got pycodestyle 2.6.0.
Getting distribution for 'mccabe<0.7.0,>=0.6.0'.
Got mccabe 0.6.1.
Getting distribution for 'functools32==3.2.3.post2'.
WARNING: The easy_install command is deprecated and will be removed in a future version.
/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/setuptools/dist.py:476: UserWarning: Normalizing '3.2.3-2' to '3.2.3.post2'
  normalized_version,
warning: no files found matching '*.txt'
no previously-included directories found matching 'build'
no previously-included directories found matching 'dist'
no previously-included directories found matching '.git*'
zip_safe flag not set; analyzing archive contents...
Got functools32 3.2.3.post2.
Getting distribution for 'toml==0.9.4'.
WARNING: The easy_install command is deprecated and will be removed in a future version.
zip_safe flag not set; analyzing archive contents...
Got toml 0.9.4.
Getting distribution for 'pep517'.
Got pep517 0.8.2.
While:
  Installing.
  Getting section code-analysis.
  Initializing section code-analysis.
  Installing recipe plone.recipe.codeanalysis.
An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/zc/buildout/buildout.py", line 2174, in main
    getattr(buildout, command)(args)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/zc/buildout/buildout.py", line 701, in install
    [self[part]['recipe'] for part in install_parts]
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1324, in __getitem__
    options._initialize()
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1432, in _initialize
    self.initialize()
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1438, in initialize
    recipe_class = _install_and_load(reqs, 'zc.buildout', entry, buildout)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/zc/buildout/buildout.py", line 1388, in _install_and_load
    allow_hosts=buildout._allow_hosts
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 957, in install
    return installer.install(specs, working_set)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 703, in install
    req = self._constrain(current_requirement)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 657, in _constrain
    requirement)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/zc/buildout/easy_install.py", line 1614, in _constrained_requirement
    str(requirement) + ',' + constraint
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3148, in parse
    req, = parse_requirements(s)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3094, in parse_requirements
    yield Requirement(line)
  File "/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3103, in __init__
    raise RequirementParseError(str(e))
RequirementParseError: Invalid requirement, parse error at "',<5.0.0'"

edit:
After some further investigation, it seems to be something caused by the version of configparser from buildout.plonetest's qa.cfg file. Other packages with the same failed buildout include sc.embedder and collective.fingerpointing

I recall running into an issue with configparser. Here is our maintained buildout version that I use for all my Plone open source project:


This stuff should work...

1 Like

Thanks for this, pinning configparser to 3.5.3 seems to solve it! Any chance you recall why it's pinned specifically to 3.5.3?