diff options
| author | Charles Harris <charlesr.harris@gmail.com> | 2020-12-20 16:35:37 -0700 |
|---|---|---|
| committer | Charles Harris <charlesr.harris@gmail.com> | 2020-12-27 12:57:19 -0700 |
| commit | 9b3f65096ee6bee277552da987ce296985baa96d (patch) | |
| tree | 7c17c07e24170829897d34f8588b9b4860f510b0 /setup.py | |
| parent | 11cba18268c04d43a56cca3635e49fce1e3a759e (diff) | |
| download | numpy-9b3f65096ee6bee277552da987ce296985baa96d.tar.gz | |
MAINT: Add dist_info to valid setup.py commands.
The follwing changes are made to 'setup.py'.
- Add 'dist_info' to the valid 'setup.py' commands. The 'dist_info'
command was added to setuptools in 2017 and we were following the
unrecognized command path in setup.py which raised a warning.
- Add 'version' to the recognized information commands, it came in with
the move to versioneer.
- Include the arguments passed to 'setup.py' when the unrecognized
command warning is raised. This will aid in maintaining the command
checks in the future.
Diffstat (limited to 'setup.py')
| -rwxr-xr-x | setup.py | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -240,7 +240,8 @@ def parse_setuppy_commands(): '--maintainer', '--maintainer-email', '--contact', '--contact-email', '--url', '--license', '--description', '--long-description', '--platforms', '--classifiers', - '--keywords', '--provides', '--requires', '--obsoletes'] + '--keywords', '--provides', '--requires', '--obsoletes', + 'version',] for command in info_commands: if command in args: @@ -251,8 +252,7 @@ def parse_setuppy_commands(): # below and not standalone. Hence they're not added to good_commands. good_commands = ('develop', 'sdist', 'build', 'build_ext', 'build_py', 'build_clib', 'build_scripts', 'bdist_wheel', 'bdist_rpm', - 'bdist_wininst', 'bdist_msi', 'bdist_mpkg', 'build_src', - 'version') + 'bdist_wininst', 'bdist_msi', 'bdist_mpkg', 'build_src',) for command in good_commands: if command in args: @@ -340,17 +340,13 @@ def parse_setuppy_commands(): # Commands that do more than print info, but also don't need Cython and # template parsing. - other_commands = ['egg_info', 'install_egg_info', 'rotate'] + other_commands = ['egg_info', 'install_egg_info', 'rotate', 'dist_info'] for command in other_commands: if command in args: return False # If we got here, we didn't detect what setup.py command was given - import warnings - warnings.warn("Unrecognized setuptools command, proceeding with " - "generating Cython sources and expanding templates", - stacklevel=2) - return True + raise RuntimeError("Unrecognized setuptools command: {}".format(args)) def get_docs_url(): @@ -416,7 +412,7 @@ def setup_package(): # Raise errors for unsupported commands, improve help output, etc. run_build = parse_setuppy_commands() - if run_build and 'version' not in sys.argv: + if run_build: # patches distutils, even though we don't use it #from setuptools import setup from numpy.distutils.core import setup |
