Generate distribution packages from Python packages on PyPI
Project description
py2pack
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 :copyright: (c) 2011 Sascha Peilicke. :license: GPLv2, see LICENSE for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file py2pack-0.4.4.tar.gz
.
File metadata
- Download URL: py2pack-0.4.4.tar.gz
- Upload date:
- Size: 25.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2acc0f5f6936c7bbfa37e13dfaad0902406352213e89925c3be366bbc74ebad4 |
|
MD5 | 36c293a3e3d45e7d9f1ab17b8b8d2174 |
|
BLAKE2b-256 | fb7c2c87c0b0409daf0a780fd8c1818d234f7187184f930c61fe503c3212a7ff |
File details
Details for the file py2pack-0.4.4.linux-x86_64.tar.gz
.
File metadata
- Download URL: py2pack-0.4.4.linux-x86_64.tar.gz
- Upload date:
- Size: 28.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdfa653777f38d9b057fa89694cc21a44aae82b253afc0f6b59ed75e62217e30 |
|
MD5 | 95f583ec6f78281fdb0816f2f65df38f |
|
BLAKE2b-256 | 81553aa70e3a5f6ab7b85248fce5161b912599a18dbd9d44ed547fa169037873 |