diff options
author | mattip <matti.picus@gmail.com> | 2019-09-16 18:06:28 +0300 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2019-09-20 09:35:48 +0300 |
commit | cdf67fa06298ce7fd6ee909b7777dc77c0cfa49f (patch) | |
tree | 858fdad5037274e9ebcdaf677ebe707cf66b1f19 | |
parent | 55df75a9402a8b3550eedc243bcf24c0b785c52b (diff) | |
download | numpy-cdf67fa06298ce7fd6ee909b7777dc77c0cfa49f.tar.gz |
MAINT: move the option to build_src, simplifies logic
-rw-r--r-- | azure-pipelines.yml | 2 | ||||
-rw-r--r-- | numpy/distutils/command/build.py | 3 | ||||
-rw-r--r-- | numpy/distutils/command/build_src.py | 10 | ||||
-rwxr-xr-x | runtests.py | 4 | ||||
-rwxr-xr-x | tools/travis-test.sh | 4 |
5 files changed, 11 insertions, 12 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ab421ab21..a36f65faa 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -94,7 +94,7 @@ jobs: displayName: 'Check for unreachable code paths in Python modules' # prefer usage of clang over gcc proper # to match likely scenario on many user mac machines - - script: python setup.py build --debug-configure -j 4 install + - script: python setup.py build -j 4 build_src -v install displayName: 'Build NumPy' env: BLAS: None diff --git a/numpy/distutils/command/build.py b/numpy/distutils/command/build.py index e44f5c0c5..afc1d1477 100644 --- a/numpy/distutils/command/build.py +++ b/numpy/distutils/command/build.py @@ -16,8 +16,6 @@ class build(old_build): user_options = old_build.user_options + [ ('fcompiler=', None, "specify the Fortran compiler type"), - ('debug-configure', None, - "show compiler output while determining platform-specific flags") ] help_options = old_build.help_options + [ @@ -28,7 +26,6 @@ class build(old_build): def initialize_options(self): old_build.initialize_options(self) self.fcompiler = None - self.debug_configure = False def finalize_options(self): build_scripts = self.build_scripts diff --git a/numpy/distutils/command/build_src.py b/numpy/distutils/command/build_src.py index 22e2dbf52..664b52e37 100644 --- a/numpy/distutils/command/build_src.py +++ b/numpy/distutils/command/build_src.py @@ -53,9 +53,12 @@ class build_src(build_ext.build_ext): ('inplace', 'i', "ignore build-lib and put compiled extensions into the source " + "directory alongside your pure Python modules"), + ('verbose', 'v', + "change logging level from WARN to INFO which will show all " + + "compiler output") ] - boolean_options = ['force', 'inplace'] + boolean_options = ['force', 'inplace', 'verbose'] help_options = [] @@ -76,6 +79,7 @@ class build_src(build_ext.build_ext): self.swig_opts = None self.swig_cpp = None self.swig = None + self.verbose = False def finalize_options(self): self.set_undefined_options('build', @@ -366,9 +370,7 @@ class build_src(build_ext.build_ext): +name.split('.')[:-1])) self.mkpath(build_dir) - # it is unclear how to pass the cmdline options from build to here so - # "parse" the command line again - if '--debug-configure' in sys.argv: + if self.verbose: new_level = log.INFO else: new_level = log.WARN diff --git a/runtests.py b/runtests.py index b518ca724..d84dc8dac 100755 --- a/runtests.py +++ b/runtests.py @@ -68,7 +68,7 @@ def main(argv): parser.add_argument("--verbose", "-v", action="count", default=1, help="more verbosity") parser.add_argument("--debug-configure", action="store_true", - help="show all compiler output during system configuration") + help="add -v to build_src to show cconfiguration compiler output") parser.add_argument("--no-build", "-n", action="store_true", default=False, help="do not build the project (use system installed version)") parser.add_argument("--build-only", "-b", action="store_true", default=False, @@ -369,7 +369,7 @@ def build_project(args): if args.parallel > 1: cmd += ["-j", str(args.parallel)] if args.debug_configure: - cmd += ["--debug-configure"] + cmd += ["build_src", "--verbose"] # Install; avoid producing eggs so numpy can be imported from dst_dir. cmd += ['install', '--prefix=' + dst_dir, '--single-version-externally-managed', diff --git a/tools/travis-test.sh b/tools/travis-test.sh index 5b624eef1..1eda43c31 100755 --- a/tools/travis-test.sh +++ b/tools/travis-test.sh @@ -52,7 +52,7 @@ setup_base() else # Python3.5-dbg on travis seems to need this export CFLAGS=$CFLAGS" -Wno-maybe-uninitialized" - $PYTHON setup.py build --debug-configure build_ext --inplace 2>&1 | tee log + $PYTHON setup.py build build_src -v build_ext --inplace 2>&1 | tee log fi grep -v "_configtest" log \ | grep -vE "ld returned 1|no previously-included files matching|manifest_maker: standard file '-c'" \ @@ -151,7 +151,7 @@ if [ -n "$USE_WHEEL" ] && [ $# -eq 0 ]; then export F90='gfortran --coverage' export LDFLAGS='--coverage' fi - $PYTHON setup.py build --debug-configure bdist_wheel + $PYTHON setup.py build build_src -v bdist_wheel # Make another virtualenv to install into virtualenv --python=`which $PYTHON` venv-for-wheel . venv-for-wheel/bin/activate |