jvolkman / repairwheel

Repair any wheel, anywhere
MIT License
36 stars 2 forks source link

Cannot create a valid wheel for `cron_descriptor` after running it through `repairwheel` #13

Closed aignas closed 1 year ago

aignas commented 1 year ago

The output of the repairwheel CLI leaves me with 2 dist-info folders and multiple RECORD files.

See the diff between what I expect and what is written:

cron_descriptor-1.2.32.dist-info/top_level.txt                  cron_descriptor-1.2.32.dist-info/top_level.txt
cron_descriptor-1.2.32.dist-info/WHEEL                          cron_descriptor-1.2.32.dist-info/WHEEL
cron_descriptor-1.2.32.dist-info/LICENSE                        cron_descriptor-1.2.32.dist-info/LICENSE
cron_descriptor-1.2.32.dist-info/RECORD                         cron_descriptor-1.2.32.dist-info/RECORD
                                                           >    cron-descriptor-1.2.32.dist-info/RECORD
cron_descriptor-1.2.32.dist-info/METADATA                       cron_descriptor-1.2.32.dist-info/METADATA

Before passing the wheel to repair_info it already has the files on the left column and repair-wheel creates a new file.

A repro would be to:

#!/bin/bash
set -euxo pipefail

python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install repairwheel wheel

pip wheel cron_descriptor==1.2.32

rm -rf original repaired
mkdir original repaired
cp ./*.whl original
repairwheel ./*.whl -o repaired

diff -y --width=120 \
    <(unzip -l original/*.whl | grep dist-info | sort | awk '{print $4}') \
    <(unzip -l repaired/*.whl | grep dist-info | sort | awk '{print $4}')
jvolkman commented 1 year ago

Thanks. Looks like the issue is _ vs -. I'll try to figure out what the correct approach should be.

jvolkman commented 1 year ago

Thanks for the report @aignas. This should be fixed in 0.2.5.