Skip to content
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

[Bug]: Dependencies missing from py_venv #255

Closed
RyanDraves opened this issue Feb 7, 2024 · 1 comment
Closed

[Bug]: Dependencies missing from py_venv #255

RyanDraves opened this issue Feb 7, 2024 · 1 comment
Labels
bug Something isn't working untriaged Requires traige

Comments

@RyanDraves
Copy link

RyanDraves commented Feb 7, 2024

What happened?

When creating a venv with the py_venv rule, none of the libraries installed with pip are exported.

Version

Development (host) and target OS/architectures: Ubuntu x86_64

Output of bazel --version: bazel 7.0.0

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file: aspect_rules_py = 0.5.0 or HEAD, rules_python = 0.29.0

Language(s) and/or frameworks involved:
Python

How to reproduce

Minimal example:

MODULE.bazel:

bazel_dep(name = "aspect_rules_py", version = "0.5.0")

bazel_dep(name = "rules_python", version = "0.29.0")

python = use_extension("@rules_python//python/extensions:python.bzl", "python")

python.toolchain(
    python_version = "3.10",
    is_default = True,
)

use_repo(python, "python_versions")

register_toolchains("@python_versions//:all")

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")

pip.parse(
    hub_name = "pip",
    python_version = "3.10",
    requirements_lock = "//:requirements_lock.txt",
)

use_repo(pip, "pip")

requirements_lock.txt:

pyserial==3.5 \
    --hash=sha256:3c77e014170dfffbd816e6ffc205e9842efb10be9f58ec16d3e8675b4925cddb \
    --hash=sha256:c4451db6ba391ca6ca299fb3ec7bae67a5c55dde170964c7a14ceefec02f2cf0
    # via -r requirements.txt

BUILD:

load("@aspect_rules_py//py:defs.bzl", "py_venv")
load("@pip//:requirements.bzl", "all_requirements")

py_venv(
    name = "venv",
    deps = all_requirements,
)

Commands:

  • bazel run //:venv
  • .venv/bin/python
    • import serial (or inspect .venv and see that pyserial is missing)

Any other information?

No response

@RyanDraves RyanDraves added the bug Something isn't working label Feb 7, 2024
@github-actions github-actions bot added the untriaged Requires traige label Feb 7, 2024
@mattem
Copy link
Collaborator

mattem commented Feb 7, 2024

This is the same as #248

@mattem mattem closed this as not planned Won't fix, can't repro, duplicate, stale Feb 7, 2024
@github-project-automation github-project-automation bot moved this to ✅ Done in Open Source Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged Requires traige
Projects
Status: Done
Development

No branches or pull requests

2 participants