diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2013-05-03 07:43:28 -0400 | 
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-05-03 07:43:28 -0400 | 
| commit | 737fe613840baf2e10246ffb83f86690a0b1561b (patch) | |
| tree | 0ee14faa82cbde905ac4b00e2f828e66d9815ef9 | |
| parent | 742bd477e51562a8548d3a18bd3695c76a618fc0 (diff) | |
| download | python-setuptools-git-737fe613840baf2e10246ffb83f86690a0b1561b.tar.gz | |
Copy changes to dist.py from 1aae1efe5733
--HG--
branch : Setuptools-Distribute merge
extra : source : a79dd619dc8637e5c9b7de32bd8c5389c995dcb9
| -rw-r--r-- | setuptools/dist.py | 53 | 
1 files changed, 47 insertions, 6 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py index 30ff35e3..c1218ef2 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -8,7 +8,7 @@ from setuptools.command.install_lib import install_lib  from distutils.errors import DistutilsOptionError, DistutilsPlatformError  from distutils.errors import DistutilsSetupError  import setuptools, pkg_resources, distutils.core, distutils.dist, distutils.cmd -import os, distutils.log +import os, distutils.log, re  def _get_unpatched(cls):      """Protect against re-patching the distutils if reloaded @@ -61,8 +61,8 @@ def check_nsp(dist, attr, value):              parent = '.'.join(nsp.split('.')[:-1])              if parent not in value:                  distutils.log.warn( -                    "%r is declared as a package namespace, but %r is not:" -                    " please correct this in setup.py", nsp, parent +                    "WARNING: %r is declared as a package namespace, but %r" +                    " is not: please correct this in setup.py", nsp, parent                  )  def check_extras(dist, attr, value): @@ -121,6 +121,47 @@ def check_package_data(dist, attr, value):          "wildcard patterns"      ) +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 +            ) +             + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +  class Distribution(_Distribution):      """Distribution with support for features, tests, and package data @@ -415,19 +456,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)              ]  | 
