bazel-contrib / bazel-contrib/rules_python
Introduce pytest integration out of the box
- Lenguaje dominante
- Starlark
- Estrellas
- 688
- Forks
- 721
- Merge medio
- 15 h 7 min
- PR fusionados (30 d)
- 76
Descripción
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?
Guía de contribución
Línea de trabajo
Comienza revisando la propuesta del hub de PyPI predeterminado en #2094 y el manejo existente de py_test, main_module, dependency declaration y version-marker mencionado en el issue. El trabajo se considera terminado cuando exista un diseño resuelto para el descubrimiento, las anulaciones de dependencias y las versiones, las dependencias opcionales y el flujo de trabajo de pytest out of the box.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- build-system, testing
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Tranquilo
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 30/100