[pull] main from bazel-contrib:main#592
Merged
pull[bot] merged 1 commit intogarymm:mainfrom Apr 27, 2026
Merged
Conversation
Currently, the files from the data, headers, and scripts portions of a wheel don't end up in the proper sub-directories of the venv. This means the full files of a distribution aren't available at the typical location in the venv, making it harder to integrate with standard tools. To fix, simply map the directories to paths in the venv and give them similar treatment as site-packages. The spec says certain first-level directories of the `.data` directory map to specific scheme paths, which `whl_library` already handles. Here's a listing of the `wheel data directory -> install scheme path key -> whl_library directory` relationships * purelib -> purelib -> site-packages * platlib -> platlib -> site-packages * headers -> include -> include * scripts -> scripts -> bin * data -> data -> data Relevant reading: * Packaging specification: https://packaging.python.org/en/latest/specifications/binary-distribution-format * Posix install scheme paths: https://docs.python.org/3/library/sysconfig.html#posix-prefix * Windows install scheme paths: https://docs.python.org/3/library/sysconfig.html#nt The whl_library rule uses posix names for extracting. When materialized into a binary's venv, platform specific names are used: * bin -> (posix) bin; (Windows) Scripts * include -> (posix) include; (Windows) Include (capital i) * data -> venv root directory Along the way ... * The data files (files under the "data" scheme of a whl) are now always included as part of depending on the library. They would be in included in venv_site_packages=yes mode, so this better aligns behavior of the two modes. * Rename `is_venv_site_packages` to `_is_venv_site_packages_yes` to better represent the purpose and visibility of it. * Make whl_from_dir support Windows. Testing of venvs relies on using it for testing various special cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )