Enhancement: parse `install_requires` and `python_requires` in `setup.py`
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 72/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python, typescript
调研方向
Start with the Python scanner in src/core-open/scanners/python-scanner.ts, especially PYTHON_MANIFEST_FILES and the scan loop around lines 1344–1363, then inspect nearby parser tests. Add coverage in test/python-setup-py.test.ts using literal setup.py inputs; never execute the file as Python. Done means literals are extracted with the stated precedence and optional dependency behavior, while dynamic values are skipped without failing the scan.
由索引模型根据 Issue 内容生成。
描述
- Difficulty: medium
- Area: Python scanner
Problem
setup.py is in PYTHON_MANIFEST_FILES (src/core-open/scanners/python-scanner.ts, around lines 1251–1260), so a directory that contains only setup.py is treated as a Python project. The scan loop (around lines 1344–1363) parses pyproject.toml, setup.cfg, Pipfile, and requirements files only. There is no parseSetupPy, and no test mentions setup.py as a dependency source.
A setuptools project that has not migrated to pyproject.toml / setup.cfg is discovered, then reported with no dependencies and no runtime, even when the file is a straightforward literal:
setup(
name="demo",
python_requires=">=3.11",
install_requires=[
"requests>=2.31",
"flask>=3.0",
],
extras_require={"dev": ["pytest>=7"]},
)
Do not execute setup.py.
Expected behaviour
A conservative, literal reader (regex / small AST of string lists only — no exec, no import of the project) extracts name, python_requires, install_requires, and optionally extras_require when they are string literals or lists of string literals, including the setuptools.setup(...) and from setuptools import setup forms. Dynamic values (install_requires=read_requirements(), computed lists) are skipped, not guessed. python_requires is a runtime fallback, with the same precedence as setup.cfg (pyproject.toml still wins when both exist). Extras are optionalDependencies. A package already in install_requires stays production.
Acceptance
- A
setup.py-only project with literalinstall_requiresandpython_requiresreports those packages and the Python runtime. extras_requireliterals are optional rows.- A
setup.pythat only builds its requirements dynamically reports no invented packages and does not fail the scan. pyproject.toml/setup.cfgin the same directory still win for name, runtime, and duplicate package sections.- Tests live in a new
test/python-setup-py.test.ts. Never run the file as Python.
- 主要语言
- 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 天内回复