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
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 Distributions
File details
Details for the file py2pack-0.3.15.tar.gz
.
File metadata
- Download URL: py2pack-0.3.15.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62ecfad45136887d97601226355c4150f6c03ea774f92f3fd1645fc7de495236 |
|
MD5 | 8a9aceba034a96cfa9d622971cb697e4 |
|
BLAKE2b-256 | 1240444cdf7b2164860a8e1cecd78b2bd0e509726fcd0fae657b5df8c143c792 |
File details
Details for the file py2pack-0.3.15-1.src.rpm
.
File metadata
- Download URL: py2pack-0.3.15-1.src.rpm
- Upload date:
- Size: 21.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 674d4306435f34ecc8516c67370a0b272bcdfa881e0b6bf7f80d72feaf21f12e |
|
MD5 | 1c00581c8c1417e2278fb9c94628fd14 |
|
BLAKE2b-256 | c6e1cdb813cb230e60915fc775836a47b1112a02abbb78480ebcd97b00f31c7a |
File details
Details for the file py2pack-0.3.15-1.noarch.rpm
.
File metadata
- Download URL: py2pack-0.3.15-1.noarch.rpm
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08539f78c2f5c2edb17db3f6c0f1b14898452647a1c46b99260437da45da2b80 |
|
MD5 | 801702a38d8fa6546754ce4553a1da23 |
|
BLAKE2b-256 | 1e798ba437b606d3ec83c7e887163ab3d528d6bb946d4daee0351bcd027d505b |