Skip to content

Commit 31eb67d

Browse files
committed
Merge pull request #2697 from qwcode/refactor_req_file
Refactor requirements file parsing
2 parents 3376460 + b911339 commit 31eb67d

File tree

6 files changed

+364
-390
lines changed

6 files changed

+364
-390
lines changed

pip/cmdoptions.py

+10
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,16 @@ def editable():
434434
help="Don't periodically check PyPI to determine whether a new version "
435435
"of pip is available for download. Implied with --no-index.")
436436

437+
# Deprecated, Remove later
438+
always_unzip = partial(
439+
Option,
440+
'-Z', '--always-unzip',
441+
dest='always_unzip',
442+
action='store_true',
443+
help=SUPPRESS_HELP,
444+
)
445+
446+
437447
##########
438448
# groups #
439449
##########

pip/exceptions.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,17 @@ class DistributionNotFound(InstallationError):
1818
"""Raised when a distribution cannot be found to satisfy a requirement"""
1919

2020

21-
class RequirementsFileParseError(PipError):
22-
"""Raised when an invalid state is encountered during requirement file
23-
parsing."""
21+
class RequirementsFileParseError(InstallationError):
22+
"""Raised when a general error occurs parsing a requirements file line."""
23+
24+
25+
class ReqFileOnleOneOptionPerLineError(InstallationError):
26+
"""Raised when an option is not allowed in a requirements file."""
27+
28+
29+
class ReqFileOptionNotAllowedWithReqError(InstallationError):
30+
"""Raised when an option is not allowed on a requirement line in a requirements
31+
file."""
2432

2533

2634
class BestVersionAlreadyInstalled(PipError):

0 commit comments

Comments
 (0)