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

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
wheel2deb --map attrs=attr
# Call dpkg-buildpackages for each source package
wheel2deb build
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 python3-apt 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 python3-apt 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

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

Options

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

Option Description
-v Enable debug logs.
-x List of search paths where to look for python wheels. Defaults to current directory. Not recursive.
-o Output directory where debian source packages will be produced. Defaults to ./output
-i List of wheel names to convert. By default all found wheels are included.
--python-version cpython version on the target debian distribution. Defaults to platform version (example: 3.4).
--map list of string pairs to explicitely map python dist names to debian package names. For instance: "--map foo:bar attrs:attr" will tell wheel2deb to map foo to python-bar and attrs to python-attr.
--depends List of additional debian dependencies.
--epoch Debian package epoch. Defaults to 0.
--revision Debian package revision. Defaults to 1.
--ignore-entry-points Don't include the wheel entrypoints in the debian package.
--ignore-upstream-version Ignore version specifiers from wheel requirements. For instance, if foo requires bar>=3.0.0, using this option will produce a debian package simply depending on bar instead of "bar (>= 3.0.0)".

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.7.0.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

wheel2deb-0.7.0-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wheel2deb-0.7.0.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for wheel2deb-0.7.0.tar.gz
Algorithm Hash digest
SHA256 33401690b597b77c1564a1463eb77facfd8ae6f6cf127687366ee9dd13d24ce0
MD5 766585c456e76f70708f2f1b41cc1e76
BLAKE2b-256 ca32f81e77c354a41a73ac4bc95e26562973bd1323d4d3c1c5fb5d7755d8e625

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wheel2deb-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 22.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for wheel2deb-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ddc9085c7ecea6d662f7b6294dd0131a82b8ac4dc7facaea88d019bb40dce3c
MD5 cc56ca90a7e919e8bc3352fceb88c19e
BLAKE2b-256 dbb13d788fca9b32f2b7753e16598d8d9e7d779f2dab130aad57ac1b97ef0647

See more details on using hashes here.

Supported by

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