From f0464d99bbc4d5e5b7d0a244d5f96befdabd1273 Mon Sep 17 00:00:00 2001 From: tarek Date: Sun, 1 Nov 2009 15:01:40 +0100 Subject: backporting the API Eby added in 0.6c11 --HG-- branch : distribute extra : rebase_source : 7e34c308ad98259f9344e10117750aeae3e8d2ea --- setuptools/dist.py | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) (limited to 'setuptools/dist.py') diff --git a/setuptools/dist.py b/setuptools/dist.py index 2246ab96..fd4ca66b 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -1,5 +1,6 @@ __all__ = ['Distribution'] +import re from distutils.core import Distribution as _Distribution from setuptools.depends import Require from setuptools.command.install import install @@ -421,19 +422,19 @@ class Distribution(_Distribution): if self.packages: self.packages = [ p for p in self.packages - if p<>package and not p.startswith(pfx) + if p != package and not p.startswith(pfx) ] if self.py_modules: self.py_modules = [ p for p in self.py_modules - if p<>package and not p.startswith(pfx) + if p != package and not p.startswith(pfx) ] if self.ext_modules: self.ext_modules = [ p for p in self.ext_modules - if p.name<>package and not p.name.startswith(pfx) + if p.name != package and not p.name.startswith(pfx) ] @@ -805,22 +806,11 @@ class Feature: - - - - - - - - - - - - - - - - - - +def check_packages(dist, attr, value): + for pkgname in value: + if not re.match(r'\w+(\.\w+)*', pkgname): + distutils.log.warn( + "WARNING: %r not a valid package name; please use only" + ".-separated package names in setup.py", pkgname + ) -- cgit v1.2.3