bazel-contrib / bazel-contrib/rules_python

Allow glob expression in experimental_requirement_cycles

未关闭
#2,255 8 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
help wanted
主要语言
Starlark
星标
688
派生
721
平均合并
15 小时 7 分钟
30 天内合并 PR
76

描述

Currently `pip_parse` supports a feature to "fix" cycles among third-party packages, for example:

```
pip_parse(
...
experimental_requirement_cycles = {
"airflow": [
"apache-airflow",
"apache-airflow-providers-common-sql",
"apache-airflow-providers-sqlite",
"apache-airflow-providers-ftp",
"apache-airflow-providers-http",
"apache-airflow-providers-imap",
],
},
)
```

However it's difficult to keep this list updated, as it needs to include both direct and transitive dependencies. For example ` apache-airflow-providers-common-io` appeared in the locked requirements for one of my clients, and that broke install with a surprising error message.

It would be better to write `"airflow": ["apache-airflow-providers-*"]` so that this is robust to whatever providers are installed. https://github.com/aspect-build/rules_js/blob/main/docs/npm_translate_lock.md#list_patches is an example of a similar repo rule in JS-land which supports globs. Note that bazel-lib provides the starlark glob implementation used there.

FYI @arrdem

贡献指南

打开贡献指南

调研方向

Start with the pip_parse implementation and its experimental_requirement_cycles handling. Compare the requested behavior with the list_patches glob support in rules_js and the bazel-lib Starlark glob implementation. Done means provider patterns such as apache-airflow-providers-* match the relevant direct and transitive requirements without requiring manual list updates.

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

评估

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

把新 issue 发到你的邮箱

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