pylock.toml export drops wheels when the sdist sorts between wheels

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

@RaphaelFakhri 已经在做这个了。

开始于 2026年11月5日。

  • #379 来自 @RaphaelFakhri —— 未关闭

评估

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

调研方向

Inspect Exporter._export_pylock_toml and the grouping of package.files; the report identifies itertools.groupby and the dict comprehension as the failure path. Reproduce with ruamel.yaml.clib 0.2.14 and confirm the exported wheels array includes all 56 wheels. Check the issue’s linked pull request #379 for work already underway.

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

描述

poetry export --format pylock.toml can leave wheels out of packages.wheels.

Exporter._export_pylock_toml splits package.files into sdists and wheels with itertools.groupby. groupby only groups consecutive items, and the lock file sorts files by file name. If the sdist file name sorts between wheel file names, groupby returns two "wheel" groups. The dict comprehension keeps only the last group, so every wheel before the sdist is missing from the exported file.

This happens with real packages whose wheel file names use different name normalizations. For example, ruamel.yaml.clib 0.2.14 has these files on PyPI, in lock file order:

ruamel.yaml.clib-0.2.14-cp310-cp310-macosx_10_9_universal2.whl
... (54 wheels named ruamel.yaml.clib-*)
ruamel.yaml.clib-0.2.14.tar.gz
ruamel_yaml_clib-0.2.14-cp314-cp314-win_amd64.whl
... (2 wheels named ruamel_yaml_clib-*)

The exported pylock.toml lists only the last 2 wheels. Installers that use the file then fall back to building the sdist on every platform that the 54 dropped wheels cover.

Steps to reproduce

  1. Lock a project that depends on ruamel.yaml.clib==0.2.14 with lock file format 2.1.
  2. Run poetry export --format pylock.toml --output pylock.toml.
  3. Check the wheels array of the ruamel-yaml-clib package.

Expected: all 56 wheels from the lock file.
Actual: only the 2 ruamel_yaml_clib-* wheels.

Environment

  • poetry-plugin-export: main (cc06037), 1.10.1
  • Poetry: 2.5.1
主要语言
Python
星标
336
派生
60
平均合并
10 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

python-poetry/poetry-plugin-export 的其他 Issue

查看 python-poetry/poetry-plugin-export 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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