aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Holth <dholth@fastmail.fm>2012-07-23 22:31:07 -0400
committerDaniel Holth <dholth@fastmail.fm>2012-07-23 22:31:07 -0400
commit977f4db35a9390a3e10cd184f69fb2d42886b639 (patch)
tree41df347dce3533a1cc766f33519c34a04b3bb358
parentf8d45b50bfcafabe759183e716059a2e2f702420 (diff)
downloadexternal_python_setuptools-977f4db35a9390a3e10cd184f69fb2d42886b639.tar.gz
external_python_setuptools-977f4db35a9390a3e10cd184f69fb2d42886b639.tar.bz2
external_python_setuptools-977f4db35a9390a3e10cd184f69fb2d42886b639.zip
use frozenset; 'empty marker' heuristic
--HG-- branch : distribute extra : rebase_source : ebe5e94ea2a4dbea2754bef5d056f65f85fe6423
-rw-r--r--pkg_resources.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg_resources.py b/pkg_resources.py
index 27b9f834..ca0f21c4 100644
--- a/pkg_resources.py
+++ b/pkg_resources.py
@@ -2484,7 +2484,8 @@ class DistInfoDistribution(Distribution):
"""Recompute this distribution's dependencies."""
def dummy_marker(marker):
def marker_fn(environment=None, override=None):
- return True
+ # 'empty markers are True' heuristic won't install extra deps.
+ return not marker.strip()
marker_fn.__doc__ = marker
return marker_fn
try:
@@ -2506,12 +2507,12 @@ class DistInfoDistribution(Distribution):
if req.marker_fn(override={'extra':extra}):
yield req
- common = set(reqs_for_extra(None))
+ common = frozenset(reqs_for_extra(None))
dm[None].extend(common)
for extra in self._parsed_pkg_info.get_all('Provides-Extra') or []:
extra = safe_extra(extra.strip())
- dm[extra] = list(set(reqs_for_extra(extra)) - common)
+ dm[extra] = list(frozenset(reqs_for_extra(extra)) - common)
return dm