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

Uploaded Source

Built Distributions

py2pack-0.3.7-1.src.rpm (17.8 kB view details)

Uploaded Source

py2pack-0.3.7-1.noarch.rpm (11.8 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for py2pack-0.3.7.tar.gz
Algorithm Hash digest
SHA256 1e33db1d007ebb91f43f0b8de7b56d9f2e5d233df3f77629b6acd234eb062718
MD5 104bd0e8a2d9d12b064fd2a35c99bca4
BLAKE2b-256 e1acd3d5a96199c0d46d2eb416aefbdff421af020e7f2dc82287f36895b8d741

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for py2pack-0.3.7-1.src.rpm
Algorithm Hash digest
SHA256 e7f987be8d7aeb4ea46272771354d4312ce4f9f473722221a7b5e067d7396bf1
MD5 6e85c7085e2ee29a9c40a71287ba4bb5
BLAKE2b-256 54ef352238cd94dad2437e6294dfe2cde52f909d39f4487eb56f05e0fcc97e36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py2pack-0.3.7-1.noarch.rpm
Algorithm Hash digest
SHA256 a508a1a7e6b880f49852df02f779425d2a92e2f025c314383ee451a91e5e655d
MD5 9ee918ec82ce22bf51afd13f786f0f13
BLAKE2b-256 577de45c83a6c8e75241073cd3453fa21739a311aeaff09a21009365a42de6ae

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