-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Switch default pip install compile option to False
#12920
Comments
As opt-in tools, |
I understand this reasoning pre-Python 3.8, but can't users now set the path of where they want their pyc cache to be: https://docs.python.org/3/using/cmdline.html#envvar-PYTHONPYCACHEPREFIX ? |
I suspect the number of users who do this is vanishingly small. The key question here is whether we want to optimise the experience for inexperienced users or for experts. And I think it's fair to say that because pip is bundled with CPython, all of the inexperienced Python users will be using pip. You pretty much have to be an experienced user in the first place to be using Maybe defaulting to |
This is a fair point about experienced vs inexperienced. Though, at least anecdotally, I don't think even most experienced users realise that pip compiles Python files by default. Going back to the user experience topic (#12712) I think it would make sense to be make it clear pip is "installing and compiling" when compile is
I would personally be against this as:
|
I’d say it feels like showing a message (or even a progress bar) for the compilation phase would be a good idea. If the user notices it’s slow, they would try to look for (and be able to find) the way to disable it. |
Great, I think there’s a consensus is reached here, I don't want to keep this issue open for the sake of it. If someone else asks about compiling by default they can be pointed back here, or they can propose why things in the future have changed and it should be reconsidered. |
What's the problem this feature will solve?
Upon investigating install performance sometimes compiling of Python files takes up a significant amount of the time.
Describe the solution you'd like
Switch the default pip install option from
True
toFalse
, users who still need it can use--compile
CLI, config, or env variables. But users who don't need it will save time, CPU, and disk space.Alternative Solutions
My initial idea was to use
compile_dir
multiprocess capability, but on running benchmarks I found the time save to be very platform specific. On Linux you only need to be compiling ~15 average Python files to see a statistically significant improvement in time, but on Windows you need ~200 average Python files to see a statistically significant improvement in time.Even then, while it would save time it would not save CPU or disk space.
Additional context
This is already the default behaviour of both uv and poetry (see
--compile
).But there may be some history to why pip makes this the default behaviour that I am not aware of.
Code of Conduct
The text was updated successfully, but these errors were encountered: