Latest distutils
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23252 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -19,6 +19,7 @@ __all__ = ['build',
|
||||
'install_scripts',
|
||||
'install_data',
|
||||
'sdist',
|
||||
'register',
|
||||
'bdist',
|
||||
'bdist_dumb',
|
||||
'bdist_rpm',
|
||||
|
@@ -100,7 +100,7 @@ class bdist_wininst (Command):
|
||||
if not self.skip_build:
|
||||
self.run_command('build')
|
||||
|
||||
install = self.reinitialize_command('install')
|
||||
install = self.reinitialize_command('install', reinit_subcommands=1)
|
||||
install.root = self.bdist_dir
|
||||
install.skip_build = self.skip_build
|
||||
install.warn_dir = 0
|
||||
|
@@ -86,25 +86,11 @@ class build_py (Command):
|
||||
# Two options control which modules will be installed: 'packages'
|
||||
# and 'py_modules'. The former lets us work with whole packages, not
|
||||
# specifying individual modules at all; the latter is for
|
||||
# specifying modules one-at-a-time. Currently they are mutually
|
||||
# exclusive: you can define one or the other (or neither), but not
|
||||
# both. It remains to be seen how limiting this is.
|
||||
# specifying modules one-at-a-time.
|
||||
|
||||
# Dispose of the two "unusual" cases first: no pure Python modules
|
||||
# at all (no problem, just return silently), and over-specified
|
||||
# 'packages' and 'py_modules' options.
|
||||
|
||||
if not self.py_modules and not self.packages:
|
||||
return
|
||||
if self.py_modules and self.packages:
|
||||
raise DistutilsOptionError, \
|
||||
"build_py: supplying both 'packages' and 'py_modules' " + \
|
||||
"options is not allowed"
|
||||
|
||||
# Now we're down to two cases: 'py_modules' only and 'packages' only.
|
||||
if self.py_modules:
|
||||
self.build_modules()
|
||||
else:
|
||||
if self.packages:
|
||||
self.build_packages()
|
||||
|
||||
self.byte_compile(self.get_outputs(include_bytecode=0))
|
||||
@@ -276,10 +262,10 @@ class build_py (Command):
|
||||
(package, module, module_file), just like 'find_modules()' and
|
||||
'find_package_modules()' do."""
|
||||
|
||||
modules = []
|
||||
if self.py_modules:
|
||||
modules = self.find_modules()
|
||||
else:
|
||||
modules = []
|
||||
modules.extend(self.find_modules())
|
||||
if self.packages:
|
||||
for package in self.packages:
|
||||
package_dir = self.get_package_dir(package)
|
||||
m = self.find_package_modules(package, package_dir)
|
||||
|
@@ -15,7 +15,7 @@ from distutils.util import convert_path
|
||||
from distutils import log
|
||||
|
||||
# check if Python is called on the first line with this expression
|
||||
first_line_re = re.compile(r'^#!.*python[0-9.]*(\s+.*)?$')
|
||||
first_line_re = re.compile('^#!.*python[0-9.]*([ \t].*)?$')
|
||||
|
||||
class build_scripts (Command):
|
||||
|
||||
@@ -96,7 +96,7 @@ class build_scripts (Command):
|
||||
(os.path.normpath(sys.executable),
|
||||
post_interp))
|
||||
else:
|
||||
outf.write("#!%s%s" %
|
||||
outf.write("#!%s%s\n" %
|
||||
(os.path.join(
|
||||
sysconfig.get_config_var("BINDIR"),
|
||||
"python" + sysconfig.get_config_var("EXE")),
|
||||
|
@@ -15,15 +15,13 @@ from distutils.errors import *
|
||||
|
||||
class register(Command):
|
||||
|
||||
description = "register the distribution with the repository"
|
||||
description = ("register the distribution with the Python package index")
|
||||
|
||||
DEFAULT_REPOSITORY = 'http://www.python.org/pypi'
|
||||
|
||||
user_options = [
|
||||
('repository=', 'r',
|
||||
"url of repository [default: %s]"%DEFAULT_REPOSITORY),
|
||||
('verify', None,
|
||||
'verify the package metadata for correctness'),
|
||||
('list-classifiers', None,
|
||||
'list the valid Trove classifiers'),
|
||||
('show-response', None,
|
||||
@@ -33,7 +31,6 @@ class register(Command):
|
||||
|
||||
def initialize_options(self):
|
||||
self.repository = None
|
||||
self.verify = 0
|
||||
self.show_response = 0
|
||||
self.list_classifiers = 0
|
||||
|
||||
@@ -43,7 +40,7 @@ class register(Command):
|
||||
|
||||
def run(self):
|
||||
self.check_metadata()
|
||||
if self.verify:
|
||||
if self.dry_run:
|
||||
self.verify_metadata()
|
||||
elif self.list_classifiers:
|
||||
self.classifiers()
|
||||
|
Reference in New Issue
Block a user