Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Aug 10, 2021. It is now read-only.

Commit ed1d204

Browse filesBrowse files
committed
Merge pull request #2 from dangra/1-add-finder
Add a dummy finder so parse_requirement does not fail on --arguments
2 parents 70af45d + 2aa545f commit ed1d204
Copy full SHA for ed1d204

File tree

Expand file treeCollapse file tree

2 files changed

+9
-4
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+9
-4
lines changed

‎bin/pip-diff

Copy file name to clipboardExpand all lines: bin/pip-diff
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Options:
1313
import os
1414
from docopt import docopt
1515
from pip.req import parse_requirements
16+
from pip.index import PackageFinder
1617

1718
class Requirements(object):
1819
def __init__(self, reqfile=None):
@@ -31,7 +32,8 @@ class Requirements(object):
3132
if not os.path.exists(reqfile):
3233
raise ValueError('The given requirements file does not exist.')
3334

34-
for requirement in parse_requirements(reqfile):
35+
finder = PackageFinder([], [])
36+
for requirement in parse_requirements(reqfile, finder=finder):
3537
if requirement.req:
3638
self.requirements.append(requirement.req)
3739

@@ -109,4 +111,4 @@ def main():
109111

110112

111113
if __name__ == '__main__':
112-
main()
114+
main()

‎bin/pip-grep

Copy file name to clipboardExpand all lines: bin/pip-grep
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Options:
1010
import os
1111
from docopt import docopt
1212
from pip.req import parse_requirements
13+
from pip.index import PackageFinder
14+
1315

1416
class Requirements(object):
1517
def __init__(self, reqfile=None):
@@ -28,7 +30,8 @@ class Requirements(object):
2830
if not os.path.exists(reqfile):
2931
raise ValueError('The given requirements file does not exist.')
3032

31-
for requirement in parse_requirements(reqfile):
33+
finder = PackageFinder([], [])
34+
for requirement in parse_requirements(reqfile, finder=finder):
3235
self.requirements.append(requirement)
3336

3437

@@ -73,4 +76,4 @@ def main():
7376

7477

7578
if __name__ == '__main__':
76-
main()
79+
main()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.