diff options
| author | PJ Eby <distutils-sig@python.org> | 2005-07-18 02:28:14 +0000 |
|---|---|---|
| committer | PJ Eby <distutils-sig@python.org> | 2005-07-18 02:28:14 +0000 |
| commit | 89ff5b184629d1bafd55342ad5eeb1dccc4b2956 (patch) | |
| tree | 9230bf6807ca6ea5ebe1917ba1d6378e72986d36 | |
| parent | f7288a7f76db04584c4fbb43d86adfda29285e90 (diff) | |
| download | python-setuptools-git-89ff5b184629d1bafd55342ad5eeb1dccc4b2956.tar.gz | |
Catch a few missed terminology changes.
--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041137
| -rw-r--r-- | pkg_resources.py | 16 | ||||
| -rwxr-xr-x | setuptools.txt | 2 | ||||
| -rw-r--r-- | setuptools/tests/test_resources.py | 22 |
3 files changed, 20 insertions, 20 deletions
diff --git a/pkg_resources.py b/pkg_resources.py index 3151b063..6c5f5ef1 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -362,7 +362,7 @@ class WorkingSet(object): # Oops, the "best" so far conflicts with a dependency raise VersionConflict(dist,req) # XXX put more info here - requirements.extend(dist.depends(req.extras)[::-1]) + requirements.extend(dist.requires(req.extras)[::-1]) processed[req] = True return to_activate # return list of distros to activate @@ -1569,8 +1569,8 @@ class Distribution(object): _dep_map = property(_dep_map) - def depends(self,extras=()): - """List of Requirements needed for this distro if `options` are used""" + def requires(self,extras=()): + """List of Requirements needed for this distro if `extras` are used""" dm = self._dep_map deps = [] deps.extend(dm.get(None,())) @@ -1686,16 +1686,18 @@ def parse_requirements(strs): raise ValueError("Missing distribution spec", line) project_name = match.group(1) p = match.end() - options = [] + extras = [] match = OBRACKET(line,p) if match: p = match.end() - line, p, options = scan_list(DISTRO,CBRACKET,line,p,(1,),"option") + line, p, extras = scan_list( + DISTRO, CBRACKET, line, p, (1,), "'extra' name" + ) line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec") specs = [(op,val.replace('_','-')) for op,val in specs] - yield Requirement(project_name.replace('_','-'), specs, options) + yield Requirement(project_name.replace('_','-'), specs, extras) def _sort_dists(dists): @@ -1718,8 +1720,6 @@ def _sort_dists(dists): - - class Requirement: def __init__(self, project_name, specs=(), extras=()): self.project_name = project_name diff --git a/setuptools.txt b/setuptools.txt index 6834615c..bc6747c8 100755 --- a/setuptools.txt +++ b/setuptools.txt @@ -1419,7 +1419,7 @@ Release Notes/Change History * Distribution objects no longer have an ``installed_on()`` method, and the ``install_on()`` method is now ``activate()`` (but may go away altogether - soon). + soon). The ``depends()`` method has also been renamed to ``requires()``. * ``find_distributions()`` now takes an additional argument called ``only``, that tells it to only yield distributions whose location is the passed-in diff --git a/setuptools/tests/test_resources.py b/setuptools/tests/test_resources.py index 1cb841da..8e4dbf07 100644 --- a/setuptools/tests/test_resources.py +++ b/setuptools/tests/test_resources.py @@ -105,18 +105,18 @@ class DistroTests(TestCase): self.checkFooPkg(d) - def distDepends(self, txt): + def distRequires(self, txt): return Distribution("/foo", metadata=Metadata(('depends.txt', txt))) - def checkDepends(self, dist, txt, opts=()): + def checkRequires(self, dist, txt, extras=()): self.assertEqual( - list(dist.depends(opts)), + list(dist.requires(extras)), list(parse_requirements(txt)) ) def testDistroDependsSimple(self): for v in "Twisted>=1.5", "Twisted>=1.5\nZConfig>=2.0": - self.checkDepends(self.distDepends(v), v) + self.checkRequires(self.distRequires(v), v) @@ -163,29 +163,29 @@ class DistroTests(TestCase): ) def testDistroDependsOptions(self): - d = self.distDepends(""" + d = self.distRequires(""" Twisted>=1.5 [docgen] ZConfig>=2.0 docutils>=0.3 [fastcgi] fcgiapp>=0.1""") - self.checkDepends(d,"Twisted>=1.5") - self.checkDepends( + self.checkRequires(d,"Twisted>=1.5") + self.checkRequires( d,"Twisted>=1.5 ZConfig>=2.0 docutils>=0.3".split(), ["docgen"] ) - self.checkDepends( + self.checkRequires( d,"Twisted>=1.5 fcgiapp>=0.1".split(), ["fastcgi"] ) - self.checkDepends( + self.checkRequires( d,"Twisted>=1.5 ZConfig>=2.0 docutils>=0.3 fcgiapp>=0.1".split(), ["docgen","fastcgi"] ) - self.checkDepends( + self.checkRequires( d,"Twisted>=1.5 fcgiapp>=0.1 ZConfig>=2.0 docutils>=0.3".split(), ["fastcgi", "docgen"] ) - self.assertRaises(InvalidOption, d.depends, ["foo"]) + self.assertRaises(InvalidOption, d.requires, ["foo"]) |
