-
-
Notifications
You must be signed in to change notification settings - Fork 594
feat: data and pyi files in the venv #2936
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
This adds the necessary `.dist-info` files into the mix and should get us reasonably close to handling 99% of the cases. The expected differences from this and a `venv` built by `uv` would be: * Shared libraries are stored in `<package>.libs` in `uv` venvs. This can be achieved in `rules_python` by changing the `installer` settings in the `wheel_installer/wheel.py#unzip` function. * The `RECORD` files are excluded from the `venv`s for better cache hit rate in `bazel`, however I am not sure if we should do that for actual wheels that are downloaded from the internet. Tested: - [x] Building the `//docs` and manually checking the symlinks. - [ ] Unit tests Work towards bazel-contrib#2156
I am thinking I should also link other things passed as I think excluding anything outside |
I'll push some of the changes later but I have a hard time writing a test that would fullfill some of the requirements in the PR todo list. |
else: | ||
kind_map[entry.venv_path] = entry.link_to_path | ||
|
||
# We overwrite duplicates by design. The dependency closer to the |
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.
FYI, needed to invert the logic here to make it work with the test I had, maybe my test is wrong?
This adds the necessary
.dist-info
files into the mixand should get us reasonably close to handling 99% of the cases.
The expected differences from this and a
venv
built byuv
would be:<package>.libs
inuv
venvs. It seemsthat this happens if you install latest package versions (e.g. numpy) has
libraries in
numpy.libs
in the latest version.RECORD
files are excluded from thevenv
s for better cache hitrate in
bazel
, however I am not sure if we should do that for actualwheels that are downloaded from the internet.
Tested:
//docs
and manually checking the symlinks..pyi
files get included..dist_info
gets included.Work towards #2156