delocate
delocate copied to clipboard
[delocate-addplat] `parse_wheel_filename` may return wrong package name
Describe the bug
The parse_wheel_filename
method that is involved in the CLI command delocate-addplat
returns the "canonical" package name as first output argument, i.e. underscores are replaced by dashes if any. This name is then used to defined where to find the dist-info
. However, the name that is actually used to prepend dist-info
is actually doing the contrary (using dashes in place of underscores), leading to failure.
To Reproduce
Here is an example of such a failure:
adding 'jiminy_py/viewer/panda3d/panda3d_widget.py'
adding 'jiminy_py-1.7.14.data/data/cmake/jiminyConfig.cmake'
adding 'jiminy_py-1.7.14.data/data/cmake/jiminyConfigVersion.cmake'
adding 'jiminy_py-1.7.14.dist-info/METADATA'
adding 'jiminy_py-1.7.14.dist-info/WHEEL'
adding 'jiminy_py-1.7.14.dist-info/entry_points.txt'
adding 'jiminy_py-1.7.14.dist-info/top_level.txt'
adding 'jiminy_py-1.7.14.dist-info/RECORD'
removing build/bdist.macosx-10.15-x86_64/wheel
[...]
Fixing: /Users/runner/work/jiminy/jiminy/build/pypi/dist/jiminy_py/jiminy_py-1.7.14-cp38-cp38-macosx_10_15_x86_64.whl
Copied to package .dylibs directory:
/Users/runner/work/jiminy/jiminy/install/lib/libboost_numpy38.dylib
/Users/runner/work/jiminy/jiminy/install/lib/libboost_python38.dylib
/Users/runner/work/jiminy/jiminy/install/lib/libeigenpy.dylib
/Users/runner/work/jiminy/jiminy/install/lib/libhpp-fcl.dylib
/Users/runner/work/jiminy/jiminy/install/lib/libpinocchio.2.6.7.dylib
[...]
Setting platform tags macosx_10_14_universal2 for wheel /Users/runner/work/jiminy/jiminy/build/wheelhouse/jiminy_py-1.7.14-cp38-cp38-macosx_10_15_x86_64.whl
Traceback (most recent call last):
File "/Users/runner/hostedtoolcache/Python/3.8.16/x64/bin/delocate-addplat", line 8, in <module>
sys.exit(main())
File "/Users/runner/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/delocate/cmd/delocate_addplat.py", line 147, in main
fname = add_platforms(
File "/Users/runner/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/delocate/wheeltools.py", line 230, in add_platforms
info = read_pkg_info(info_fname)
File "/Users/runner/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/delocate/pkginfo.py", line 22, in read_pkg_info
with open(path, encoding="utf-8") as headers:
FileNotFoundError: [Errno 2] No such file or directory: 'jiminy-py-1.7.14.dist-info/WHEEL'
The complete log file is available here.
Expected behavior
The package names used to create and search dist-info
should be consistent.
Wheels used
Could be added if necessary
Platform (please complete the following information):
- OS version: macOS 10.9
- Delocate version: 0.10.4
Additional context
It was working just find before this MR https://github.com/matthew-brett/delocate/pull/141
Happening for psycopg too: https://github.com/psycopg/psycopg2/actions/runs/4525821909/jobs/7972760651
FYI, we solved the problem by using cibuildwheel, instead of using delocate from a job we rolled on owr own. So probably the problem was in the options used.