-
Notifications
You must be signed in to change notification settings - Fork 48
fix: enable python bytecode in the uv plugin #1406
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
base: main
Are you sure you want to change the base?
Conversation
f816b24 to
0737992
Compare
| venv_dir = str(self._get_venv_directory().resolve()) | ||
| return super().get_build_environment() | { | ||
| "VIRTUAL_ENV": venv_dir, | ||
| "UV_COMPILE_BYTECODE": "1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting, I had erroneously assumed this was the default
@lengau do you see any potential issues with this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any issues with it. I think the reason for not doing this was to match the fact that the python and poetry plugins don't compile bytecode either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the python plugin does this because pip does it by default? I might be mistaken though
|
|
||
| Bug fixes: | ||
|
|
||
| - The ``uv`` plugin now compiles Python bytecode. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the changelog entry. While this can be seen as a bug fix I think it might be more appropriate as a new (minor) feature? I see some potential, if unlikely, breakage if two different parts use the uv plugin (pyc files will very frequently conflict in stage)
We might also add a sentence saying that one can use UV_COMPILE_BYTECODE=0 to disable this behavior.
This brings the
uvplugin in line withpython(version 1 and 2) andpoetry.In snaps, launching python can still be slow by default because bytecode is not generated for the standard library when extracting
stage-packages.make lint && make test?docs/reference/changelog.rst)?