diff options
| author | PJ Eby <distutils-sig@python.org> | 2005-05-23 02:00:42 +0000 |
|---|---|---|
| committer | PJ Eby <distutils-sig@python.org> | 2005-05-23 02:00:42 +0000 |
| commit | c710ada17edb22186f285ea649363dc2ff1f0dfe (patch) | |
| tree | 000d81ba483cd96e06df1093bb0597d591cbcf6b | |
| parent | 2237065782a7ab8265b6127f9352d5f0a9c4fff6 (diff) | |
| download | python-setuptools-git-c710ada17edb22186f285ea649363dc2ff1f0dfe.tar.gz | |
Add a rough draft of Distribution.install_on(), to let others experiment
with 'require()' before the "official" version is complete.
--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041010
| -rw-r--r-- | pkg_resources.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg_resources.py b/pkg_resources.py index 1f9be67c..caab5dc9 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -417,7 +417,6 @@ def require(*requirements): XXX This doesn't work yet, because: * get_distro_source() isn't implemented - * Distribution.install_on() isn't implemented * AvailableDistributions.scan() is untested There may be other things missing as well, but this definitely won't work @@ -449,6 +448,7 @@ def require(*requirements): + class DefaultProvider: """Provides access to package resources in the filesystem""" @@ -846,6 +846,11 @@ class Distribution(object): raise InvalidOption("No such option", self, opt) return deps + def install_on(self,path=None): + # XXX this needs to interface with namespace packages and such + if path is None: path = sys.path + if self.path not in path: + path.append(self.path) def _sort_dists(dists): @@ -854,11 +859,6 @@ def _sort_dists(dists): dists[::-1] = [d for v,d in tmp] - - - - - def parse_requirements(strs): """Yield ``Requirement`` objects for each specification in `strs` |
