bazel-contrib / bazel-contrib/rules_python

Allow specifying dependencies directly in `pip.parse`

未关闭
#2,271 6 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
type: feature request type: pip
主要语言
Starlark
星标
688
派生
721
平均合并
15 小时 7 分钟
30 天内合并 PR
76

描述

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

贡献指南

打开贡献指南

调研方向

首先定位 pip.parse() 扩展的实现,并阅读现有的 requirements_lock 参数是如何处理的。将提议的 requirements 列表语义与当前的 requirements.txt 解析路径进行比较;当直接的 Starlark 依赖字符串在简单情况下能够正常工作,并且相关测试覆盖新参数时,即可视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
build-system
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。