def out_of_date(extensions):
"""
Check whether any pyx source is newer than the corresponding generated
C source or whether any C source is missing.
"""
for extension in extensions:
for pyx in extension.sources:
path, ext = os.path.splitext(pyx)
if ext not in ('.pyx', '.py'):
continue
if extension.language == 'c++':
csource = path + '.cpp'
else:
csource = path + '.c'
# When comparing modification times, allow five seconds slack:
# If the installation is being run from pip, modification
# times are not preserved and therefore depends on the order in
# which files were unpacked.
if not os.path.exists(csource) or (
os.path.getmtime(pyx) > os.path.getmtime(csource) + 5):
return True
return False
python类run()的实例源码
def run(self):
if self.distribution.has_c_libraries():
_build_clib = self.get_finalized_command('build_clib')
self.include_dirs.append(
os.path.join(_build_clib.build_clib, 'include'),
)
self.include_dirs.extend(_build_clib.build_flags['include_dirs'])
self.library_dirs.append(
os.path.join(_build_clib.build_clib, 'lib'),
)
self.library_dirs.extend(_build_clib.build_flags['library_dirs'])
self.define = _build_clib.build_flags['define']
return _build_ext.run(self)
def run(self):
try:
build_ext.run(self)
except Exception as e:
self._unavailable(e)
self.extensions = [] # avoid copying missing files (it would fail).
def run(self):
try:
self._setup_extensions()
build_ext.run(self)
except DistutilsPlatformError as exc:
sys.stderr.write('%s\n' % str(exc))
warnings.warn(self.error_message % "C extensions.")
def run(self):
try:
build_ext.run(self)
except (DistutilsPlatformError, FileNotFoundError):
raise BuildFailed()
def run(self):
from Cython.Build import cythonize
compiler_directives = {}
if linetrace:
compiler_directives['linetrace'] = True
self.extensions = cythonize(self.extensions, compiler_directives=compiler_directives)
_build_ext.run(self)
run_setup(os.path.join(os.getcwd(), "setup.py"),
['build_py'] + extra_args)
def run(self):
try:
build_ext.run(self)
except DistutilsPlatformError:
raise BuildError()
def run(self):
os.system('rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info ./target; py.cleanup -d')
def run(self):
build_py.run(self)
build_yosai_libauthz(os.path.join(self.build_lib, *PACKAGE.split('.')))
def run(self):
build_ext.run(self)
if self.inplace:
build_py = self.get_finalized_command('build_py')
build_yosai_libauthz(build_py.get_package_dir(PACKAGE))
def run(self):
try:
build_ext.run(self)
except DistutilsPlatformError:
raise BuildExtFailed()
def run(self):
try:
build_ext.run(self)
except DistutilsPlatformError:
raise BuildExtFailed()
def run(self):
try:
build_ext.run(self)
except DistutilsPlatformError:
raise BuildFailed()
def run(self):
import sys, subprocess
raise SystemExit(
subprocess.call([sys.executable,
# Turn on deprecation warnings
'-Wd',
'simplejson/tests/__init__.py']))
def run(self):
try:
build_ext.run(self)
except (DistutilsPlatformError, FileNotFoundError):
raise BuildFailed()
def run(self):
try:
build_ext.run(self)
except DistutilsPlatformError:
traceback.print_exc()
raise BuildFailed()
def run(self):
# If we encounter a PKG-INFO file, then this is likely a .tar.gz/.zip
# file retrieved from PyPI that already includes the pre-cythonized
# extension modules, and then we do not need to run cythonize().
if os.path.exists('PKG-INFO'):
no_cythonize(extensions)
else:
# Otherwise, this is a 'developer copy' of the code, and then the
# only sensible thing is to require Cython to be installed.
check_cython_version()
from Cython.Build import cythonize
self.extensions = cythonize(self.extensions)
_build_ext.run(self)
def run(self):
# Make sure the compiled Cython files in the distribution are up-to-date
from Cython.Build import cythonize
check_cython_version()
cythonize(extensions)
versioneer_sdist.run(self)
def run(self):
try:
build_ext.run(self)
except DistutilsPlatformError:
raise BuildExtFailed()
def run(self):
try:
build_ext.run(self)
except (DistutilsPlatformError, FileNotFoundError):
raise BuildFailed()
def run(self):
try:
build_ext.run(self)
except Exception:
e = sys.exc_info()[1]
sys.stdout.write('%s\n' % str(e))
warnings.warn(self.warning_message % ("Extension modules",
"There was an issue with "
"your platform configuration"
" - see above."))
def run(self):
try:
build_ext.run(self)
except DistutilsPlatformError:
raise BuildFailed()
def run(self):
try:
build_ext.run(self)
except Exception:
e = sys.exc_info()[1]
sys.stdout.write('%s\n' % str(e))
warnings.warn(self.warning_message % ("Extension modules",
"There was an issue with "
"your platform configuration"
" - see above."))
def run(self):
# Disabling parallel build for now. It causes issues on multiple
# platforms with concurrent file access causing odd build errors
#self.parallel = multiprocessing.cpu_count()
build_ext.run(self)
def run(self):
try:
build_ext.run(self)
except Exception:
e = sys.exc_info()[1]
sys.stdout.write('%s\n' % str(e))
warnings.warn(self.warning_message % ("Extension modules",
"There was an issue with "
"your platform configuration"
" - see above."))
def run(self):
try:
build_ext.run(self)
except Exception:
e = sys.exc_info()[1]
sys.stdout.write("%s\n" % (str(e),))
warnings.warn(self.warning_message % ("Extension modules",
"There was an issue with "
"your platform configuration"
" - see above."))
def run(self):
try:
build_ext.run(self)
except Exception:
e = sys.exc_info()[1]
sys.stdout.write('%s\n' % str(e))
warnings.warn(self.warning_message % ("Extension modules",
"There was an issue with "
"your platform configuration"
" - see above."))
def run(self):
# Ensure library has been downloaded (sdist might have been skipped)
download_library(self)
_egg_info.run(self)
def run(self):
download_library(self)
_sdist.run(self)
def run(self):
download_library(self)
_bdist_wheel.run(self)