diff options
author | PJ Eby <distutils-sig@python.org> | 2005-08-14 21:14:46 +0000 |
---|---|---|
committer | PJ Eby <distutils-sig@python.org> | 2005-08-14 21:14:46 +0000 |
commit | 0993e96461d584ff9abdc888dda4081cf5fe8ac7 (patch) | |
tree | bed722a9947401b20afc8c61a5d2f6b030911821 /setuptools/dist.py | |
parent | af4cec2574e4e934e440116be8ff39a5b3d84139 (diff) | |
download | external_python_setuptools-0993e96461d584ff9abdc888dda4081cf5fe8ac7.tar.gz external_python_setuptools-0993e96461d584ff9abdc888dda4081cf5fe8ac7.tar.bz2 external_python_setuptools-0993e96461d584ff9abdc888dda4081cf5fe8ac7.zip |
Minor refactoring of code that checks a distribution's contents.
--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041203
Diffstat (limited to 'setuptools/dist.py')
-rw-r--r-- | setuptools/dist.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py index 02458858..31a07827 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -53,9 +53,7 @@ def check_nsp(dist, attr, value): assert_string_list(dist,attr,value) for nsp in value: - for name in dist.iter_distribution_names(): - if name.startswith(nsp+'.'): break - else: + if not dist.has_contents_for(nsp): raise DistutilsSetupError( "Distribution contains no modules or packages for " + "namespace package %r" % nsp @@ -80,6 +78,8 @@ def assert_bool(dist, attr, value): "%r must be a boolean value (got %r)" % (attr,value) ) + + def check_install_requires(dist, attr, value): """Verify that install_requires is a valid requirements list""" try: @@ -436,17 +436,17 @@ class Distribution(_Distribution): pfx = package+'.' - for p in self.packages or (): + for p in self.iter_distribution_names(): if p==package or p.startswith(pfx): return True - for p in self.py_modules or (): - if p==package or p.startswith(pfx): - return True - for p in self.ext_modules or (): - if p.name==package or p.name.startswith(pfx): - return True + + + + + + def _exclude_misc(self,name,value): |