Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3122ee5

Browse files
committed
BUG: setuptools does not run install_clib automatically -- run it manually in install_data, if setuptools is present (fix #1194)
1 parent afbe79a commit 3122ee5

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

numpy/distutils/command/install.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010

1111
class install(old_install):
1212

13-
# Always run install_clib - the command is cheap, so no need to bypass it
14-
sub_commands = old_install.sub_commands + [('install_clib', lambda x: True)]
13+
# Always run install_clib - the command is cheap, so no need to bypass it;
14+
# but it's not run by setuptools -- so it's run again in install_data
15+
sub_commands = old_install.sub_commands + [
16+
('install_clib', lambda x: True)
17+
]
1518

1619
def finalize_options (self):
1720
old_install.finalize_options(self)

numpy/distutils/command/install_data.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1+
import sys
2+
have_setuptools = ('setuptools' in sys.modules)
3+
14
from distutils.command.install_data import install_data as old_install_data
25

36
#data installer with improved intelligence over distutils
47
#data files are copied into the project directory instead
58
#of willy-nilly
69
class install_data (old_install_data):
710

11+
def run(self):
12+
old_install_data.run(self)
13+
14+
if have_setuptools:
15+
# Run install_clib again, since setuptools does not run sub-commands
16+
# of install automatically
17+
self.run_command('install_clib')
18+
819
def finalize_options (self):
920
self.set_undefined_options('install',
1021
('install_lib', 'install_dir'),

0 commit comments

Comments
 (0)