feat: Support parsing pytest_plugins as a form of import.
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- build-system
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Starlark
- Estrellas
- 688
- Forks
- 723
- Merge medio
- 1 d 13 h
- PR fusionados (30 d)
- 43
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bazel-contrib/rules_python
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
bazel-contrib/rules_python#4201 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
bazel-contrib/rules_python#4164 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
bazel-contrib/rules_python#3821 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
bazel-contrib/rules_python#4198 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Release 2.4.0Abiertotype: release
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
bazel-contrib/rules_python#4175 · 15 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de bazel-contrib/rules_python
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
Los mantenedores suelen responder en 1 día
-
area:ci kind:gate-defect
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
InauguralSystems/EigenScript#1448 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
dell/omnia#5425 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
mpfaffenberger/privateer_reimagined#657 ·
Los mantenedores suelen responder en 1 día
-
TS conversion
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
scylladb/nodejs-rs-driver#580 ·
Los mantenedores suelen responder en 2 días