Skip to main content

Python wheel to debian package converter

Project description

wheel2deb

cicd codecov MIT license Code style: black PyPI version shields.io Downloads WakeMeOps

wheel2deb is a python wheel to debian package converter. It takes a list of wheels as input and produces a list of debian binary CPython packages (those prefixed with python- or python3-).

asciicast

Quick Example

The following shows how to convert numpy and pytest, along with their dependencies into a list of debian packages:

# Download (and build if needed) pytest, numpy and their requirements
pip3 wheel pytest numpy
# Convert all wheels to debian source packages, build them with dpkg-buildpackage
wheel2deb
ls -l output/*.deb
# Install generated packages
dpkg -i output/*.deb
# Run pytest on numpy
python3 -c "import numpy; numpy.test()"

Project scope

  • Python 2.7 and 3
  • CPython only for now
  • support for non pure python wheels
  • support debian architectures all, armhf, amd64, i686
  • tested on jessie, stretch, buster so far, ubuntu should also work

Requirements

wheel2deb uses apt-cache to search for debian packages, dpkg-shlibdeps to calculate shared library dependencies and apt-file to search packages providing shared library dependencies. wheel2deb build requires the usual tools to build a debian package:

apt update
apt install apt-file dpkg-dev fakeroot build-essential devscripts debhelper
apt-file update

If you want to cross build packages for ARM, you will also need to install binutils-arm-linux-gnueabihf.

Converting pure python wheels, don't actually requires apt-file and dpkg-dev.

Keep in mind that you should only convert wheels that have been built for your distribution and architecture. wheel2deb will not warn you about ABI compatibility issues.

Installation

From the release page

wheel2deb is packaged as a single binary application that you can download from the release page. Using those releases will spare you the hassle of building Python 3.11 on old Debian based distributions.

With wakemeops

sudo apt-get install wheel2deb

With docker

We currently do not build docker images with wheel2deb pre-installed. You can use wakemeops docker images to quickly play with wheel2deb on a different distribution than your host.

docker run -ti wakemeops/debian:buster

And in the container run:

install_packages wheel2deb

With pipx

wheel2deb is available from pypi:

pipx install wheel2deb

Features

  • guess debian package names from wheel names and search for them in the cache
  • search packages providing shared library dependencies for wheels with native code
  • handle entrypoints and scripts (those will be installed in /usr/bin with a proper shebang)
  • try to locate licence files and to generate a debian/copyright file

Usage

Use wheel2deb convert --help and wheel2deb build --help to check all supported options.

Development

You will need poetry, and probably pyenv if you don't have python 3.11 on your host.

poetry install

To run wheel2deb test suite run:

poetry run task check

To build a python wheel:

poetry run poetry build

Bugs/Requests

Please use the GitHub issue tracker to submit bugs or request features.

License

Copyright Parkoview SA 2019-2023.

Distributed under the terms of the MIT license, wheel2deb is free and open source software.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wheel2deb-0.9.3.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wheel2deb-0.9.3-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file wheel2deb-0.9.3.tar.gz.

File metadata

  • Download URL: wheel2deb-0.9.3.tar.gz
  • Upload date:
  • Size: 20.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for wheel2deb-0.9.3.tar.gz
Algorithm Hash digest
SHA256 07b99c589775bf360e4f6b839bc639b1f1e1c0f59b53b7c39e4b612657d01c7b
MD5 96af9891e4d2910d42de6cd88d02d172
BLAKE2b-256 1e0361ed36a02480d2e7f25d7388e67aa2e174aae948e62fcad1e810e460000b

See more details on using hashes here.

File details

Details for the file wheel2deb-0.9.3-py3-none-any.whl.

File metadata

  • Download URL: wheel2deb-0.9.3-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for wheel2deb-0.9.3-py3-none-any.whl
Algorithm Hash digest
SHA256 062f5c92c4e38072207da8f4907b738aa17b18f38fc2e7b5a22ebe25a0df2b44
MD5 52f4bf33b97ed644db6e8b3b06261312
BLAKE2b-256 4b008505b07f9873d0d2197a11adbd35072e11490fd1db624f95b32c10711003

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page