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

Đang mở
#378 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

@RaphaelFakhri đang làm issue này rồi.

Từ ngày 5/11/2026.

  • #379 của @RaphaelFakhri — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
backend, build-system

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Python
Star
336
Fork
60
Merge trung bình
10 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của python-poetry/poetry-plugin-export

Tất cả issue của python-poetry/poetry-plugin-export

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.