-
-
Notifications
You must be signed in to change notification settings - Fork 590
Issues with PYTHONPATH
resolution in recent python/rules_python versions
#1221
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
Comments
cc @htuch |
adding a shim - ie: import os
import sys
sys.path += [os.path.dirname(__file__)] works, and is what i have done to workaround, either in our py targets, or for py files in dep rules |
@phlax Can you elaborate on how you hooked that shim in? I think I'm currently running into this same issue. I'm on Things are working on my dev machine but during my automated build/tests in github actions I'm getting this (I have a python tool for running these tests which is why the logger prefix is present):
Not these lines in particular:
Can't figure out how to resolve this for the life of me. |
very hackily - see this PR for details https://github.com/envoyproxy/envoy/pull/25359/files seems to have survived a |
I expect this is resolved by https://github.com/aspect-build/rules_py because it doesn't mess with the PYTHONPATH, it just lays out a python-idiomatic virtualenv with a |
interesting we just landed a workaround to inject namespacing init pys to our repo folders to avoid pypi namespace clashing - seems like we could avoid that workaround - ill look further when i get chance |
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. |
this is still an issue |
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. |
Note, I deleted the stale bot :) |
Well, this is actually working as intended. the
So I'll close as won't do. The previous behaviour might have been due to The correct way to fix this would be to either wait until #2156 is resolved or add |
🐞 bug report
Affected Rule
The issue is caused by the rule:afaict ~any python rules but ive tested or hit the issue with
py_binary
,py_library
Is this a regression?
Yes, the previous version in which this bug was not present was: ....We had trouble upgrading to 0.19.x versions iirc due to this issue
We have been able to upgrade to 0.20.0 but when upgrading the python version to 3.11 the issue reappears
Description
A clear and concise description of the problem...Expected paths are not being added to
sys.path
🔬 Minimal Reproduction
🔥 Exception or Error
🌍 Your Environment
Operating System:
Output of
bazel version
:Rules_python version:
Anything else relevant?
Python version: 3.11
The text was updated successfully, but these errors were encountered: