Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4beb0c2

Browse filesBrowse files
authored
MNT Make setup.py command parsing more robust (#19650)
Separate arguments into options and commands, and use setuptools.setup if all the requested commands can / should run without NumPy installed, even if there are options present. This fixes a bug where `setup.py --no-user-site egg_info` wants NumPy to be installed, even though `setup.py egg_info` works fine.
1 parent ad7c316 commit 4beb0c2
Copy full SHA for 4beb0c2

File tree

1 file changed

+3
-8
lines changed
Filter options

1 file changed

+3
-8
lines changed

‎setup.py

Copy file name to clipboardExpand all lines: setup.py
+3-8Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -266,14 +266,9 @@ def setup_package():
266266
package_data={'': ['*.pxd']},
267267
**extra_setuptools_args)
268268

269-
if len(sys.argv) == 1 or (
270-
len(sys.argv) >= 2 and ('--help' in sys.argv[1:] or
271-
sys.argv[1] in ('--help-commands',
272-
'egg_info',
273-
'dist_info',
274-
'--version',
275-
'clean',
276-
'check'))):
269+
commands = [arg for arg in sys.argv[1:] if not arg.startswith('-')]
270+
if all(command in ('egg_info', 'dist_info', 'clean', 'check')
271+
for command in commands):
277272
# These actions are required to succeed without Numpy for example when
278273
# pip is used to install Scikit-learn when Numpy is not yet present in
279274
# the system.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.