Skip to content

dist-info symlinks are missing when using venvs_site_packagesΒ #2845

@emirisman

Description

@emirisman

🐞 bug report

Affected Rule

private/py_library.bzl

Is this a regression?

No, venvs_site_packages feature is new in 1.4.0-rc0 and later

Description

The dist-info folders are not symlinked to site-packages when using venvs_site_packages=yes
Using Bazel 7.6.1, bzlmod enabled but rules_python used via WORKSPACE, with the following settings:


--@rules_python//python/config_settings:venvs_site_packages=yes
--@rules_python//python/config_settings:bootstrap_impl=script

πŸ”¬ Minimal Reproduction

Using transformers package that checks its dependencies' versions using importlib.metadata, which depends on dist-info of the dependencies, leading to the error below:

πŸ”₯ Exception or Error


  File "[target].venv/lib/python3.11/site-packages/transformers/__init__.py", line 26, in 
    from . import dependency_versions_check
  File "[target].venv/lib/python3.11/site-packages/transformers/dependency_versions_check.py", line 57, in 
    require_version_core(deps[pkg])
  File "[target].venv/lib/python3.11/site-packages/transformers/utils/versions.py", line 117, in require_version_core
    return require_version(requirement, hint)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[target].venv/lib/python3.11/site-packages/transformers/utils/versions.py", line 104, in require_version
    raise importlib.metadata.PackageNotFoundError(
importlib.metadata.PackageNotFoundError: No package metadata was found for The 'tqdm>=4.27' distribution was not found and is required by this application. 
Try: `pip install transformers -U` or `pip install -e '.[dev]'` if you're working with git main

🌍 Your Environment

Operating System:

  
Ubuntu 22.04 LTS
  

Output of bazel version:

  
Bazelisk version: v1.26.0
Build label: 7.6.1
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Mon Mar 31 17:08:56 2025 (1743440936)
Build timestamp: 1743440936
Build timestamp as int: 1743440936
  

Rules_python version:

1.4.0-rc3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions