mirror of
https://github.com/python/cpython.git
synced 2025-07-22 18:55:22 +00:00
Added '--force' option -- very clear what it means for building (ignore
timestamps), so every build_* command has 'self.force', which follows the 'build' command if not set by the user.
This commit is contained in:
parent
68a0757e23
commit
c41d6b35a9
4 changed files with 21 additions and 3 deletions
|
@ -28,6 +28,8 @@ class build (Command):
|
||||||
"temporary build directory"),
|
"temporary build directory"),
|
||||||
('debug', 'g',
|
('debug', 'g',
|
||||||
"compile extensions and libraries with debugging information"),
|
"compile extensions and libraries with debugging information"),
|
||||||
|
('force', 'f',
|
||||||
|
"forcibly build everything (ignore file timestamps"),
|
||||||
]
|
]
|
||||||
|
|
||||||
def initialize_options (self):
|
def initialize_options (self):
|
||||||
|
@ -39,9 +41,12 @@ class build (Command):
|
||||||
self.build_lib = None
|
self.build_lib = None
|
||||||
self.build_temp = None
|
self.build_temp = None
|
||||||
self.debug = None
|
self.debug = None
|
||||||
|
self.force = 0
|
||||||
|
|
||||||
def finalize_options (self):
|
def finalize_options (self):
|
||||||
|
|
||||||
|
print "build.finalize: force=%s" % self.force
|
||||||
|
|
||||||
# Need this to name platform-specific directories, but sys.platform
|
# Need this to name platform-specific directories, but sys.platform
|
||||||
# is not enough -- it only names the OS and version, not the
|
# is not enough -- it only names the OS and version, not the
|
||||||
# hardware architecture!
|
# hardware architecture!
|
||||||
|
|
|
@ -37,6 +37,8 @@ class build_clib (Command):
|
||||||
"directory to put temporary build by-products"),
|
"directory to put temporary build by-products"),
|
||||||
('debug', 'g',
|
('debug', 'g',
|
||||||
"compile with debugging information"),
|
"compile with debugging information"),
|
||||||
|
('force', 'f',
|
||||||
|
"forcibly build everything (ignore file timestamps"),
|
||||||
]
|
]
|
||||||
|
|
||||||
def initialize_options (self):
|
def initialize_options (self):
|
||||||
|
@ -51,6 +53,7 @@ class build_clib (Command):
|
||||||
self.define = None
|
self.define = None
|
||||||
self.undef = None
|
self.undef = None
|
||||||
self.debug = None
|
self.debug = None
|
||||||
|
self.force = 0
|
||||||
|
|
||||||
# initialize_options()
|
# initialize_options()
|
||||||
|
|
||||||
|
@ -65,7 +68,8 @@ class build_clib (Command):
|
||||||
self.set_undefined_options ('build',
|
self.set_undefined_options ('build',
|
||||||
('build_temp', 'build_clib'),
|
('build_temp', 'build_clib'),
|
||||||
('build_temp', 'build_temp'),
|
('build_temp', 'build_temp'),
|
||||||
('debug', 'debug'))
|
('debug', 'debug'),
|
||||||
|
('force', 'force'))
|
||||||
|
|
||||||
self.libraries = self.distribution.libraries
|
self.libraries = self.distribution.libraries
|
||||||
if self.libraries:
|
if self.libraries:
|
||||||
|
|
|
@ -66,6 +66,8 @@ class build_ext (Command):
|
||||||
"extra explicit link objects to include in the link"),
|
"extra explicit link objects to include in the link"),
|
||||||
('debug', 'g',
|
('debug', 'g',
|
||||||
"compile/link with debugging information"),
|
"compile/link with debugging information"),
|
||||||
|
('force', 'f',
|
||||||
|
"forcibly build everything (ignore file timestamps"),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -84,6 +86,7 @@ class build_ext (Command):
|
||||||
self.rpath = None
|
self.rpath = None
|
||||||
self.link_objects = None
|
self.link_objects = None
|
||||||
self.debug = None
|
self.debug = None
|
||||||
|
self.force = None
|
||||||
|
|
||||||
|
|
||||||
def finalize_options (self):
|
def finalize_options (self):
|
||||||
|
@ -92,7 +95,8 @@ class build_ext (Command):
|
||||||
self.set_undefined_options ('build',
|
self.set_undefined_options ('build',
|
||||||
('build_lib', 'build_lib'),
|
('build_lib', 'build_lib'),
|
||||||
('build_temp', 'build_temp'),
|
('build_temp', 'build_temp'),
|
||||||
('debug', 'debug'))
|
('debug', 'debug'),
|
||||||
|
('force', 'force'))
|
||||||
|
|
||||||
if self.package is None:
|
if self.package is None:
|
||||||
self.package = self.distribution.ext_package
|
self.package = self.distribution.ext_package
|
||||||
|
|
|
@ -20,6 +20,7 @@ class build_py (Command):
|
||||||
|
|
||||||
user_options = [
|
user_options = [
|
||||||
('build-lib=', 'd', "directory to \"build\" (copy) to"),
|
('build-lib=', 'd', "directory to \"build\" (copy) to"),
|
||||||
|
('force', 'f', "forcibly build everything (ignore file timestamps"),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,10 +29,14 @@ class build_py (Command):
|
||||||
self.modules = None
|
self.modules = None
|
||||||
self.package = None
|
self.package = None
|
||||||
self.package_dir = None
|
self.package_dir = None
|
||||||
|
self.force = None
|
||||||
|
|
||||||
def finalize_options (self):
|
def finalize_options (self):
|
||||||
|
print "build_py.finalize: force=%s" % self.force
|
||||||
self.set_undefined_options ('build',
|
self.set_undefined_options ('build',
|
||||||
('build_lib', 'build_lib'))
|
('build_lib', 'build_lib'),
|
||||||
|
('force', 'force'))
|
||||||
|
print "build_py.finalize: force=%s" % self.force
|
||||||
|
|
||||||
# Get the distribution options that are aliases for build_py
|
# Get the distribution options that are aliases for build_py
|
||||||
# options -- list of packages and list of modules.
|
# options -- list of packages and list of modules.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue