[Python-checkins] python/nondist/sandbox/setuptools/setuptools/command bdist_egg.py, 1.7, 1.8

pje@users.sourceforge.net pje at users.sourceforge.net
Sun May 29 01:06:02 CEST 2005


Update of /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31303/setuptools/command

Modified Files:
	bdist_egg.py 
Log Message:
Add experimental 'install_data' support to 'bdist_egg'.  The most common
distutils custom command hack in the field is to make 'install_data'
put data in with the target packages by changing the --install-data to
match --install-lib, so this should let bdist_egg work with more packages
"out of the box".


Index: bdist_egg.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command/bdist_egg.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- bdist_egg.py	3 Apr 2005 18:52:21 -0000	1.7
+++ bdist_egg.py	28 May 2005 23:05:59 -0000	1.8
@@ -96,35 +96,18 @@
         f.close()
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
     def run(self):
         if not self.skip_build:
             self.run_command('build')
 
+        if self.distribution.data_files:
+            install = self.reinitialize_command('install_data')
+            install.install_dir = self.bdist_dir
+            install.force = 0
+            install.root = None
+            log.info("installing package data to %s" % self.bdist_dir)
+            self.run_command('install_data')
+        
         install = self.reinitialize_command('install_lib', reinit_subcommands=1)
         install.install_dir = self.bdist_dir
         install.skip_build = self.skip_build
@@ -134,9 +117,10 @@
             install._mutate_outputs(self.distribution.has_ext_modules(),
                                     'build_ext', 'build_lib',
                                     '')
-        log.info("installing to %s" % self.bdist_dir)
+        log.info("installing library code to %s" % self.bdist_dir)
         self.run_command('install_lib')
 
+
         to_compile = []
         for ext_name in ext_outputs:
             filename,ext = os.path.splitext(ext_name)
@@ -174,6 +158,10 @@
         if not self.dry_run:
             self.distribution.metadata.write_pkg_info(self.egg_info)
 
+
+
+
+
         native_libs = os.path.join(self.egg_info,"native_libs.txt")
         if ext_outputs:
             log.info("writing %s" % native_libs)
@@ -193,6 +181,8 @@
                 if os.path.isfile(path):
                     self.copy_file(path,os.path.join(egg_info,filename))
 
+
+
         # Make the archive
         make_zipfile(pseudoinstall_root+'.egg',
                           archive_root, verbose=self.verbose,
@@ -203,6 +193,16 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
 def make_zipfile (zip_filename, base_dir, verbose=0, dry_run=0):
     """Create a zip file from all the files under 'base_dir'.  The output
     zip file will be named 'base_dir' + ".zip".  Uses either the "zipfile"



More information about the Python-checkins mailing list