`cubicweb-ctl list` command does not support multiple constrained versions
In a __pkginfo__.py
dependancies version may be given covering a specific range, for insance cubicweb-bootstrap: '>=1.b.c,<2.0.0'
.
This is supported by pip, but not by Cubicweb, with ignore the comma and consider 1.b.c,<2.0.0
has being the version number, which may lead to the folling traceback when running cubicweb-ctl list
:
Traceback (most recent call last):
File "/home/schabot/.virtualenvs/databnf/lib/python3.7/site-packages/logilab/common/changelog.py", line 85, in parse
return [int(i) for i in versionstr.split(".")]
File "/home/schabot/.virtualenvs/databnf/lib/python3.7/site-packages/logilab/common/changelog.py", line 85, in <listcomp>
return [int(i) for i in versionstr.split(".")]
ValueError: invalid literal for int() with base 10: '0,<1'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/schabot/.virtualenvs/databnf/bin/cubicweb-ctl", line 33, in <module>
sys.exit(load_entry_point('cubicweb', 'console_scripts', 'cubicweb-ctl')())
File "/home/schabot/src/public/cubicweb/cubicweb/cwctl.py", line 830, in run
CWCTL.run(args)
File "/home/schabot/.virtualenvs/databnf/lib/python3.7/site-packages/logilab/common/clcommands.py", line 149, in run
sys.exit(command.main_run(args, rcfile))
File "/home/schabot/.virtualenvs/databnf/lib/python3.7/site-packages/logilab/common/clcommands.py", line 290, in main_run
self.run(args)
File "/home/schabot/src/public/cubicweb/cubicweb/cwctl.py", line 325, in run
cfgpb.solve()
File "/home/schabot/src/public/cubicweb/cubicweb/migration.py", line 555, in solve
lower_strict = version_strictly_lower(self.cubes[cube], version)
File "/home/schabot/src/public/cubicweb/cubicweb/migration.py", line 475, in version_strictly_lower
b = Version(b)
File "/home/schabot/.virtualenvs/databnf/lib/python3.7/site-packages/logilab/common/changelog.py", line 76, in __new__
parsed = cls.parse(versionstr)
File "/home/schabot/.virtualenvs/databnf/lib/python3.7/site-packages/logilab/common/changelog.py", line 87, in parse
raise ValueError("invalid literal for version '%s' (%s)" % (versionstr, ex))
ValueError: invalid literal for version '1.6.0,<1.7.0' (invalid literal for int() with base 10: '0,<1')
This issue should be fixed in https://forge.extranet.logilab.fr/cubicweb/cubicweb/-/blob/branch/default/cubicweb/migration.py#L482 for instance, or may be we should use https://pypi.org/project/requirements-parser/ not to parse and manage this ourselves… or… may be cubicweb-list
should be re-implemented with existing tools ? like pip-compile
from pip-tools
for instance.