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.20.tar.gz
.
File metadata
- Download URL: py2pack-0.3.20.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 571a048f6f5e7d169ee3322a202bc53944a15ef0044a42302a90698a553d3b90 |
|
MD5 | 566e3c010da2f23d73e5ac0792ab3467 |
|
BLAKE2b-256 | 887ca4d120ddf9767cf582c1c80c0ba55c552c37eb45487e6471a97034c17425 |
File details
Details for the file py2pack-0.3.20-1.src.rpm
.
File metadata
- Download URL: py2pack-0.3.20-1.src.rpm
- Upload date:
- Size: 22.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 052ff113514c5b61e0f9dffede336443299bd019510c85db137185436a673274 |
|
MD5 | 75464605bf588ccf2788cfe7db22bb74 |
|
BLAKE2b-256 | 5873027554ccf4655d04c703d341b725c83e51cd8b5c7c0a62604fea9acc0955 |
File details
Details for the file py2pack-0.3.20-1.noarch.rpm
.
File metadata
- Download URL: py2pack-0.3.20-1.noarch.rpm
- Upload date:
- Size: 21.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6527443af919a4b2323bfd7abbf7c7b52bfc3df514c365ca88a49c068f5e8a21 |
|
MD5 | 3049227384a407044e3b1588849d795d |
|
BLAKE2b-256 | aced17fc341ddba37c953c7c671d219b450d64dfbd2822cc91101c352758d16f |