Metadata-Version: 2.3
Name: repairwheel
Version: 0.3.1
Summary: Repair any wheel, anywhere
Project-URL: homepage, https://github.com/jvolkman/repairwheel
License: Copyright © 2023 Jeremy Volkman
        
        Permission is hereby granted, free of charge, to any person obtaining a
        copy of this software and associated documentation files (the "Software"),
        to deal in the Software without restriction, including without limitation
        the rights to use, copy, modify, merge, publish, distribute, sublicense,
        and/or sell copies of the Software, and to permit persons to whom the
        Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice (including the next
        paragraph) shall be included in all copies or substantial portions of the
        Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
        THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
        FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
        DEALINGS IN THE SOFTWARE.
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.8
Requires-Dist: delvewheel>=1.3.6
Requires-Dist: macholib>=1.16
Requires-Dist: packaging>=20.9
Requires-Dist: pefile>=2023.2.7
Requires-Dist: pyelftools>=0.24
Description-Content-Type: text/markdown

# repairwheel

[![CI - Test](https://github.com/jvolkman/repairwheel/actions/workflows/test.yml/badge.svg)](https://github.com/jvolkman/repairwheel/actions/workflows/test.yml)
[![PyPI - Version](https://img.shields.io/pypi/v/repairwheel.svg?logo=pypi&label=PyPI&logoColor=gold)](https://pypi.org/project/repairwheel/)

## Overview

- `repairwheel` combines the "repair" steps from [`auditwheel`](https://github.com/pypa/auditwheel), [`delocate`](https://github.com/matthew-brett/delocate),
  and [`delvewheel`](https://github.com/adang1345/delvewheel) into a single tool, enabling cross-platform wheel repair.
- It includes pure-python replacements for external tools like `patchelf`, `otool`, `install_name_tool`, and `codesign`, so no non-python dependencies are required.

## What's it do?

1. When invoked, `repairwheel` first looks at the platform tag on the input wheel.
2. Based on the tag, `repairwheel` selects a repair step from `auditwheel`, `delocate`, or `delvewheel` (or nothing, if it's a pure-Python wheel)
3. Finally, `repairwheel` rewrites the result in a canonical form ensuring that:
   1. File timestamps are set to a constant value;
   2. Files in the archive are ordered lexicographically; and
   3. Files in `RECORD` are ordered lexicographically

The final result _should_ be bitwise-identitcal regardless of the system used to perform the repair.

## Usage

```
usage: repairwheel [-h] -o OUTPUT_DIR [-l LIB_DIR] wheel

positional arguments:
  wheel

options:
  -h, --help            show this help message and exit
  -o OUTPUT_DIR, --output-dir OUTPUT_DIR
  -l LIB_DIR, --lib-dir LIB_DIR
```

## Example

```shell
$ repairwheel \
  tests/testwheel/cp36-abi3-macosx_10_11_arm64/testwheel-0.0.1-cp36-abi3-macosx_10_11_arm64.whl \
  -l tests/testwheel/cp36-abi3-macosx_10_11_arm64/lib \
  -o /tmp/wheelout

$ repairwheel \
  tests/testwheel/cp36-abi3-linux_x86_64/testwheel-0.0.1-cp36-abi3-linux_x86_64.whl \
  -l tests/testwheel/cp36-abi3-linux_x86_64/lib \
  -o /tmp/wheelout

$ ls /tmp/wheelout
testwheel-0.0.1-cp36-abi3-macosx_10_11_arm64.whl
testwheel-0.0.1-cp36-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl
```
