diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-12-20 15:08:02 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-12-20 15:08:02 +0100 |
commit | e78c6699a0a44c8ed063e0f95a34b7357133514d (patch) | |
tree | 231ace793d8bf6e1708c96b67057ab7aff3e8828 | |
parent | 450619e25af5ab8bf7352bae85c59002fe09ec49 (diff) | |
download | qutebrowser-e78c6699a0a44c8ed063e0f95a34b7357133514d.tar.gz qutebrowser-e78c6699a0a44c8ed063e0f95a34b7357133514d.zip |
scripts: More version parsing in recompile_requirements
Required for misc_checks.py
-rw-r--r-- | scripts/dev/recompile_requirements.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/dev/recompile_requirements.py b/scripts/dev/recompile_requirements.py index a5ab8df4f..185770132 100644 --- a/scripts/dev/recompile_requirements.py +++ b/scripts/dev/recompile_requirements.py @@ -399,8 +399,14 @@ def parse_versioned_line(line): line = line.rsplit('#', maxsplit=1)[0] line = line.split(';')[0].strip() - if '==' in line: - name, version = line.split('==') + ops = ["==", "~=", "!=", ">", "<", ">=", "<="] + + if any(op in line for op in ops): + # strictly speaking, this version isn't necessarily correct, but it's + # enough for the table. + for op in ops: + if op in line: + name, version = line.split(op) elif line.startswith('-e'): rest, name = line.split('#egg=') version = rest.split('@')[1][:7] |