Repository: dave-shawley/setupext-janitor

Issue:
Breaks matplotlib's setup.py
It appears that matplotlib has a setupext.py file, for whatever reason, and that breaks if setupext-janitor is installed.

Is the setupext nspackage thing really necessary?


Comments:

Patch:
diff --git a/README.rst b/README.rst
index 6a767de..c6a8596 100644
--- a/README.rst
+++ b/README.rst
@@ -38,7 +38,7 @@ imported into *setup.py* so that it can be passed as a keyword parameter
 
    import setuptools
    try:
-      from setupext import janitor
+      from setupext_janitor import janitor
       CleanCommand = janitor.CleanCommand
    except ImportError:
       CleanCommand = None
@@ -49,8 +49,13 @@ imported into *setup.py* so that it can be passed as a keyword parameter
 
    setup(
       # normal parameters
-      setup_requires=['setupext.janitor'],
+      setup_requires=['setupext_janitor'],
       cmdclass=cmd_classes,
+      entry_points={
+         # normal parameters, ie. console_scripts[]
+         'distutils.commands': [
+            ' clean = setupext_janitor.janitor:CleanCommand']
+         }
    )
 
 You can use a different approach if you are simply a developer that wants
diff --git a/docs/conf.py b/docs/conf.py
index 718339e..f1efef7 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -3,7 +3,7 @@
 
 import sphinx_rtd_theme
 
-from setupext import janitor
+from setupext_janitor import janitor
 
 
 project = 'Setupext: janitor'
diff --git a/setup.py b/setup.py
index d564df8..a267c85 100755
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ import codecs
 import setuptools
 import sys
 
-from setupext import janitor
+from setupext_janitor import janitor
 
 
 with codecs.open('README.rst', 'rb', encoding='utf-8') as file_obj:
@@ -26,7 +26,6 @@ setuptools.setup(
     description='Making setup.py clean more useful.',
     long_description=long_description,
     packages=setuptools.find_packages(exclude=['tests', 'tests.*']),
-    namespace_packages=['setupext'],
     zip_safe=True,
     platforms='any',
     install_requires=install_requirements,
@@ -41,7 +40,7 @@ setuptools.setup(
     ],
     entry_points={
         'distutils.commands': [
-            'clean = setupext.janitor:CleanCommand',
+            'clean = setupext_janitor.janitor:CleanCommand',
         ],
     },
     cmdclass={
diff --git a/setupext/__init__.py b/setupext/__init__.py
deleted file mode 100644
index de40ea7..0000000
--- a/setupext/__init__.py
+++ /dev/null
@@ -1,1 +0,0 @@
-__import__('pkg_resources').declare_namespace(__name__)
diff --git a/setupext_janitor/__init__.py b/setupext_janitor/__init__.py
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/setupext_janitor/__init__.py
@@ -0,0 +1,1 @@
+


Test patch:
diff --git a/setupext/janitor.py b/setupext_janitor/janitor.py
similarity index 100%
rename from setupext/janitor.py
rename to setupext_janitor/janitor.py
diff --git a/tests.py b/tests.py
index 39af958..a1d6b72 100644
--- a/tests.py
+++ b/tests.py
@@ -12,7 +12,7 @@ if sys.version_info >= (2, 7):
 else:  # noinspection PyPackageRequirements,PyUnresolvedReferences
     import unittest2 as unittest
 
-from setupext import janitor
+from setupext_janitor import janitor
 
 
 def run_setup(*command_line):