| commit | 1d6ad0d6edcb0e75e998537e8cdef3fd6ba7f4ec | [log] [tgz] |
|---|---|---|
| author | Michał Sochoń <kaszpir@gmail.com> | Sun Mar 25 23:28:04 2018 +0200 |
| committer | Michał Sochoń <kaszpir@gmail.com> | Sun Mar 25 23:34:02 2018 +0200 |
| tree | 0a6cf708e41442d693382573616620c3dc96dca6 | |
| parent | 1bdd699a79602760b48e191643a2050a98b35113 [diff] |
Provide automatic removal of pkg-resources==0.0.0 Should help to deal with that pretty paintuly issue under Ubuntu/Debian family: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1635463
diff --git a/pre_commit_hooks/requirements_txt_fixer.py b/pre_commit_hooks/requirements_txt_fixer.py index 1ee6fac..623fede 100644 --- a/pre_commit_hooks/requirements_txt_fixer.py +++ b/pre_commit_hooks/requirements_txt_fixer.py
@@ -69,6 +69,11 @@ else: rest = [] + for requirement in requirements: + if b'pkg-resources' in requirement.name: + if b'0.0.0' in requirement.value: + requirements.remove(requirement) + for requirement in sorted(requirements): after.extend(requirement.comments) after.append(requirement.value)