Skip to content

Commit b6a9f4e

Browse files
committed
some cleanup post-PR-merge
1 parent a07cd97 commit b6a9f4e

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

pip_check_reqs/find_extra_reqs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def find_extra_reqs(options):
2424
for package in search_packages_info(all_pkgs):
2525
log.debug('installed package: %s (at %s)', package['name'],
2626
package['location'])
27-
for f in package.get('files', []) or []:
27+
for f in package.get('files', []):
2828
path = os.path.realpath(os.path.join(package['location'], f))
2929
installed_files[path] = package['name']
3030
package_path = common.is_package_file(path)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
pip>=6.0
21
packaging
2+
pip>=6.0

setup.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
with open(path.join(here, 'CHANGELOG.rst'), encoding='utf-8') as f:
1111
long_description += f.read()
1212

13+
# This is not usual, but this project needs both install_requires
14+
# and requirements.txt and we'd like to not duplicate them
15+
with open(path.join(here, 'requirements.txt'), encoding='utf-8') as f:
16+
requirements = [s.strip() for s in f.readlines()]
17+
1318
from pip_check_reqs import __version__
1419

1520
setup(
@@ -38,8 +43,5 @@
3843
'pip-extra-reqs=pip_check_reqs.find_extra_reqs:main',
3944
],
4045
},
41-
install_requires=[
42-
'packaging',
43-
'pip',
44-
],
46+
install_requires=requirements
4547
)

tests/test_find_extra_reqs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ def test_find_extra_reqs(monkeypatch):
6969
pretend.call_recorder(lambda a, session=None: requirements))
7070

7171
class options:
72-
ignore_reqs = lambda x, y: False
72+
def ignore_reqs(x, y):
73+
return False
7374
options = options()
7475

7576
result = find_extra_reqs.find_extra_reqs(options)

0 commit comments

Comments
 (0)