diff options
author | Florian Bruhin <me@the-compiler.org> | 2020-07-03 14:56:31 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2020-07-03 18:55:46 +0200 |
commit | d1e64dbaca3a28c493a69c39cf5484a795c26aa0 (patch) | |
tree | c96f251d4aaa652746ff61d3d0ba3e949eb98e76 | |
parent | a4de4ef6a45d454d621a4b10ca02a993a06c9b16 (diff) | |
download | qutebrowser-d1e64dbaca3a28c493a69c39cf5484a795c26aa0.tar.gz qutebrowser-d1e64dbaca3a28c493a69c39cf5484a795c26aa0.zip |
recompile_requirements: Deal with lines without version number
-rw-r--r-- | scripts/dev/recompile_requirements.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/dev/recompile_requirements.py b/scripts/dev/recompile_requirements.py index b7dbc6e5d..ab8be5c0f 100644 --- a/scripts/dev/recompile_requirements.py +++ b/scripts/dev/recompile_requirements.py @@ -169,9 +169,12 @@ def parse_args(): def git_diff(*args): """Run a git diff command.""" - proc = subprocess.run(['git', '--no-pager', 'diff'] + list(args) + - ['--', 'requirements.txt', 'misc/requirements'], - stdout=subprocess.PIPE, encoding='utf-8', check=True) + command = (['git', '--no-pager', 'diff'] + list(args) + [ + '--', 'requirements.txt', 'misc/requirements/requirements-*.txt']) + proc = subprocess.run(command, + stdout=subprocess.PIPE, + encoding='utf-8', + check=True) return proc.stdout.splitlines() @@ -221,7 +224,11 @@ def print_changed_files(): if line.startswith('+++ ') or line.startswith('--- '): continue - name, version = line[1:].split('==') + if '==' in line: + name, version = line[1:].split('==') + else: + name = line[1:] + version = '?' if name not in changes_dict: changes_dict[name] = Change(name) |