Introduce pytest integration out of the box
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 30/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 冷清
- 技术栈
- python
- 领域
- build-system, testing
调研方向
首先审查 #2094 中的默认 PyPI hub 提案,以及 issue 中提到的现有 py_test、main_module、dependency declaration 和 version-marker 处理方式。完成的要求是为 discovery、dependency overrides 和 versions、optional dependencies 以及开箱即用的 pytest workflow 确定设计。
由索引模型根据 Issue 内容生成。
描述
Currently users need to know about pytest-bazel or other ways to integrate rules_python with bazel.
Ideally the discovery and onboarding of new users should be as easy as we can make it to be without making rules_python unclude everything and the kitchen sink.
Some ideas how we could do this:
- Implement the default pypi hub idea #2094
- pre-declare the pytest and pytest-bazel dependencies, where we would generate entries in the hub repo with aliases. Maybe we could define a particular default version for everything to work out of the box.
- create a pytest_test rule where we are using the declared deps.
- the users can override the pytest and other included deps.
- use the main_module attribute to launch pytest-bazel. If pytest is not there users would get an error that it could not be imported.
Open questions:
- can we default to pytest-bazel in all py_test invocations if there is no main or main_module defined?
- Is "pypi" a good name to reserve as the default hub repo? How does the predeclaring work? We just accept the same args as whl_library but all optional?
- Who can pre-declare deps and if multiple versions are declared, which one do we chose? We have version marker parsing in rules_python and we can even do resolution based on version ranges, e.g. users declare that they need pytest 7.1 or above and we get the lowest available version that satisfies the conditions. We can also do this by python version since we have marker expression evaluation support.
- How to handle sharding related optional dependencies?
- How to handle other features that may require extra plugins?
Design goals
- no overhead in the number of targets, hence usage of main_module.
- little maintenance in rules_python.
- better out of the box experience. How would the users discover the feature?
- 主要语言
- Starlark
- 星标
- 690
- 派生
- 722
- 平均合并
- 1 天 55 分钟
- 30 天内合并 PR
- 38
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bazel-contrib/rules_python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
bazel-contrib/rules_python#4179 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
bazel-contrib/rules_python#4164 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
bazel-contrib/rules_python#3821 ·
-
难度 3/5 1-2 天 新手友好度 45/100
bazel-contrib/rules_python#4181 ·
-
Release 2.4.0 未关闭type: release
难度 4/5 3-5 天 新手友好度 25/100
bazel-contrib/rules_python#4175 · 3 条评论 ·
查看 bazel-contrib/rules_python 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 90/100
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
typelevel/sbt-typelevel#929 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
openSUSE/python-rpm-macros#219 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 1/5 1 小时以内 新手友好度 90/100
Qiskit/mcp-servers#221 ·