Commit 2590b8e8 authored by Laurent Peuch's avatar Laurent Peuch
Browse files

fix(set_cubes_cw_max_version): handle version written has "cubicweb[stuff]"

parent 0d65c40a5493
......@@ -51,24 +51,27 @@ class SetCubeCubicWebMaxVersion(Command):
depends, red, red_depends = self.parse_pkginfo(repo.read_file(pkginfo_path))
if "cubicweb" not in depends:
# handle things like "cubicweb[pyramid]"
simplified_depends = {x.split("[")[0]: y for x, y in depends.items()}
if "cubicweb" not in simplified_depends:
return
depends = {"cubicweb": depends["cubicweb"]}
depends = self.merge_depends_with_pypi_info(depends)
simplified_depends = {"cubicweb": simplified_depends["cubicweb"]}
simplified_depends = self.merge_depends_with_pypi_info(simplified_depends)
dependency = "cubicweb"
conditions = self.parse_conditions(
depends["cubicweb"]["current_version_scheme"]
simplified_depends["cubicweb"]["current_version_scheme"]
)
depends["cubicweb"]["all_versions"] = [
simplified_depends["cubicweb"]["all_versions"] = [
version
for version in depends["cubicweb"]["all_versions"]
for version in simplified_depends["cubicweb"]["all_versions"]
if not set(string.ascii_letters).intersection(version["version"])
]
compatible_versions = depends["cubicweb"]["all_versions"]
compatible_versions = simplified_depends["cubicweb"]["all_versions"]
maximum_version = LooseVersion(
sorted(compatible_versions, key=lambda x: LooseVersion(x["version"]))[-1][
"version"
......@@ -116,7 +119,8 @@ class SetCubeCubicWebMaxVersion(Command):
# for dependency, value in depends.items():
entry = red_depends.value.filter(
lambda x: hasattr(x, "key") and x.key.to_python() == dependency
lambda x: hasattr(x, "key")
and x.key.to_python().split("[")[0] == dependency
)[0]
update_as_str = ", ".join(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment