Sophie

Sophie

distrib > Mageia > 6 > x86_64 > media > core-release > by-pkgid > 218122d3fb40e2ed86d6f0c4294546f0 > files > 61

python-pyp2rpm-1.1.3-0.20150715.git519bb99.5.mga6.noarch.rpm



=======
pyp2rpm
=======
Tool to convert a package from PyPI to RPM SPECFILE or to generate SRPM.
Under heavy development, see TODO file for list of planned features.
pyp2rpm currently ships with Fedora and Mageia specific templates.

Usage:

The most simple use case is running::

    pyp2rpm package_name

This downloads the package from PyPI and outputs the RPM SPECFILE.

Or::

    pyp2rpm package_name --srpm

This downloads the package from PyPI and creates SRPM file.

All of the options are (print this by running pyp2rpm -h::

    usage: pyp2rpm [-h] [-v VERSION] [-d SAVE_DIR] [-r RPM_NAME] 
                   [-t TEMPLATE] [-o DISTRO] [-b BASE_PYTHON] 
                   [-p PYTHON_VERSION] [--srpm] [--proxy PROXY] PACKAGE

    Convert PyPI package to RPM specfile or SRPM.

    arguments:
      PACKAGE             Provide PyPI name of the package or path to compressed 
                          source file.

    optional arguments:
      -h, --help          show this help message and exit
      -v VERSION          Version of the package to download (ignored for local files).
      -d SAVE_DIR         Where to save the package file (default: "~/rpmbuild")
      -r RPM_NAME         Name of rpm package (overrides calculated name)
      -t TEMPLATE         Template file (jinja2 format) to render (default: "fedora"). 
                          Search order is 1) filesystem, 2) default templates.
      -o DISTRO           Default distro whose conversion rules to use 
                          (default: "fedora"). Default templates have their rules 
                          associated and ignore this.
      -b BASE_PYTHON      Base Python version to package for (default: "2").
      -p PYTHON_VERSIONS  Additional Python versions to include in the specfile 
                          (e.g -p3 for %{?with_python3}). Can be specified multiple times.
      --srpm              When used pyp2rpm will produce srpm instead of printing 
                          specfile into stdout.
      --proxy PROXY       Specify proxy in the form proxy.server:port.


To run the unit tests, cd into the checked out directory and run::

    PYTHONPATH=$(pwd) py.test

or run::

    python setup.py test

I will gladly accept any pull request or recommendation.
With complex pull requests, please include unit tests in *pytest*, use *flexmock* if you need mocking.

pyp2rpm is licensed under MIT license.