https://github.com/karellen/wheel-axle
Wheel Axle - Python Wheel enhancement library
https://github.com/karellen/wheel-axle
packaging packaging-python post-install post-installation python setuptools symlink symlinks wheel wheels
Last synced: 7 months ago
JSON representation
Wheel Axle - Python Wheel enhancement library
- Host: GitHub
- URL: https://github.com/karellen/wheel-axle
- Owner: karellen
- License: apache-2.0
- Created: 2022-01-28T06:12:28.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-08-10T02:55:49.000Z (11 months ago)
- Last Synced: 2024-08-10T03:23:48.225Z (11 months ago)
- Topics: packaging, packaging-python, post-install, post-installation, python, setuptools, symlink, symlinks, wheel, wheels
- Language: Python
- Homepage:
- Size: 71.3 KB
- Stars: 3
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Wheel Axle - Python Wheel enhancement library
[](https://app.gitter.im/#/room/#karellen_Lobby:gitter.im)
[](https://github.com/karellen/wheel-axle/actions/workflows/build.yml)
[](https://coveralls.io/r/karellen/wheel-axle?branch=master)[](https://pypi.org/project/wheel-axle/)
[](https://pypi.org/project/wheel-axle/)[](https://pypistats.org/packages/wheel-axle)
[](https://pypistats.org/packages/wheel-axle)
[](https://pypistats.org/packages/wheel-axle)## Problem
1. Python wheel does not support symlinks.
2. Python wheel does not support overwriting in a convenient way:
* whether the distribution is pure-Python
* distribution ABI tag
* extend Python tag override capability## Solution
**WARNING: THIS IS EXPERIMENTAL BETA SOFTWARE. THERE ARE NO WARRANTIES OF ANY KIND. USE AT YOUR OWN RISK.
ADDITIONAL INCLUDED DISCLAIMERS ALSO APPLY.**Wheel-Axle (`axle`, `bdist_axle`) is a drop-in replacement/augmentation utility for `wheel` (`bdist_wheel`)
that extends and builds spec-compliant wheels.During the build, `axle` is able to capture and record in the Python wheel the symlinks in the following
schema paths (locations):* purelib
* platlib
* scripts
* headers
* dataAdditionally, `Axle` is able to customize the Python wheel tags via additional command line options.
While the generated Python wheel is fully spec-compliant, additional symlink functionality is not possible without its
companion library [Wheel Axle Runtime](https://github.com/karellen/wheel-axle-runtime). Thus, every Python wheel
generated by the `bdist_axle` automatically becomes dependent on `wheel-axle-runtime` that provides
post-install logic required.## Implementation
The body of the library is as ugly and messy as `distutils`/`setuptools` are, and consists of, mainly, in
hacking/overwriting various `setuptools` commands to detect, handle and record symlinks and their targets. Once that
problem is solved, the list of symlinks is recorded in the `.dist-info/symlinks.txt`
in the following CSV format:1. symlink name
2. symlink target
3. a boolean (0 or 1) flag indicating whether the target is a directory**NOTE: Symlinks may be relative, absolute and/or broken. Symlink targets are recorded verbatim (even when broken) and
are NOT otherwise interpreted. THIS IS INTENTIONAL. Please
see [Wheel Axle Runtime Security Notice](https://github.com/karellen/wheel-axle-runtime#security)
for additional information.**A special `.pth` file is also added to the distribution. When the wheel is installed
this `.pth` file triggers the post-install logic via
[wheel-axle-runtime](https://github.com/karellen/wheel-axle-runtime).## Usage
`python setup.py bdist_wheel ` can be replaced with `python setup.py bdist_axle `. The replacement
is drop-in.Additional functionality is available via the following options:
```commandline
--python-tag Python implementation compatibility tag (default: 'py3')
--root-is-pure set to manually override whether the wheel is
pure (default: None)
--abi-tag set to override ABI tag (default: None)
--require-libpython set to indicate the package requires libpython in the
exec_prefix/platlib
```Using `--python-tag`, `--root-is-pure` and `--abi-tag` allows you to create wheels that carry platform-dependent data
while otherwise containing pure-Python libraries.