Script for renaming Linux wheels.
Project description
A simple command-line utility to rename Linux Python wheels based on their platform and ABI tag to be compliant with a specific manylinux standard.
The Problem
When building Python wheels on modern Linux distributions, the resulting wheel file is often tagged with a generic platform tag like linux_x86_64. While technically correct for the build environment, this tag is not recognized as a compatible distribution package by tools like pip when installing on other Linux systems.
The standard for portable Linux wheels is the manylinux tag (e.g., manylinux_2_34_x86_64), which guarantees compatibility with a wide range of distributions by linking against an older, stable set of core libraries (defined by the manylinux PEPs).
renamewheel provides a straightforward way to rename a wheel file from a linux_* tag to the appropriate manylinux_* tag corresponding to the system’s glibc version, making it suitable for distribution on platforms like PyPI.
Installation
The package can be installed from PyPI using pip:
pip install renamewheel
This will install the package and make the renamewheel command-line application available in your environment.
Usage
The application takes the path to a wheel file and renames it.
usage: renamewheel [-h] [-v] [-w WORKING_DIR] WHEEL_FILE
Rename Linux Python wheels based on their ABI tag.
positional arguments:
WHEEL_FILE Path to wheel file.
options:
-h, --help show this help message and exit
-v, --verbose Print out messages to the console.
-w WORKING_DIR, --working-dir WORKING_DIR
Copy the renamed wheel to this directory.
Arguments & Options
- WHEEL_FILE
The path to the .whl file that needs to be renamed. This is a required argument.
- -h, --help
Shows the help message and exits.
- -v, --verbose
Enables verbose output, printing messages about the renaming process to the console.
- -w WORKING_DIR, --working-dir WORKING_DIR
Specifies a directory where the newly renamed wheel file will be copied. If this option is not provided, the original wheel is renamed in place.
Example
Given a wheel file named robotpy_hal-2025.3.2.3-cp313-cp313-linux_x86_64.whl.
Running the command:
renamewheel robotpy_hal-2025.3.2.3-cp313-cp313-linux_x86_64.whl
Will rename it to (assuming the system glibc version corresponds to manylinux_2_34):
robotpy_hal-2025.3.2.3-cp313-cp313-manylinux_2_34_x86_64.whl
Exit Codes
The renamewheel application uses the following exit codes to indicate success or specific error conditions, which can be useful in scripts and CI/CD pipelines.
0: EXIT_SUCCESS - The operation completed successfully.
1: EXIT_WRONG_PLATFORM - The script was run on a non-Linux platform.
2: EXIT_FILE_NOT_FOUND - The specified WHEEL_FILE does not exist.
3: EXIT_NOT_PLATFORM_WHEEL - The specified wheel is not a Linux platform wheel (e.g., it’s a pure Python wheel or for another OS).
4: EXIT_OUTPUT_DIRECTORY_NOT_FOUND - The directory specified with -w or --working-dir does not exist.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file renamewheel-0.4.1-py3-none-any.whl.
File metadata
- Download URL: renamewheel-0.4.1-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03683ad6e73390ef99a934a9959707080a2d9ce5119a08464e3ea09cc37bb770
|
|
| MD5 |
49dafeec26aa471ff360938bd2a5fb26
|
|
| BLAKE2b-256 |
347f4b290d5e82dde5db8e1c4f582e968d9781dc99337908ec3ecf8be037ec0a
|