setup: subclass distribution instead of overwriting original
authorSimon Heimberg <simohe@besonet.ch>
Sat, 23 Jul 2011 05:57:39 +0200
changeset 15458 c3a6ec304055
parent 15457 1470f8b00694
child 15459 434c48e981b8
setup: subclass distribution instead of overwriting original
setup.py
--- a/setup.py	Wed Nov 09 16:36:54 2011 -0600
+++ b/setup.py	Sat Jul 23 05:57:39 2011 +0200
@@ -221,9 +221,13 @@
 # when build_py is run next.
 build.sub_commands.insert(0, ('build_mo', None))
 
-Distribution.pure = 0
-Distribution.global_options.append(('pure', None, "use pure (slow) Python "
-                                    "code instead of C extensions"))
+class hgdist(Distribution):
+    pure = 0
+
+    global_options = Distribution.global_options + \
+                     [('pure', None, "use pure (slow) Python "
+                        "code instead of C extensions"),
+                     ]
 
 class hgbuildext(build_ext):
 
@@ -435,6 +439,7 @@
       data_files=datafiles,
       package_data=packagedata,
       cmdclass=cmdclass,
+      distclass=hgdist,
       options=dict(py2exe=dict(packages=['hgext', 'email']),
                    bdist_mpkg=dict(zipdist=True,
                                    license='COPYING',