When I execute a command python setup.py install
or python setup.py develop
it would execute build_ext
command as one of the steps. How can I pass --debug
option to it as if it was invoked as python setup.py build_ext --debug
?
UPDATE
Here is a setup.py
very similar to mine:
https://github.com/pybind/cmake_example/blob/11a644072b12ad78352b6e6649db9dfe7f406676/setup.py#L43
I'd like to invoke python setup.py install
but turn debug
property in build_ext
class instance to 1.
To install a package that includes a setup.py file, open a command or terminal window and: cd into the root directory where setup.py is located. Enter: python setup.py install.
pip is a package manager, which can install, upgrade, list and uninstall packages, like familiar package managers including: dpkg, apt, yum, urpmi, ports etc. Under the hood, it will run python setup.py install , but with specific options to control how and where things end up installed. In summary: use pip .
package_dir = {'': 'lib'} in your setup script. The keys to this dictionary are package names, and an empty package name stands for the root package. The values are directory names relative to your distribution root.
A. If I am not mistaken, one could achieve that by adding the following to a setup.cfg
file alongside the setup.py
file:
[build_ext]
debug = 1
B.1. For more flexibility, I believe it should be possible to be explicit on the command line:
$ path/to/pythonX.Y setup.py build_ext --debug install
B.2. Also if I understood right it should be possible to define so-called aliases
# setup.cfg
[aliases]
release_install = build_ext install
debug_install = build_ext --debug install
$ path/to/pythonX.Y setup.py release_install
$ path/to/pythonX.Y setup.py debug_install
References
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With