Skip to main content

Generate distribution packages from Python packages on PyPI

Project description

This script allows to generate RPM spec or DEB dsc files from Python modules. It allows to list Python modules or search for them on the Python Package Index (PyPI). Conveniently, it can fetch tarballs and changelogs making it an universal tool to package Python modules.

Prerequisites

py2pack needs the argparse Python module installed. It is also part of the Python-2.7 Standard Library. Additionally, it uses the Jinja2 templating engine.

Usage

Lets suppose you want to package zope.interface and you don’t know how it is named exactly. First of all, you can search for it and download the source tarball if you found the correct module:

$ py2pack search zope.interface
searching for module zope.interface...
found zope.interface-3.6.1
$ py2pack fetch zope.interface
downloading package zope.interface-3.6.1...
from http://pypi.python.org/packages/source/z/zope.interface/zope.interface-3.6.1.tar.gz

As a next step you may want to generate a package recipe for your distribution. For RPM-based distributions (let’s use openSUSE as an example), you want to generate a spec file (named ‘python-zope.interface.spec’):

$ py2pack generate zope.interface -t opensuse.spec -f python-zope.interface.spec

The source tarball and the package recipe is all you need to generate the RPM (or DEB) file. This final step may depend on which distribution you use. Again, for openSUSE (and by using the openSUSE Build Service), the complete recipe is:

$ osc mkpac python-zope.interface
$ cd python-zope.interface
$ py2pack fetch zope.interface
$ py2pack generate zope.interface -f python-zope.interface.spec
$ osc build
...

Depending on the module, you may have to adapt the resulting spec file slightly. To get further help about py2pack usage, issue the following command:

$ py2pack help

License

See the file LICENSE.

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

py2pack-0.3.13.tar.gz (16.4 kB view details)

Uploaded Source

Built Distributions

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

py2pack-0.3.13-1.src.rpm (21.7 kB view details)

Uploaded Source

py2pack-0.3.13-1.noarch.rpm (20.5 kB view details)

Uploaded Source

File details

Details for the file py2pack-0.3.13.tar.gz.

File metadata

  • Download URL: py2pack-0.3.13.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for py2pack-0.3.13.tar.gz
Algorithm Hash digest
SHA256 83de8da7a3a36036006e3cb59b6d406c25179736ec5631b962386ec5cad5fe80
MD5 e2fc40885afd4abda124cac7a3a42f03
BLAKE2b-256 df346d2837252463d43f9be9f8a30126b04851515e3265d3e2c1fec0b920f6d7

See more details on using hashes here.

File details

Details for the file py2pack-0.3.13-1.src.rpm.

File metadata

  • Download URL: py2pack-0.3.13-1.src.rpm
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for py2pack-0.3.13-1.src.rpm
Algorithm Hash digest
SHA256 98dea893bdf2e6b993e38536ec2cc9ce11d0c3fab1b19ce7c1c0d8c2b00077e2
MD5 960887351747611edc5c69ddda481747
BLAKE2b-256 5f5bf7bf0c9fcd6530eb0e55689eca38e2693d0978f571b13e17732bcdee49f7

See more details on using hashes here.

File details

Details for the file py2pack-0.3.13-1.noarch.rpm.

File metadata

File hashes

Hashes for py2pack-0.3.13-1.noarch.rpm
Algorithm Hash digest
SHA256 2fe3c987c888580c77791b0fdba11d1672a96d4167e0a5b2d31eb70358177680
MD5 4f3c595bbffd388a7398e4d6e2d8bf08
BLAKE2b-256 baac17691e60654ead376aef77d67acfdb66c2823a52f3a293c36b65cbf2de09

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