Giter VIP home page Giter VIP logo

pyp2rpm's Introduction

Logo

pyp2rpm

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

Usage

The simplest use case is to run:

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 a 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.

Options:
  -t TEMPLATE             Template file (jinja2 format) to render (default:
                          "fedora").Search order is 1) filesystem, 2) default
                          templates.
  -o [fedora|mageia|pld]  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 (fedora default: "3").
  -p PYTHON_VERSIONS      Additional Python versions to include in the
                          specfile (e.g -p2 for python2 subpackage). Can be
                          specified multiple times (fedora default: "2"). Specify
                          additional version or use -b explicitly to disable
                          default.
  -s                      Spec file ~/rpmbuild/SPECS/python-package_name.spec
                          will be created (default: prints spec file to
                          stdout).
  --srpm                  When used pyp2rpm will produce srpm instead of
                          printing specfile into stdout.
  --proxy PROXY           Specify proxy in the form proxy.server:port.
  -r RPM_NAME             Name of rpm package (overrides calculated name).
  -d SAVE_PATH            Specify where to save package file, specfile and
                          generated SRPM (default: "/home/mcyprian/rpmbuild").
  -v VERSION              Version of the package to download (ignored for
                          local files).
  --venv / --no-venv      Enable / disable metadata extraction from virtualenv
                          (default: enabled).
  --autonc / --no-autonc  Enable / disable using automatic provides with a
                          standardized name in dependencies declaration
                          (default: disabled).
  --sclize                Convert tags and macro definitions to SCL-style
                          using `spec2scl` module. NOTE: SCL related options
                          can be provided alongside this option.
  -h, --help              Show this message and exit.

SCL related options:
  --no-meta-runtime-dep       Don't add the runtime dependency on the scl
                              runtime package.
  --no-meta-buildtime-dep     Don't add the buildtime dependency on the scl
                              runtime package.
  --skip-functions FUNCTIONS  Comma separated list of transformer functions to
                              skip.
  --no-deps-convert           Don't convert dependency tags (mutually
                              exclusive with --list-file).
  --list-file FILE_NAME       List of the packages/provides, that will be in
                              the SCL (to convert Requires/BuildRequires
                              properly). Lines in the file are in form of
                              "pkg-name %%{?custom_prefix}", where the prefix
                              part is optional.

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

PYTHONPATH=$(pwd) py.test

or run:

python setup.py test

Example usage

alt tag

Contributing

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

pyp2rpm is licensed under the MIT/Expat license.

pyp2rpm's People

Contributors

bkabrda avatar frenzymadness avatar glensc avatar hroncok avatar irushchyshyn avatar joequant avatar marbu avatar mcyprian avatar michaelmraka avatar pixelb avatar rkuska avatar rsuste avatar s7nfo avatar shlomif avatar xsuchy avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.