Support ~= expressions in dependencies.

This commit is contained in:
Patrick Lehmann
2024-01-09 02:15:47 +01:00
parent ce36b28f42
commit 79ed372079

View File

@@ -151,7 +151,7 @@ jobs:
packages = { packages = {
"coverage": "python-coverage:p", "coverage": "python-coverage:p",
"igraph": "igraph:p", "igraph": "igraph:p",
"Jinja2": "python-markupsafe:p", "jinja2": "python-markupsafe:p",
"lxml": "python-lxml:p", "lxml": "python-lxml:p",
"numpy": "python-numpy:p", "numpy": "python-numpy:p",
"markupsafe": "python-markupsafe:p", "markupsafe": "python-markupsafe:p",
@@ -162,19 +162,19 @@ jobs:
"wheel": "python-wheel:p", "wheel": "python-wheel:p",
} }
subPackages = { subPackages = {
"pyTooling": { "pytooling": {
"yaml": "python-ruamel-yaml:p python-ruamel.yaml.clib:p", "yaml": "python-ruamel-yaml:p python-ruamel.yaml.clib:p",
} }
} }
regExp = compile(r"(?P<PackageName>[\w_\-\.]+)(?:\[(?P<SubPackages>(?:\w+)(?:,\w+)*)\])?(?:\s*(?P<Comperator>[<>=]+)\s*)(?P<Version>\d+(?:\.\d+)*)(?:-(?P<VersionExtension>\w+))?") regExp = compile(r"(?P<PackageName>[\w_\-\.]+)(?:\[(?P<SubPackages>(?:\w+)(?:\s*,\s*\w+)*)\])?(?:\s*(?P<Comperator>[<>~=]+)\s*)(?P<Version>\d+(?:\.\d+)*)(?:-(?P<VersionExtension>\w+))?")
pacboyPackages = set(("python-pip:p", "python-wheel:p", "python-tomli:p")) pacboyPackages = set(("python-pip:p", "python-wheel:p", "python-tomli:p"))
print(f"Processing dependencies ({len(dependencies)}):") print(f"Processing dependencies ({len(dependencies)}):")
for dependency in dependencies: for dependency in dependencies:
print(f" {dependency}") print(f" {dependency}")
match = regExp.match(dependency) match = regExp.match(dependency.lower())
if not match: if not match:
print(f" Wrong format: {dependency}") print(f" Wrong format: {dependency}")
print(f"::error title=Identifying Pacboy Packages::Unrecognized dependency format '{dependency}'") print(f"::error title=Identifying Pacboy Packages::Unrecognized dependency format '{dependency}'")