aboutsummaryrefslogtreecommitdiffstats
path: root/pkg_resources
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-12-11 15:20:32 -0500
committerJason R. Coombs <jaraco@jaraco.com>2016-12-11 15:32:28 -0500
commit3dd506f01d48b98aeea9bdbca0105d4c7d8ad538 (patch)
tree07b3933bd8651b7ac184736f2a3463a483e4e7b5 /pkg_resources
parent2268fb9887cfea2e28e156bd2c8314132261402f (diff)
parent5c9406987aacf17d9c004aa1456797e0044306e5 (diff)
downloadexternal_python_setuptools-develop-nspkg-always.tar.gz
external_python_setuptools-develop-nspkg-always.tar.bz2
external_python_setuptools-develop-nspkg-always.zip
Merge branch 'master' into develop-nspkg-alwaysdevelop-nspkg-always
Diffstat (limited to 'pkg_resources')
-rw-r--r--pkg_resources/__init__.py20
-rw-r--r--pkg_resources/_vendor/packaging/__about__.py2
-rw-r--r--pkg_resources/_vendor/packaging/markers.py24
-rw-r--r--pkg_resources/_vendor/vendored.txt2
4 files changed, 30 insertions, 18 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index a323857c..92503288 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -75,11 +75,7 @@ __import__('pkg_resources.extern.packaging.requirements')
__import__('pkg_resources.extern.packaging.markers')
if (3, 0) < sys.version_info < (3, 3):
- msg = (
- "Support for Python 3.0-3.2 has been dropped. Future versions "
- "will fail here."
- )
- warnings.warn(msg)
+ raise RuntimeError("Python 3.3 or later is required")
# declare some globals that will be defined later to
# satisfy the linters.
@@ -3009,9 +3005,11 @@ def _initialize(g=globals()):
"Set up global resource manager (deliberately not state-saved)"
manager = ResourceManager()
g['_manager'] = manager
- for name in dir(manager):
- if not name.startswith('_'):
- g[name] = getattr(manager, name)
+ g.update(
+ (name, getattr(manager, name))
+ for name in dir(manager)
+ if not name.startswith('_')
+ )
@_call_aside
@@ -3040,10 +3038,10 @@ def _initialize_master_working_set():
# ensure that all distributions added to the working set in the future
# (e.g. by calling ``require()``) will get activated as well,
# with higher priority (replace=True).
- dist = None # ensure dist is defined for del dist below
- for dist in working_set:
+ tuple(
dist.activate(replace=False)
- del dist
+ for dist in working_set
+ )
add_activation_listener(lambda dist: dist.activate(replace=True), existing=False)
working_set.entries = []
# match order
diff --git a/pkg_resources/_vendor/packaging/__about__.py b/pkg_resources/_vendor/packaging/__about__.py
index c21a758b..95d330ef 100644
--- a/pkg_resources/_vendor/packaging/__about__.py
+++ b/pkg_resources/_vendor/packaging/__about__.py
@@ -12,7 +12,7 @@ __title__ = "packaging"
__summary__ = "Core utilities for Python packages"
__uri__ = "https://github.com/pypa/packaging"
-__version__ = "16.7"
+__version__ = "16.8"
__author__ = "Donald Stufft and individual contributors"
__email__ = "donald@stufft.io"
diff --git a/pkg_resources/_vendor/packaging/markers.py b/pkg_resources/_vendor/packaging/markers.py
index c5d29cd9..892e578e 100644
--- a/pkg_resources/_vendor/packaging/markers.py
+++ b/pkg_resources/_vendor/packaging/markers.py
@@ -52,13 +52,26 @@ class Node(object):
def __repr__(self):
return "<{0}({1!r})>".format(self.__class__.__name__, str(self))
+ def serialize(self):
+ raise NotImplementedError
+
class Variable(Node):
- pass
+
+ def serialize(self):
+ return str(self)
class Value(Node):
- pass
+
+ def serialize(self):
+ return '"{0}"'.format(self)
+
+
+class Op(Node):
+
+ def serialize(self):
+ return str(self)
VARIABLE = (
@@ -103,6 +116,7 @@ VERSION_CMP = (
)
MARKER_OP = VERSION_CMP | L("not in") | L("in")
+MARKER_OP.setParseAction(lambda s, l, t: Op(t[0]))
MARKER_VALUE = QuotedString("'") | QuotedString('"')
MARKER_VALUE.setParseAction(lambda s, l, t: Value(t[0]))
@@ -149,7 +163,7 @@ def _format_marker(marker, first=True):
else:
return "(" + " ".join(inner) + ")"
elif isinstance(marker, tuple):
- return '{0} {1} "{2}"'.format(*marker)
+ return " ".join([m.serialize() for m in marker])
else:
return marker
@@ -168,13 +182,13 @@ _operators = {
def _eval_op(lhs, op, rhs):
try:
- spec = Specifier("".join([op, rhs]))
+ spec = Specifier("".join([op.serialize(), rhs]))
except InvalidSpecifier:
pass
else:
return spec.contains(lhs)
- oper = _operators.get(op)
+ oper = _operators.get(op.serialize())
if oper is None:
raise UndefinedComparison(
"Undefined {0!r} on {1!r} and {2!r}.".format(op, lhs, rhs)
diff --git a/pkg_resources/_vendor/vendored.txt b/pkg_resources/_vendor/vendored.txt
index 6b5eb450..9a94c5bc 100644
--- a/pkg_resources/_vendor/vendored.txt
+++ b/pkg_resources/_vendor/vendored.txt
@@ -1,4 +1,4 @@
-packaging==16.7
+packaging==16.8
pyparsing==2.1.10
six==1.10.0
appdirs==1.4.0