bazel-contrib / bazel-contrib/rules_python
Gazelle target generation (breaking) changed in 1.6.0
- Ngôn ngữ chính
- Starlark
- Star
- 688
- Fork
- 721
- Merge trung bình
- 15 giờ 7 phút
- Pull request đã merge (30 ngày)
- 76
Mô tả
# 🐞 bug report
### Affected Rule
`py_test`/`py_library` (and Gazelle, not a rule)
### Is this a regression?
I'd argue so 😓. https://github.com/bazel-contrib/rules_python/pull/2998 introduced the new behavior (released in 1.6.0).
(more details in description)
### Description
(Before I begin, please note I _like_ https://github.com/bazel-contrib/rules_python/pull/2998 as a change. I just don't like a seemingly breaking change without any warning or toggles or migration path).
I'm upgrading my work monorepo `rules_python` to the latest, version-by-version. `1.6.0` has apparently become a very hard stop on my journey, due to incompatible gazelle changes. At a high level this is because:
- After upgrade, `gazelle` is happy to add new targets, while leaving the old targets alone
- There's no way to emulate the old behavior. The closest is trying different `# gazelle:python_generation_mode`s to see what gives me a small (enough) diff
- There's no way to incrementally roll this out (e.g. the result is one mega-PR)
- Whereas the old way made it so you could cleverly solve import cycles (across multiple subdirs) the new way makes that challenging
- [conftest inclusion is a bit broken](https://github.com/bazel-contrib/rules_python/issues/3497)
## 🔬 Minimal Reproduction
(I'll try and work on a demo repo showing each of the bullet points above, bear with me)
## 🔥 Exception or Error
(N/A)
## 🌍 Your Environment
(N/A)
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách xem xét PR #2998 và hành vi của Gazelle với python_generation_mode, so sánh các target được tạo trước và sau khi nâng cấp lên 1.6.0. Sau đó, xây dựng bản tái hiện tối thiểu đã hứa xoay quanh py_test và py_library, rồi xác định lộ trình di chuyển hoặc fix có phạm vi giới hạn nào sẽ giải quyết việc tạo tăng dần, các chu kỳ import và việc đưa conftest vào như được nêu trong issue #3497.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- build-system
- Loại issue
- Lỗi
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100