Install test: wheel_modules and wheel_names ignore <dist>.data/purelib and platlib, which pip installs into site-packages

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

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
66/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python
Área
build-system

Línea de trabajo

Start with wheel_modules() and wheel_names() in scripts/build_lab.py, whose list comprehension skips every top-level .data folder, and with the WheelModules tests in tests/test_gap_wheels.py. Add one shared helper that maps <name>.data/purelib/REST and <name>.data/platlib/REST to REST, and check native_libraries() and has_libs_folder() in scripts/gap_wheels.py. Done when the new layout tests pass, scripts/headers stay ignored, and uvx --python 3.14 [email protected] passes offline.

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

Descripción

bug help wanted

The install test decides what to import from a wheel by reading its file names (wheel_modules() in scripts/build_lab.py), and decides whether a missing module is the wheel's own or a dependency's with wheel_names(). Both skip every top-level folder whose name ends in .data:

entries = [e for e in z.namelist() if not e.split("/", 1)[0].endswith((".dist-info", ".data"))]

But a wheel's <name>-<version>.data/purelib/ and .data/platlib/ folders are installed into site-packages, exactly like files at the wheel's root (the wheel spec's "data directory" section). A wheel that ships its package there looks empty to both helpers:

demo-1.0.data/platlib/demo/__init__.py
demo-1.0.data/platlib/demo/_speed.cpython-314-x86_64-linux-gnu.so
demo-1.0.dist-info/METADATA

wheel_modules() returns ([], [], 0): nothing to import and zero extension modules. The wheel's modules wouldn't be imported by the install test, or counted as the wheel's own when one is missing. #35 pinned today's behaviour in test_dist_info_and_data_folders_are_ignored_by_both and flagged it as wrong.

No published wheel is laid out this way today. Wheels built with some backends for some projects are, and the test that guards publishing shouldn't have a blind spot shaped like a wheel layout.

Where

scripts/build_lab.py: wheel_modules() and wheel_names(). Tests: WheelModules in tests/test_gap_wheels.py.

What to do

  • In both helpers, treat <anything>.data/purelib/REST and <anything>.data/platlib/REST as REST (strip the two leading parts), then apply the same rules as for root files. Other .data subfolders (scripts, headers, data) are not importable and stay ignored.
  • Share one small function for "the site-packages path of a wheel member, or None" between the two helpers, so they can't disagree.
  • native_libraries() and has_libs_folder() in scripts/gap_wheels.py read member names too. Check whether they need the same mapping and say what you found in the PR; change them only with a test.
  • This file is trusted pipeline code. Keep the change small and standard library only.

Done when:

  • Tests in WheelModules:
    • the layout above gives demo as a top module, demo._speed as an extension and a count of 1, from both platlib and purelib;
    • a wheel with the same module at the root and under platlib names it once;
    • demo-1.0.data/scripts/tool.py and demo-1.0.data/headers/x.h are still ignored;
    • wheel_names() lists the modules and packages under purelib/platlib.
  • test_dist_info_and_data_folders_are_ignored_by_both is updated to say what is still ignored.
  • In the PR, the one-line change that makes a new test fail.
  • uvx --python 3.14 [email protected] passes, offline.
Lenguaje dominante
Python
Estrellas
0
Forks
1
Merge medio
5 h 59 min
PR fusionados (30 d)
19

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 wheelgap/wheels

Todos los issues de wheelgap/wheels

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.