Skip to content

karellen/wheel-axle-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wheel Axle Example - Python Wheel enhancement library

This is an example project for using Wheel Axle to generate a Python Wheel with symlinks and other advanced features.

See More

wheel-axle

wheel-axle-runtime

Example

To activate wheel-axle using setuptools when you need to substitute wheel for the wheel-axle is the following stanza:

from setuptools import setup
import wheel_axle.bdist_axle

# ...

setup(
    # ...
    cmdclass={"bdist_wheel": wheel_axle.bdist_axle.BdistAxle}
    # ...
)

Additionally, you need to add pyproject.toml as follows. This will ensure that wheel-axle is available for build.

[build-system]
requires = ["setuptools", "wheel-axle"]
build-backend = "setuptools.build_meta"

Now install Python Build:

$ pip install build
Defaulting to user installation because normal site-packages is not writeable
Collecting build
  Using cached build-1.3.0-py3-none-any.whl.metadata (5.6 kB)
Requirement already satisfied: packaging>=19.1 in /usr/lib/python3.13/site-packages (from build) (24.2)
Requirement already satisfied: pyproject_hooks in /home/arcivanov/.local/lib/python3.13/site-packages (from build) (1.2.0)
Using cached build-1.3.0-py3-none-any.whl (23 kB)
Installing collected packages: build
Successfully installed build-1.3.0

And run the build!

Notice that you need to specify the --wheel, since by default build generates sdist first and sdist doesn't support symlinks and other Wheel Axle features:

bash-5.2$ python -m build --wheel
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
  - setuptools
  - wheel-axle
* Getting build dependencies for wheel...
running egg_info
writing src/test_axle_1.egg-info/PKG-INFO
writing dependency_links to src/test_axle_1.egg-info/dependency_links.txt
writing top-level names to src/test_axle_1.egg-info/top_level.txt
reading manifest file 'src/test_axle_1.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'src/test_axle_1.egg-info/SOURCES.txt'
* Building wheel...
running bdist_wheel
running build
running build_py
creating build/lib/bar
copying src/bar/__init__.py -> build/lib/bar
reproducing link src/bar/foo.so (../../../foo.so) -> build/lib/bar
running build_scripts
creating build/scripts-3.13
copying scripts/script1 -> build/scripts-3.13
changing mode of build/scripts-3.13/script1 from 644 to 755
installing to build/bdist.linux-x86_64/wheel
running install
Distribution option extra_path is deprecated. See issue27919 for details.
running install_lib
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/bar
copying build/lib/bar/__init__.py -> build/bdist.linux-x86_64/wheel/./bar
registering link build/lib/bar/foo.so (../../../foo.so) -> build/bdist.linux-x86_64/wheel/./bar/foo.so
running install_headers
creating build/bdist.linux-x86_64/wheel/test_axle_1-0.0.1.data/headers
registering link headers/header2.h (header1.h) -> build/bdist.linux-x86_64/wheel/test_axle_1-0.0.1.data/headers
copying headers/header1.h -> build/bdist.linux-x86_64/wheel/test_axle_1-0.0.1.data/headers
running install_data
creating build/bdist.linux-x86_64/wheel/test_axle_1-0.0.1.data/data
creating build/bdist.linux-x86_64/wheel/test_axle_1-0.0.1.data/data/lib
registering link data/lib/foo.so (foo.1.so) -> build/bdist.linux-x86_64/wheel/test_axle_1-0.0.1.data/data/lib
copying data/lib/foo.1.so -> build/bdist.linux-x86_64/wheel/test_axle_1-0.0.1.data/data/lib
running install_egg_info
running egg_info
writing src/test_axle_1.egg-info/PKG-INFO
writing dependency_links to src/test_axle_1.egg-info/dependency_links.txt
writing requirements to src/test_axle_1.egg-info/requires.txt
writing top-level names to src/test_axle_1.egg-info/top_level.txt
reading manifest file 'src/test_axle_1.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'src/test_axle_1.egg-info/SOURCES.txt'
Copying src/test_axle_1.egg-info to build/bdist.linux-x86_64/wheel/./test_axle_1-0.0.1-py3.13.egg-info
running install_scripts
creating build/bdist.linux-x86_64/wheel/test_axle_1-0.0.1.data/scripts
copying build/scripts-3.13/script1 -> build/bdist.linux-x86_64/wheel/test_axle_1-0.0.1.data/scripts
registering link build/scripts-3.13/script2 (script1) -> build/bdist.linux-x86_64/wheel/test_axle_1-0.0.1.data/scripts/script2
changing mode of build/bdist.linux-x86_64/wheel/test_axle_1-0.0.1.data/scripts/script1 to 755
creating build/bdist.linux-x86_64/wheel/./test_axle_1-0.0.1.pth
creating build/bdist.linux-x86_64/wheel/test_axle_1-0.0.1.dist-info/WHEEL
creating '/home/arcivanov/Documents/src/karellen/wheel-axle-example/dist/.tmp-qhxiht42/test_axle_1-0.0.1-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
adding 'test_axle_1-0.0.1.pth'
adding 'bar/__init__.py'
adding 'test_axle_1-0.0.1.data/data/lib/foo.1.so'
adding 'test_axle_1-0.0.1.data/headers/header1.h'
adding 'test_axle_1-0.0.1.data/scripts/script1'
adding 'test_axle_1-0.0.1.dist-info/licenses/LICENSE'
adding 'test_axle_1-0.0.1.dist-info/METADATA'
adding 'test_axle_1-0.0.1.dist-info/WHEEL'
adding 'test_axle_1-0.0.1.dist-info/axle.lck'
adding 'test_axle_1-0.0.1.dist-info/symlinks.txt'
adding 'test_axle_1-0.0.1.dist-info/top_level.txt'
adding 'test_axle_1-0.0.1.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
Successfully built test_axle_1-0.0.1-py3-none-any.whl

About

Example of using wheel-axle packaging system

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published