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 -t opensuse.spec -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.0.tar.gz (14.2 kB view details)

Uploaded Source

Built Distributions

py2pack-0.3.0-1.src.rpm (19.7 kB view details)

Uploaded Source

py2pack-0.3.0-1.noarch.rpm (11.4 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for py2pack-0.3.0.tar.gz
Algorithm Hash digest
SHA256 ddadc8b1370b166090aab8ac6cda1096814669e9fd8325b2eb473d06569473c8
MD5 b67351b1e8db320a5a42e8fd984c43cd
BLAKE2b-256 9e814681dfc0f0c3d91dec5d65cba5929297789959ad642662d1bc61ad34c48e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for py2pack-0.3.0-1.src.rpm
Algorithm Hash digest
SHA256 c234856c1e1fa6ffd45b4f1eedafe27b28ad8ad7215f6307a9fd16128aeca636
MD5 7ec741004533e52c1174606ecbed4ef7
BLAKE2b-256 432b99003db103c501de4f3240b85cbc69960187523c182dcabcd2431f177c94

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py2pack-0.3.0-1.noarch.rpm
Algorithm Hash digest
SHA256 0e709764e5ac5cd3fbb41c5343624edcbf5083c1dd8f3e4001e35f54c4d80b1c
MD5 0109b9246d972baa6ca704e8b4af684f
BLAKE2b-256 7338ac9856c4b33048d8e83e783aa0828220885295599ad2d33f8f801815b836

See more details on using hashes here.

Supported by

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