bazel-contrib / bazel-contrib/rules_python

Improve the `pip.parse` API to allow for incremental building of the configuration

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

描述

Currently the API for defining different parameters by target platform is not ideal and we need to jump over hoops whilst trying to maintain it. The main difficulties are:
* We would like to specify different `pip.parse` attributes per target platform, but we cannot, because some of the parameters need to be labels, label lists or other.
* We cannot have overrides for these things easily and the definitions of what those target platforms are are hard-coded in the code.

The idea that I have is to reuse the same recipe from #2578, where we create a builder for the configuration and it allows us easily define:
* default constraint and flag values for the config settings that we create for different platform variants.
* default values for the pip index url, etc
* default values for which platforms we should support.
* default `auth` configuration for the `bazel_downloader`.
* The list of `python_versions` that are supported #1708.
* build the configuration incrementally for the `pip.parse` invocation allowing per-target-platform configuration of:
* `extra_pip_args`. #2745
* `requirements_lock`.
* `constraint_values` and `flag_values`. #2548

What is more the `override` API could be blended in more easily to provide better support for specifying different, patches, etc.

TODO:
- [ ] Design `defaults` and `configure` APIs and use that to set the defaults within `rules_python` for selecting the whls.
- [ ] Do the same for `index_url` setting, at some point `rules_python` could set the default `index_url` to default to the new code path.
- [ ] Transition the current `pip.parse` to use `pip.configure` under the hood.
- [ ] Ensure people can ignore specific `whl_platform_tags` for a particular platform (and maybe even a particular whl).

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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