diff options
Diffstat (limited to 'pkg_resources/_vendor')
| -rw-r--r-- | pkg_resources/_vendor/packaging/markers.py | 4 | ||||
| -rw-r--r-- | pkg_resources/_vendor/packaging/requirements.py | 13 | ||||
| -rw-r--r-- | pkg_resources/_vendor/packaging/specifiers.py | 6 | ||||
| -rw-r--r-- | pkg_resources/_vendor/vendored.txt | 1 |
4 files changed, 17 insertions, 7 deletions
diff --git a/pkg_resources/_vendor/packaging/markers.py b/pkg_resources/_vendor/packaging/markers.py index e9c6805a..db8f1c25 100644 --- a/pkg_resources/_vendor/packaging/markers.py +++ b/pkg_resources/_vendor/packaging/markers.py @@ -55,7 +55,7 @@ class Value(Node): VARIABLE = ( L("implementation_version") | - L("python_implementation") | + L("platform_python_implementation") | L("implementation_name") | L("python_full_version") | L("platform_release") | @@ -209,7 +209,7 @@ def default_environment(): "platform_system": platform.system(), "platform_version": platform.version(), "python_full_version": platform.python_version(), - "python_implementation": platform.python_implementation(), + "platform_python_implementation": platform.python_implementation(), "python_version": platform.python_version()[:3], "sys_platform": sys.platform, } diff --git a/pkg_resources/_vendor/packaging/requirements.py b/pkg_resources/_vendor/packaging/requirements.py index dc3672e7..658716c6 100644 --- a/pkg_resources/_vendor/packaging/requirements.py +++ b/pkg_resources/_vendor/packaging/requirements.py @@ -9,7 +9,7 @@ import re from pkg_resources._vendor.pyparsing import stringStart, stringEnd, originalTextFor, ParseException from pkg_resources._vendor.pyparsing import ZeroOrMore, Word, Optional, Regex, Combine from pkg_resources._vendor.pyparsing import Literal as L # noqa -from six.moves.urllib import parse as urlparse +from pkg_resources._vendor.six.moves.urllib import parse as urlparse from .markers import MARKER_EXPR, Marker from .specifiers import LegacySpecifier, Specifier, SpecifierSet @@ -73,6 +73,12 @@ REQUIREMENT = stringStart + NAMED_REQUIREMENT + stringEnd class Requirement(object): + """Parse a requirement. + + Parse a given requirement string into its parts, such as name, specifier, + URL, and extras. Raises InvalidRequirement on a badly-formed requirement + string. + """ # TODO: Can we test whether something is contained within a requirement? # If so how do we do that? Do we need to test against the _name_ of @@ -82,9 +88,10 @@ class Requirement(object): def __init__(self, requirement_string): try: req = REQUIREMENT.parseString(requirement_string) - except ParseException: + except ParseException as e: raise InvalidRequirement( - "Invalid requirement: {0!r}".format(requirement_string)) + "Invalid requirement, parse error at \"{0!r}\"".format( + requirement_string[e.loc:e.loc + 8])) self.name = req.name if req.url: diff --git a/pkg_resources/_vendor/packaging/specifiers.py b/pkg_resources/_vendor/packaging/specifiers.py index b1fca708..cef90084 100644 --- a/pkg_resources/_vendor/packaging/specifiers.py +++ b/pkg_resources/_vendor/packaging/specifiers.py @@ -225,7 +225,8 @@ class LegacySpecifier(_IndividualSpecifier): """ ) - _regex = re.compile(r"^\s*" + _regex_str + r"\s*$", re.X | re.I) + _regex = re.compile( + r"^\s*" + _regex_str + r"\s*$", re.VERBOSE | re.IGNORECASE) _operators = { "==": "equal", @@ -366,7 +367,8 @@ class Specifier(_IndividualSpecifier): """ ) - _regex = re.compile(r"^\s*" + _regex_str + r"\s*$", re.X | re.I) + _regex = re.compile( + r"^\s*" + _regex_str + r"\s*$", re.VERBOSE | re.IGNORECASE) _operators = { "~=": "compatible", diff --git a/pkg_resources/_vendor/vendored.txt b/pkg_resources/_vendor/vendored.txt index 27bbc925..fcb72075 100644 --- a/pkg_resources/_vendor/vendored.txt +++ b/pkg_resources/_vendor/vendored.txt @@ -1,2 +1,3 @@ packaging==15.3 pyparsing==2.0.6 +six==1.10.0 |
