changeset 5024:edf62f78605f

Merging reverted "pip develop" compatibility into default
author anatoly techtonik <techtonik@gmail.com>
date Mon, 11 Jan 2016 17:43:37 +0300
parents 9bb20454f409 (current diff) 5e2888db6c48 (diff)
children cf22972fe080
files
diffstat 2 files changed, 10 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/dist/command/build_scripts.py	Sat Jan 09 09:34:38 2016 +0300
+++ b/roundup/dist/command/build_scripts.py	Mon Jan 11 17:43:37 2016 +0300
@@ -4,6 +4,7 @@
 # For license terms see the file COPYING.txt.
 #
 from distutils.command.build_scripts import build_scripts as base
+from distutils import log
 import sys, os, string
 
 class build_scripts(base):
@@ -60,7 +61,7 @@
         else:
             # default to current platform
             target = sys.platform
-        self.target_platfom = target
+        self.target_platform = target
 
         # for native builds, use current python executable path;
         # for cross-platform builds, use default executable name
@@ -106,7 +107,7 @@
             #    continue
 
             if self.dry_run:
-                self.announce("would create %s" % outfile)
+                log.info("would create %s" % outfile)
                 continue
 
             module = os.path.splitext(os.path.basename(script))[0]
@@ -118,7 +119,7 @@
                 'prefix': self.script_preamble,
             }
 
-            self.announce("creating %s" % outfile)
+            log.info("writing %s" % outfile)
             file = open(outfile, 'w')
 
             try:
--- a/setup.py	Sat Jan 09 09:34:38 2016 +0300
+++ b/setup.py	Mon Jan 11 17:43:37 2016 +0300
@@ -37,11 +37,6 @@
 import sys, os
 from glob import glob
 
-# patch distutils if it can't cope with the "classifiers" keyword
-from distutils.dist import DistributionMetadata
-if not hasattr(DistributionMetadata, 'classifiers'):
-    DistributionMetadata.classifiers = None
-    DistributionMetadata.download_url = None
 
 def include(d, e):
     """Generate a pair of (directory, file-list) for installation.
@@ -52,15 +47,13 @@
 
     return (d, [f for f in glob('%s/%s'%(d, e)) if os.path.isfile(f)])
 
-
-def mapscript(path):
+def scriptname(path):
     """ Helper for building a list of script names from a list of
         module files.
     """
-    module = os.path.splitext(os.path.basename(path))[0]
-    script = module.replace('_', '-')
-    return '%s = roundup.scripts.%s:run' % (script, module)
-
+    script = os.path.splitext(os.path.basename(path))[0]
+    script = script.replace('_', '-')
+    return script
 
 def main():
     # template munching
@@ -76,7 +69,7 @@
     ]
 
     # build list of scripts from their implementation modules
-    scripts = [mapscript(f) for f in glob('roundup/scripts/[!_]*.py')]
+    scripts = [scriptname(f) for f in glob('roundup/scripts/[!_]*.py')]
 
     data_files = [
         ('share/roundup/cgi-bin', ['frontends/roundup.cgi']),
@@ -157,9 +150,7 @@
                      'install_lib': install_lib,
                      },
           packages=packages,
-          entry_points={
-              'console_scripts': scripts
-          },
+          scripts=scripts,
           data_files=data_files)
 
 if __name__ == '__main__':

Roundup Issue Tracker: http://roundup-tracker.org/