MrMino / wheelfile

🔪🧀 API for creating and inspecting Python .whl files (wheels)
MIT License
29 stars 5 forks source link

Record subfolder #19

Closed mboisson closed 2 years ago

mboisson commented 2 years ago

Without this, I get an exception when trying to update a wheel for the package py.

The reason is that py includes vendored dependencies. This patch allows having that. The error I get is:

Exception: Traceback (most recent call last):
  File "/home/mboisson/git/wheels_builder/manipulate_wheels.py", line 84, in main
    wf2 = WheelFile.from_wheelfile(wf, file_or_path=TMP_DIR, version=version)
  File "/cvmfs/soft.computecanada.ca/custom/python/envs/manipulate_wheels/lib/python3.8/site-packages/wheelfile.py", line 1484, in from_wheelfile
    new_wf.writestr(zinfo, wf.zipfile.read(zinfo))
  File "/cvmfs/soft.computecanada.ca/custom/python/envs/manipulate_wheels/lib/python3.8/site-packages/wheelfile.py", line 2051, in writestr
    self.refresh_record(arcname)
  File "/cvmfs/soft.computecanada.ca/custom/python/envs/manipulate_wheels/lib/python3.8/site-packages/wheelfile.py", line 1828, in refresh_record
    self.record.update(arcname, zf)
  File "/cvmfs/soft.computecanada.ca/custom/python/envs/manipulate_wheels/lib/python3.8/site-packages/wheelfile.py", line 727, in update
    assert not arcpath.endswith('.dist-info/RECORD'), (
AssertionError: Attempt to add an entry for a RECORD file to the RECORD: 'py/_vendored_packages/apipkg-2.0.0.dist-info/RECORD'.
mboisson commented 2 years ago

Oops, only the last commit should be in this PR... https://github.com/MrMino/wheelfile/pull/19/commits/3fab6b6d56aeb333e34d34f8bdbef2bc4f2b0d0e