bazel-contrib / bazel-contrib/rules_python

Allow glob expression in experimental_requirement_cycles

Open
#2,255 8 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
Starlark
Stars
688
Forks
721
Avg merge
14h 49m
Merged PRs (30d)
81

Description

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

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.