bazel-contrib / bazel-contrib/rules_python

Allow specifying dependencies directly in `pip.parse`

Open
#2,271 6 comments 1 reaction 0 assignees View on GitHub
type: feature request type: pip
Dominant language
Starlark
Stars
688
Forks
721
Avg merge
14h 49m
Merged PRs (30d)
81

Description

# 🚀 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.