Bug: `setup.cfg` `install_requires` on the same line as the key is not read

未关闭 适合新手
#707 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
88/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python, typescript
领域
cli, devtools

调研方向

从 src/core-open/scanners/python-scanner.ts 中的 parseSetupCfg 开始,查看 install_requires 是如何被匹配的,以及每个条目如何传递给 parseRequirementLine。在现有测试旁添加或扩展 Python 清单测试,检查同一行、续行以及换行后缩进的形式,同时确认 python_requires 保持不变。完成标准是报告所有列出的包,并且现有形式仍然通过。

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

描述

bug good first issue
  • Difficulty: small
  • Area: Python scanner
Problem

parseSetupCfg in src/core-open/scanners/python-scanner.ts (around line 1148) only matches a multiline indented list:

const installReqMatch = optionsSection[1]!.match(/install_requires\s*=\s*\n((?:\s+.*\n?)*)/);

The regex requires a newline after =. These common forms are dropped:

[options]
install_requires = requests>=2.31, flask>=3.0
[options]
install_requires = requests>=2.31
    flask>=3.0

The already-supported form (value starts on the next line, one requirement per indented line) must keep working.

Expected behaviour

install_requires accepts a same-line list (comma-separated or a single requirement), a list that starts on the same line and continues with indented lines, and the current newline-then-indent form. Each entry is parsed with the existing parseRequirementLine helper.

Acceptance
  • Tests live next to other Python manifest tests (for example a new test/python-setup-cfg.test.ts, or cases in test/python-runtime-pin.test.ts).
  • install_requires = requests>=2.31 on one line reports requests.
  • A comma-separated same-line list reports every package.
  • A value that starts on the same line and continues with indented lines reports every package.
  • The current indented-only form still works.
  • python_requires on the same [options] section is unchanged.

主要语言
TypeScript
星标
4
派生
3
平均合并
1 天 22 小时
30 天内合并 PR
76

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

vibgrate/cli 的其他 Issue

查看 vibgrate/cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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