`runfiles` module name conflicts with PyCharm
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Bắt đầu bằng cách xác định package Python bazel-runfiles và các entry point đóng gói của nó. Xác nhận cách có thể expose implementation thông qua bazel_runfiles trong khi vẫn giữ runfiles làm proxy, sau đó kiểm tra rằng import được đề xuất tránh được xung đột với PyCharm mà không làm hỏng các user hiện tại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
🐞 bug report
Affected Rule
runfiles
Is this a regression?
No
Description
PyCharm's Python console adds some stuff to the import path including a runfiles module. So when users open a project that supports both Bazel and virtual environments using this console, they run into errors like
>>> import mytest
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Applications/PyCharm.app/Contents/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/tmp/PythonProject/mytest/__init__.py", line 1, in <module>
from runfiles import Runfiles
ImportError: cannot import name 'Runfiles' from 'runfiles' (/Applications/PyCharm.app/Contents/plugins/python-ce/helpers/pydev/runfiles.py)
There doesn't seem to be any way around this other than wrapping from runfiles import Runfiles in some try/except or similar, which is unfortunate.
What if we had the bazel-runfiles package ship its implementation in a bazel_runfiles module instead, with runfiles remaining and serving as a simple proxy? This would allow affected environments to use
from bazel_runfiles import Runfiles
which should avoid any naming conflicts.
- Ngôn ngữ chính
- Starlark
- Star
- 690
- Fork
- 722
- Merge trung bình
- 1 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 43
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của bazel-contrib/rules_python
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
bazel-contrib/rules_python#4164 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
bazel-contrib/rules_python#3821 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
bazel-contrib/rules_python#4196 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Release 2.4.0Đang mởtype: release
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
bazel-contrib/rules_python#4175 · 10 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
bazel-contrib/rules_python#4171 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của bazel-contrib/rules_python
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
gruntwork-io/boilerplate#329 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
freeCodeCamp/curriculum-helpers#607 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
PedestrianDynamics/pyFDS-Evac#326 ·
Maintainer thường phản hồi trong vòng 1 ngày