Bug: single-quoted strings in `pyproject.toml` are ignored
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 85/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python, typescript
- 领域
- cli, testing-qa
调研方向
从 src/core-open/scanners/python-scanner.ts 开始,阅读 parsePyprojectToml、appendPoetryDependencyTable 和现有的 collectQuotedStrings helper,了解扫描器如何处理两种引号风格。在 Python runtime 和 Poetry 测试旁添加回归用例,包括混合引号和两种 Poetry 形式。验收用例通过且现有的双引号行为保持不变时,即为完成。
由索引模型根据 Issue 内容生成。
描述
- Difficulty: small (a few hours)
- Area: Python scanner
Problem
parsePyprojectToml in src/core-open/scanners/python-scanner.ts only accepts double-quoted TOML strings for the project name, requires-python, and [project] dependencies:
# around lines 1032–1040
const nameMatch = content.match(/^\s*name\s*=\s*"([^"]+)"/m);
const pyVerMatch = content.match(/^\s*requires-python\s*=\s*"([^"]+)"/m);
# dependencies array: const lineRegex = /"([^"]+)"/g;
Poetry tables have the same limit (appendPoetryDependencyTable, around line 989): name = "version" and { version = "..." } match only "...".
Single quotes are valid TOML. A project written like this reports no runtime and no dependencies:
[project]
name = 'demo'
requires-python = '>=3.11'
dependencies = [
'requests>=2.31',
"flask>=3.0",
]
[project.optional-dependencies] and [dependency-groups] already go through collectQuotedStrings, which accepts both quote styles. Pipfile [requires] was fixed the same way. The [project] block and Poetry tables were not.
Expected behaviour
Single-quoted, double-quoted, and triple-quoted strings are read the same way in [project] and in Poetry dependency tables. A mixed array ('requests>=2.31' next to "flask>=3.0") keeps both packages. Existing double-quoted fixtures stay unchanged.
Acceptance
- Add tests next to the existing Python / Poetry cases (for example
test/python-runtime-pin.test.tsand the Poetry / optional-deps tests). requires-python = '>=3.11'reports Python 3.11 as the runtime.- A
[project] dependenciesarray of only single-quoted requirement strings exports those packages fromvg scan. - A mixed-quote array keeps every entry.
- Poetry
requests = '2.31.0'andrequests = { version = '2.31.0' }are read. - Double-quoted forms, and a project with no
requires-python, behave as they do today.
- 主要语言
- TypeScript
- 星标
- 4
- 派生
- 3
- 平均合并
- 1 天 22 小时
- 30 天内合并 PR
- 76
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
vibgrate/cli 的其他 Issue
-
documentation good first issue
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
相似的 Issue
-
area: documentation status: in progress type: documentation
难度 1/5 1 小时以内 新手友好度 76/100
Oddmash/oddmash-ui#222 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
appium/appium-wincore-driver#169 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
india-ultimate/hub#715 ·
维护者通常 1 天内回复
-
documentation Entwickler
难度 1/5 1 小时以内 新手友好度 89/100
维护者通常 1 天内回复