feat: Support parsing pytest_plugins as a form of import.
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- python
- 領域
- build-system
調査の方向性
Start with the Gazelle plugin's dependency-scanning entry point and inspect how Python imports and existing gazelle:include_dep directives are handled. Extend the relevant parsing path to recognize valid string, list, and tuple pytest_plugins forms, then verify that each plugin import is added to deps using Gazelle's preferred label.
索引モデルが issue の本文から書いたものです。
説明
feature request
Pytest does not utilize normal imports for fixtures, instead in your conftest.py or test file you can declare a pytest_plugins global, like so:
# To import foo.bar.baz and foo.bar.qux as pytest plugins that expose fixtures.
pytest_plugins = ["foo.bar.baz", "foo.bar.qux"]
# OR
pytest_plugins = ("foo.bar.baz", "foo.bar.qux")
# OR, to import only one item
pytest_plugins = "foo.bar.baz"
# No other formats are valid
This is, by pytest's standards, the intended way to import fixtures and extensions to the test engine, simply importing them is poorly supported and will not include transitive fixtures, nor properly rewrite asserts in the import.
pytest_plugins simply contains import paths and brings all fixtures and extensions in the import into scope.
Relevant Rules
Just the Gazelle plugin.
Description
This would be extending the Gazelle plugin to read pytest_plugins as a form of import, which should go in deps as normal.
Describe alternatives you've considered
Currently, we instead do this:
# gazelle:include_dep //tools/foo/tests:git_worktree,//tools/corporate_tool_utils/python/fixtures:put
pytest_plugins = ["tools.foo.tests.git_worktree", "tools.corporate_tool_utils.python.fixtures.put"]
This works fine, and is something we can lint for, but adds redundancy and can mismatch gazelle's preferred label for a dependency.
- 主要言語
- Starlark
- スター
- 688
- フォーク
- 723
- 平均マージ
- 1日 13時間
- マージ済み PR(30日)
- 43
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bazel-contrib/rules_python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
bazel-contrib/rules_python#4164 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
bazel-contrib/rules_python#3821 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
bazel-contrib/rules_python#4198 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Release 2.4.0オープンtype: release
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
bazel-contrib/rules_python#4175 · コメント 11 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 70/100
bazel-contrib/rules_python#4171 ·
メンテナーはふだん 1 日以内に返信
bazel-contrib/rules_python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
DaveGamble/cJSON#1094 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
trezor/trezor-firmware#7997 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
objectionary/eolang.sty#184 ·
-
bug good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
score-spec/docs#329 · コメント 1 件 ·