Commit 4b8fbbf7 authored by Donald Stufft's avatar Donald Stufft

Upgrade packaging to 14.3

parent 09ecca34
......@@ -77,9 +77,11 @@ except ImportError:
try:
import packaging.version
import packaging.specifiers
except ImportError:
# fallback to vendored version
import setuptools._vendor.packaging.version
import setuptools._vendor.packaging.specifiers
packaging = setuptools._vendor.packaging
# For compatibility, expose packaging.version.parse as parse_version
......@@ -2678,7 +2680,7 @@ class Requirement:
"""DO NOT CALL THIS UNDOCUMENTED METHOD; use Requirement.parse()!"""
self.unsafe_name, project_name = project_name, safe_name(project_name)
self.project_name, self.key = project_name, project_name.lower()
self.specifier = packaging.version.Specifier(
self.specifier = packaging.specifiers.SpecifierSet(
",".join(["".join([x, y]) for x, y in specs])
)
self.specs = specs
......
......@@ -22,7 +22,7 @@ __title__ = "packaging"
__summary__ = "Core utilities for Python packages"
__uri__ = "https://github.com/pypa/packaging"
__version__ = "14.2"
__version__ = "14.3"
__author__ = "Donald Stufft"
__email__ = "donald@stufft.io"
......
......@@ -25,3 +25,16 @@ if PY3:
string_types = str,
else:
string_types = basestring,
def with_metaclass(meta, *bases):
"""
Create a base class with a metaclass.
"""
# This requires a bit of explanation: the basic idea is to make a dummy
# metaclass for one level of class instantiation that replaces itself with
# the actual metaclass.
class metaclass(meta):
def __new__(cls, name, this_bases, d):
return meta(name, bases, d)
return type.__new__(metaclass, 'temporary_class', (), {})
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment