bazel-contrib / bazel-contrib/rules_python

Allow specifying dependencies directly in `pip.parse`

Abierto
#2,271 6 comentarios 1 reacción 0 asignados Ver en GitHub
type: feature request type: pip
Lenguaje dominante
Starlark
Estrellas
688
Forks
721
Merge medio
15 h 7 min
PR fusionados (30 d)
76

Descripción

# 🚀 feature request

### Relevant Rules

`pip.parse()` (not a rule, but the module extension tag)

### Description

Just putting this out there to gather feedback and see if it's worth implementing myself. I use Python as a pretty minor part of my polyglot Bazel codebase, and it has a single PyPI dependency. Call me petty, but I just don't like having to put that 1 dependency in its own `requirements.txt` file when all my other dependencies are listed directly in `MODULE.bazel`.

### Describe the solution you'd like

Is there any appetite for adding a new parameter to `pip.parse()` called `requirements` (as an alternative to `requirements_lock`) which is just a Starlark list of strings that get parsed as though they were the lines of a `requirements.txt` file? This would be kinda nice for really simple cases like mine, but perhaps "not recommended" for larger Python projects.

### Describe alternatives you've considered

Alternatives already exist, but if the maintainers would welcome a PR to this effect, then I can draft one up.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Start by locating the pip.parse() extension implementation and reading how its existing requirements_lock parameter is handled. Compare the proposed requirements list semantics with the current requirements.txt parsing path; done means direct Starlark dependency strings work for simple cases and the relevant tests cover the new parameter.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
build-system
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.