-
Notifications
You must be signed in to change notification settings - Fork 117
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
feat: Parse setup.cfg or equivalent to extract options that matter to skbuild #704
base: main
Are you sure you want to change the base?
Conversation
9d4125c
to
77302b5
Compare
PS: Does this need to work with Python 2.7? |
Not after #688. |
I'm guessing this doesn't work with |
I think it should. I think there's nothing specific in |
@henryiii you're right, this doesn't work for Also, can that be done in a future MR? |
The ideal way to do this I think is to use |
@henryiii is right, using something like: from setuptools.dist import Distribution # <-- setuptools needs to be imported first
from distutils.core import run_setup
if os.path.exists(setup_script):
dist = run_setup(setup_script, stop_after="init")
else:
dist = Distribution({"script_name": "%notset%", "script_args": []})
dist.parse_config_files()
# dist attributes have now be filled in by config files. Should do the trick... However note that people using (It may also not work 100% if people are trying hard to hack setuptools in their |
I would be very interested in following what you guys have in mind and see how it plays out. I have proposed a very similar change in the past for I previously mentioned "hacking" in |
What I'd like to achieve is the same behaviour as a The solution @abravalheri you suggest requires coding the logic to identify the Maybe I'll check again how |
You are probably looking for pep517.meta.load (I don't know how public this function is considered to be). The caveat is that this function does run part of the build process, specifically prepare_metadata_for_build_wheel. It is very heavy weight also...
Just assume |
This should provide the parsing of all config files supported by setuptools. It extracts only the ones that
skbuild
inspects at early stage in thesetup()
function.Close #591