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]: py_test venv building doesn't work with slash in the name #483

Open
keith opened this issue Dec 16, 2024 · 1 comment · May be fixed by #485
Open

[Bug]: py_test venv building doesn't work with slash in the name #483

keith opened this issue Dec 16, 2024 · 1 comment · May be fixed by #485
Labels
bug Something isn't working

Comments

@keith
Copy link
Contributor

keith commented Dec 16, 2024

What happened?

If you have a target like this:

py_test(
    name = "pytest_test/nested",
    srcs = [
        "foo_test.py",
        ":__test__",
    ],
    env_inherit = ["FOO"],
    imports = ["../.."],
    main = ":__test__.py",
    package_collisions = "warning",
    deps = [
        ":__test__",
        "@pypi_ftfy//:pkg",
        "@pypi_neptune//:pkg",
        "@pypi_pytest//:pkg",
    ],
)

Running this test works with rules_python and fails with rules_py with:

Error:   × Unable to run command:
  ├─▶ Unable to get full source dir path
  ╰─▶ No such file or directory (os error 2)

Version

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

Output of bazel --version: 7.4.0

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:

Language(s) and/or frameworks involved:

How to reproduce

Run the test modified on this branch: #484

Any other information?

No response

@keith keith added the bug Something isn't working label Dec 16, 2024
keith added a commit to keith/rules_py that referenced this issue Dec 16, 2024
@keith keith mentioned this issue Dec 16, 2024
@keith
Copy link
Contributor Author

keith commented Dec 16, 2024

adding some logging I bet the issue is that this path join:

"/home/ubuntu/.cache/bazel/_bazel_ubuntu/cbd66eedddd4d083f5e4d752aed24a45/sandbox/linux-sandbox/19/execroot/aspect_rules_py/bazel-out/k8-fastbuild/bin/examples/pytest/pytest_test/nested.runfiles/.pytest_test/nested.venv/lib/python3.9/site-packages" ::: "../../../../pypi_exceptiongroup/site-packages"

the second path is off by 1 ../ because of the target adding another level of nesting

keith added a commit to keith/rules_py that referenced this issue Dec 16, 2024
@keith keith linked a pull request Dec 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant