MCPcopy Create free account
hub / github.com/numpy/numpy / setuptools_run

Method setuptools_run

numpy/distutils/command/install.py:24–54  ·  view source on GitHub ↗

The setuptools version of the .run() method. We must pull in the entire code so we can override the level used in the _getframe() call since we wrap this call by one more level.

(self)

Source from the content-addressed store, hash-verified

22 self.install_lib = self.install_libbase
23
24 def setuptools_run(self):
25 """ The setuptools version of the .run() method.
26
27 We must pull in the entire code so we can override the level used in the
28 _getframe() call since we wrap this call by one more level.
29 """
30 from distutils.command.install import install as distutils_install
31
32 # Explicit request for old-style install? Just do it
33 if self.old_and_unmanageable or self.single_version_externally_managed:
34 return distutils_install.run(self)
35
36 # Attempt to detect whether we were called from setup() or by another
37 # command. If we were called by setup(), our caller will be the
38 # 'run_command' method in 'distutils.dist', and *its* caller will be
39 # the 'run_commands' method. If we were called any other way, our
40 # immediate caller *might* be 'run_command', but it won't have been
41 # called by 'run_commands'. This is slightly kludgy, but seems to
42 # work.
43 #
44 caller = sys._getframe(3)
45 caller_module = caller.f_globals.get('__name__', '')
46 caller_name = caller.f_code.co_name
47
48 if caller_module != 'distutils.dist' or caller_name!='run_commands':
49 # We weren't called from the command line or setup(), so we
50 # should run in backward-compatibility mode to support bdist_*
51 # commands.
52 distutils_install.run(self)
53 else:
54 self.do_egg_install()
55
56 def run(self):
57 if not have_setuptools:

Callers 1

runMethod · 0.95

Calls 2

runMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected