-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Compile code in run_setup #4816
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
Conversation
I had problems in the past with The documentation also mentions:
which might be problematic? |
Closing this for now, please feel free to reopen if we have evidence that this method:
|
@abravalheri yup, i think that's ok for now. i've been looking into the way exec/compile work in python, and will ask on the python mailinglist for input form devs. Two additional thoughts though:
|
Respectfully, I fail to see why calling Meanwhile, the broken traceback is a real usability problem. If you are not very familiar with setuptools, you will have no clue where the error could have come from (notice that the name of |
Hi @mcejp, I understand why they in principle should behave the same, however this is not what I have observed in the past via profiling. Could you please submit a profiling study showing that the times are similar? When using the Without the (relevant part emphasized in pink) (These results are a couple of years old, and in Python 3.8 which is not EoL so things may have changed) If we can obtain a better result and/or a reasonable explanation of why the profiling method is biased accompanied by a reviewed version, I would be happy to review it.
The documentation of |
I apologize @MarcinKonowalczyk for missing this comment. Regarding feature flags, I am a little reluctant to add more levers and knobs to setuptools as it is very complicated. We however recently introduced Regarding the |
Summary of changes
Closes #4815
exec(code, locals())
in gets a code string and then callscompile
internally. This PR adds an explicit compile step (as it is already the case in many other places in the codebase) which enables better filename and code hints in the printed traceback (see issue above).Old:
New:
Pull Request Checklist
newsfragments/
.(See documentation for details)