python / python/pyperformance

Editable installation isn't working properly

未关闭
#319 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
1k
派生
203
平均合并
1 小时 20 分钟
30 天内合并 PR
2

描述

If pyperformance is installed as editable pip install -e . from the git repository, it doesn't work when invoked

$ /tmp/tmpdir/prefix/bin/python3 -u -m pyperformance                                        
ERROR: pyperformance should not be run without installing first                                                                         
(consider using the dev.py script)             

The check is done by is_installed() which calls both _is_dev() and _is_devel_install() which are both broken.

The function is_dev() bases the logic on the presence of setup.py which is long gone.

The function _is_devel_install() instead check the presence of pyperformance.egg-link in the site-packages.

In my installation I have:

  • pyperformance.egg-info directory in the git repository
  • __editable___pyperformance_1_0_9_finder.py, __editable__.pyperformance-1.0.9.pth, pyperformance-1.0.9.dist-info in the site-packages

I'm trying to invoke pyperformance using a dev instance via

python3.12 /work/oss/repos/pyperformance/dev.py compile_all benchmark.conf

and it will fail eventually:

2023-10-19 15:25:52,049: Building wheels for collected packages: pyperformance                                                                                                                                                                                                   
2023-10-19 15:25:52,050:   Building editable for pyperformance (pyproject.toml): started                                                                                                                                                                                         
2023-10-19 15:25:52,885:   Building editable for pyperformance (pyproject.toml): finished with status 'done'                                                                                                                                                                     
2023-10-19 15:25:52,888:   Created wheel for pyperformance: filename=pyperformance-1.0.9-0.editable-py3-none-any.whl size=6710 sha256=159fbc3f13ae47399e04d5f7cdf5e024c3652b2ed91096f8638844238e005c0d                                                                           
2023-10-19 15:25:52,888:   Stored in directory: /tmp/pip-ephem-wheel-cache-ubyuatck/wheels/0d/04/cb/add3bede8e376e8789c834f334f1834467606bde2625d5a4ad                                                                                                                           
2023-10-19 15:25:52,896: Successfully built pyperformance                                                                                                                                                                                                                        
2023-10-19 15:25:52,922: Installing collected packages: psutil, packaging, pyperf, pyperformance                                                                                                                                                                                 
2023-10-19 15:25:53,307: Successfully installed packaging-23.2 psutil-5.9.6 pyperf-2.6.1 pyperformance-1.0.9                                                                                                                                                                     
2023-10-19 15:25:53,437: + /tmp/tmpdir/prefix/bin/python3 -u -m pyperformance venv recreate --venv /tmp/tmpdir/venv --benchmarks '<NONE>'                                                                                                                                        
2023-10-19 15:25:53,514: ERROR: pyperformance should not be run without installing first                                                                                                                                                                                         
2023-10-19 15:25:53,515: (consider using the dev.py script)                                                                                                                                                                                                                      
2023-10-19 15:25:53,523: Command /tmp/tmpdir/prefix/bin/python3 -u -m pyperformance venv recreate --venv /tmp/tmpdir/venv --benchmarks '<NONE>' failed with exit code 1                                                                                                          
2023-10-19 15:25:53,565: Command /work/oss/ENTLLT-6897/venv3.12/bin/python -m pyperformance compile /work/oss/repos/ci-scripts/projects/python/benchmark.conf be5e8a010341c4d2d28ef53a1baed402ee06466e main --no-update --no-tune failed with exit code 11                       
2023-10-19 15:25:53,565: Benchmark exit code: 11                                                                                                                                                                                                                                 
2023-10-19 15:25:53,566: FAILED: main-be5e8a010341c4d2d28ef53a1baed402ee06466e 

贡献指南

这个仓库没有索引到贡献指南

从这里开始

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

调研方向

从 pyperformance/init.py 开始,重点查看 is_installed()、is_dev() 和 _is_devel_install(),然后检查 dev.py 如何创建并调用可编辑安装。使用 pip install -e .python -m pyperformance 重现该失败。可编辑安装通过安装检查,并且 dev.py 的编译流程能够成功调用 pyperformance,即表示完成。

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

评估

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

把新 issue 发到你的邮箱

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