New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] setuptools doesn't respect global distutils.cfg file for changing compiler #3681
Comments
Hi @eabase. At the moment, If you wish to pass arguments associated with the previous Nevertheless, you mentioned in your title that This is probably because Have you tried using |
Hi @abravalheri
No, that's not right because I already use the
Nope, and I never will.
Can you provide some examples for doing this? ConclusionI have no idea why the python build tools just doesn't include a |
Sorry, I missed that (The "own copy of distutils" behaviour is documented in https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html).
Please note that having
You can try
This is part of Meanwhile you can have a look on:
Setuptools is part of a community effort, not a commercial product or service. If you or other members of the community have a strong interest about a specific feature that is not implemented yet, the best way of making that reality is proposing an implementation plan and (after the plan has been discussed and agreed) submit a PR (or a series of PRs) with the implementation. |
Hello @abravalheri Thank you so much for taking the time to explain this in more detail and clarifying what's actually deprecated. 💯 It also explains why moving my
This is in fact one of the confusion points. Stating on the one hand that the use of a file is deprecated, while it's presence is not... ❗ Thanks again. ✨ |
Thanks @eabase. I added a few notes to clarify this behaviour in #3689.
At least this part we have covered in our docs 😄. |
@abravalheri 4 ways to use a different Compiler (on Windows)You want to specify the compiler in a config file. For example, to use the # setup.cfg
#----------------------------------------------
# This is a customized (global) distutils.cfg
# https://docs.python.org/3/install/index.html
#----------------------------------------------
# other locations (windows):
# local setup.cfg
# system prefix\Lib\distutils\distutils.cfg
# personal %HOME%\pydistutils.cfg
#----------------------------------------------
[global]
verbose=1
[build]
compiler=mingw32
force=1
[build_ext]
compiler=mingw32
force=1
Maybe even 5 with the following (not yet tested): python -m build -C--global-option=--no-user-cfg -C--global-option=--verbose -C--build-option="build --compiler=mingw32 --force" |
setuptools version
65.5.1
Python version
Python 3.10.0
OS
Win-10
Additional environment information
No response
Description
I have tried just about everything to try to make setuptools not use
python setup.py ...
to compile and install a C-built extension package.As you have elegantly stated (now for several years) that one should not use
python setup.py
:However, because
python -m build
ignores the.../Lib/distutils/distutils.cfg
file,there is no known way to avoid using the good old:
Expected behavior
I expect to be able to build my package using any compiler of my choice, like MinGW, by specifying this in the
python -m build
command.How to Reproduce
python -m build -n -w --config-setting="--compiler=mingw32"
Is ignored
Output
Always using MS Visual Studio VC....
The text was updated successfully, but these errors were encountered: