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

Aperta
#378 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@RaphaelFakhri ci sta già lavorando.

Dal 5/11/2026.

  • #379 di @RaphaelFakhri — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
Python
Stelle
336
Fork
60
Merge medio
10m
PR unite (30g)
1

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di python-poetry/poetry-plugin-export

Tutte le issue di python-poetry/poetry-plugin-export

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.