Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Python inspector fails to scan a PyBuilder project

未關閉
#238 5 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
python
領域
cli, tooling

研究方向

首先,針對連結的 pyinsp-pybuilder-test 專案執行 issue 中的 python-inspector 命令,並比較失敗的第一次執行與成功的第二次執行。檢查在相依性解析期間如何處理 setup.py 和 requirements.txt,特別是 setup.py 接收 --python-version 的位置。完成的標準是所回報的命令在第一次執行時就能成功,並產生預期的相依性輸出。

由索引模型根據 Issue 內容生成。

描述

Hi,
I was trying to scan a project that was created using PyBuilder and the scan failed with the following error:

python-inspector --python-version 311 --operating-system linux --json-pdt tmp.json --analyze-setup-py-insecurely --requirement requirements.txt --setup-py setup.py --verbose
Resolving dependencies...
Warning: unable to recognize setup provider in ~/Documents/pyinsp-pybuilder-test/setup.py: defaulting to 'distutils.core'.
pyb 0.13.10
PyBuilder version 0.13.10
Build started at 2025-07-30 12:20:02
------------------------------------------------------------
[INFO]  Building test version 0.1.dev (0.1.dev20250730102002)
[INFO]  Executing build in /Users/hodzic/Documents/pyinsp-pybuilder-test
[INFO]  Going to execute tasks: clean, install_build_dependencies, package
[INFO]  Removing target directory /Users/hodzic/Documents/pyinsp-pybuilder-test/target
[INFO]  Processing plugin packages 'pypandoc~=1.4' to be installed with {'upgrade': True}
[INFO]  Processing plugin packages 'setuptools>=38.6.0' to be installed with {}
[INFO]  Processing plugin packages 'twine>=1.15.0' to be installed with {'upgrade': True}
[INFO]  Processing plugin packages 'wheel>=0.34.0' to be installed with {}
[INFO]  Creating target 'build' VEnv in '/Users/hodzic/Documents/pyinsp-pybuilder-test/target/venv/build/cpython-3.11.11.final.0'
[INFO]  Creating target 'test' VEnv in '/Users/hodzic/Documents/pyinsp-pybuilder-test/target/venv/test/cpython-3.11.11.final.0'
[INFO]  Installing build dependencies
[INFO]  Building distribution in /Users/hodzic/Documents/pyinsp-pybuilder-test/target/dist/test-0.1.0
[INFO]  Copying scripts to /Users/hodzic/Documents/pyinsp-pybuilder-test/target/dist/test-0.1.0/scripts
[INFO]  Writing setup.py as /Users/hodzic/Documents/pyinsp-pybuilder-test/target/dist/test-0.1.0/setup.py
------------------------------------------------------------
BUILD SUCCESSFUL
------------------------------------------------------------
Build Summary
             Project: test
             Version: 0.1.dev (0.1.dev20250730102002)
      Base directory: ~/Documents/pyinsp-pybuilder-test
        Environments: 
               Tasks: clean [0 ms] prepare [10881 ms] install_build_dependencies [287 ms] compile_sources [0 ms] package [0 ms]
Build finished at 2025-07-30 12:20:13
Build took 11 seconds (11563 ms)
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: option --python-version not recognized

Have in mind second run with the same params was successful:

Resolving dependencies...
direct_dependencies:
 DependentPackage(purl='pkg:pypi/[email protected]', extracted_requirement='pybuilder==0.13.10', scope='install')
 DependentPackage(purl='pkg:pypi/[email protected]', extracted_requirement='pybuilder-pytest-coverage==1.1.2', scope='install')
environment: Environment(python_version='311', operating_system='linux')
repos:
 PypiSimpleRepository(index_url='https://pypi.org/simple', credentials=None)
versions:
  retrieved versions for package 'pybuilder-pytest-coverage'
  retrieved versions for package 'pybuilder'
dependencies:
  retrieved dependencies for requirement 'pkg:pypi/[email protected]'
  retrieved dependencies for requirement 'pkg:pypi/[email protected]'
retrieve package data from pypi:
  retrieved package 'pkg:pypi/[email protected]'
  retrieved package 'pkg:pypi/[email protected]'
  retrieved package 'pkg:pypi/[email protected]'
  retrieved package 'pkg:pypi/[email protected]'
  retrieved package 'pkg:pypi/[email protected]'
  retrieved package 'pkg:pypi/[email protected]'
  retrieved package 'pkg:pypi/[email protected]'
  retrieved package 'pkg:pypi/[email protected]'
  retrieved package 'pkg:pypi/[email protected]'
  retrieved package 'pkg:pypi/[email protected]'
  retrieved package 'pkg:pypi/coverage%5btoml%[email protected]'
done!

Any guidance as to why it fails the first time and how to overcome it? Thanks!

You can see the source code here: https://github.com/voidpetal/pyinsp-pybuilder-test

主要語言
Python
星號
23
分支
29
PR 合併指標
30 天內沒有已合併 PR

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

aboutcode-org/python-inspector 的其他 Issue

查看 aboutcode-org/python-inspector 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。