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

Abierto
#378 0 comentarios 0 reacciones 0 asignados Ver en GitHub

@RaphaelFakhri ya está trabajando en esto.

Desde el 5/11/2026.

  • #379 de @RaphaelFakhri — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
python

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
Python
Estrellas
336
Forks
60
Merge medio
10 min
PR fusionados (30 d)
1

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de python-poetry/poetry-plugin-export

Todos los issues de python-poetry/poetry-plugin-export

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.