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

Uploaded Source

Built Distributions

py2pack-0.3.2-1.src.rpm (18.4 kB view details)

Uploaded Source

py2pack-0.3.2-1.noarch.rpm (11.5 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for py2pack-0.3.2.tar.gz
Algorithm Hash digest
SHA256 7e5a7c94e7d129f47aec9289b3ce61a15ed5c219bad4e58c47265d4ec10c92f8
MD5 5fc6bdbfbdb90eeefbd614b194abccd1
BLAKE2b-256 1d8f81184b10af76cf63abd4b5a09988db5866ce7d1ba844de06541bbc3312ec

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for py2pack-0.3.2-1.src.rpm
Algorithm Hash digest
SHA256 0490e86c27ec638b76c56c016f40b20c59b620c877c649ffa7aec12d14a24e42
MD5 8a3ba680532c745a8d6f46b4ccf81ad8
BLAKE2b-256 8f43246263f785cf062d49de35602c290a9d45ac94415f591d1202b6a384fe2d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py2pack-0.3.2-1.noarch.rpm
Algorithm Hash digest
SHA256 d5fb983fac49077d52e169175c8916562b773144463b5ee943148cf7b69c36f7
MD5 dbb04135a25da8377d4eac4df45a7a45
BLAKE2b-256 e43d225dccbe39ce75354ae41ca799acd94c7f29597ee36d8cf29a764ffb6103

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