[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools - setup.py:1.3

Fred L. Drake, Jr. fred at zope.com
Sat Mar 13 00:32:01 EST 2004


Update of /cvs-repository/Packages/zpkgtools/zpkgtools
In directory cvs.zope.org:/tmp/cvs-serv5058/zpkgtools

Modified Files:
	setup.py 
Log Message:
- move generation of setup.py to the zpkg script; the zpkgtools.setup
  module is now only needed when the generated setup.py is run


=== Packages/zpkgtools/zpkgtools/setup.py 1.2 => 1.3 ===
--- Packages/zpkgtools/zpkgtools/setup.py:1.2	Fri Mar 12 18:08:41 2004
+++ Packages/zpkgtools/zpkgtools/setup.py	Sat Mar 13 00:32:00 2004
@@ -13,30 +13,13 @@
 ##############################################################################
 """Generator for distutils setup.py files."""
 
-import distutils.core
 import os
 import posixpath
-import pprint
 import sys
 
-from StringIO import StringIO
-
 from zpkgtools import publication
 
 
-def generate(directory, pkgname, version, type):
-    setup_py = os.path.join(directory, "setup.py")
-    f = open(setup_py, "w")
-    try:
-        print >>f, HEADER
-        print >>f, "context = zpkgtools.setup.%sContext(" % type.capitalize()
-        print >>f, "    %r, %r, __file__)" % (pkgname, version)
-        print >>f
-        print >>f, "context.setup()"
-    finally:
-        f.close()
-
-
 class SetupContext:
     """Object representing the arguments to distutils.core.setup()."""
 
@@ -57,8 +40,10 @@
             if name[0] == "_":
                 del kwargs[name]
         if "--debug" in sys.argv:
+            import pprint
             pprint.pprint(kwargs)
         else:
+            import distutils.core
             distutils.core.setup(**kwargs)
 
     def loadMetadata(self, path):
@@ -128,13 +113,3 @@
         SetupContext.__init__(self, pkgname, version, setup_file)
         self.loadMetadata(os.path.join(self._working_dir,
                                        "PUBLICATION.txt"))
-
-
-HEADER = """\
-#! /usr/bin/env python
-#
-# THIS IS A GENERATED FILE.  DO NOT EDIT THIS DIRECTLY.
-
-import zpkgtools.setup
-
-"""




More information about the Zope-CVS mailing list