bazel-contrib / bazel-contrib/rules_python

`pip.parse(python_version=)` should not be mandatory

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

描述

# 🐞 bug report

### Affected Rule

Bzlmod `pip.parse()`

### Is this a regression?

Yes, was not a problem in WORKSPACE.

### Description

The arg documentation says the following:
https://github.com/bazelbuild/rules_python/blob/711186f144af06b431bd416b2d742874de3a2dea/python/private/bzlmod/pip.bzl#L391-L398

It specifically describes `If not specified, then the default Python version (as set by the root module or rules_python) will be used`. So this attribute should be optional but currently is mandatory.

## 🔬 Minimal Reproduction

`pip.parse()` without `python_version`.

## 🔥 Exception or Error

```
ERROR: in tag at /MODULE.bazel:42:10, mandatory attribute python_version isn't being specified
```

## 🌍 Your Environment

**Operating System:**

  

Linux

**Output of `bazel version`:**

  

2024/01/19 15:28:42 Warning: used fallback version "6.3.2"
Bazelisk version: v1.19.0
INFO: Running bazel wrapper (see //tools/bazel for details), bazel version 6.1.2 will be used instead of system-wide bazel installation.
Build label: 6.1.2
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Apr 18 15:29:54 2023 (1681831794)
Build timestamp: 1681831794
Build timestamp as int: 1681831794

**Rules_python version:**

  

0.27.1

**Anything else relevant?**

贡献指南

打开贡献指南

调研方向

阅读 python/private/bzlmod/pip.bzl 中第 391-398 行附近关于文档所述 python_version 属性的内容。使用不带 python_version 的 pip.parse() 重现最小 MODULE.bazel 调用,然后验证该调用成功,并使用文档所述的默认 Python 版本。

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

评估

技术栈
python
领域
build-system
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
描述清楚
新手友好度
50/100

把新 issue 发到你的邮箱

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