Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Introduce pytest integration out of the box

オープン
#3,594 コメント 12 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
静か
技術スタック
python

調査の方向性

まず、#2094 のデフォルト PyPI hub 提案と、issue で言及されている既存の py_test、main_module、dependency declaration、version-marker の処理を確認します。完了条件は、discovery、dependency overrides と versions、optional dependencies、および out-of-the-box の 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分
マージ済み PR(30日)
38

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bazel-contrib/rules_python のほかの issue

bazel-contrib/rules_python の issue をすべて見る

似ている issue

Build System の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。