Delivering an application is a crucial part and it becomes essential that the application should support easy and standard way of handling install/upgrade/downgrade/uninstall/reinstall of software.
RPM format is widely used in Linux distribution to install and manage software packages. Linux distribution is also provides YUM Server feature, a way to install packages by resolving dependencies automatically.
In this post, I'll explain about building RPM of Python package and will use SQLAlchmey Package in examples to explain the approaches.
RPM format is widely used in Linux distribution to install and manage software packages. Linux distribution is also provides YUM Server feature, a way to install packages by resolving dependencies automatically.
In this post, I'll explain about building RPM of Python package and will use SQLAlchmey Package in examples to explain the approaches.
Native Approach:
- Download the Python Package that you would like to create RPM of, from Python Package Index: https://pypi.python.org/pypi (or) if you have one, developed by yourself using python setuptools, use him
- As stated above, this example uses SQLAlchemy Package, downloaded using this link: URL
- Python package bundle usually available in zip/tar.gz formats
- Extract the package and change current directory to the package directory
- Execute # python setup.py bdist_rpm
- RPM build process starts and once it completes, by default the RPM files will be available in dist directory
Note:
- There are few minor issues in the approach described above, due to the fact that the Python Package developers are more keen on testing the package binary build as it is widely used and more often not concentrated on the binary RPM build.
- Because of that, some packages throw error while trying to build them as RPM using setup.py bdist_rpm command.
- We will discuss about the common build errors along with ways to fix the errors to build a RPM successful in a different post.
Alternate Approach:
There are several python packages available that provides more convenient way to build RPM file. One such Python package is pypi2rpm
- Download pypi2rpm package from Python Package Index: https://pypi.python.org/pypi (or) if your system connected to internet, you may perform the installation through pip CLI by executing the following command # pip install pypi2rpm
- Once the installation is completed. Your system will be provided with pypi2rpm.py CLI to build RPM of python package.
- Execute pypi2rpm.py CLI following by the python package that you would like to build RPM of, pypi2rpm builds RPM file and the same will be available in the current working directory.
- The command to build RPM is as follows, # pypi2rpm.py SQLAlchemy-1.0.11.tar.gz
3 Comments
The Walking Dead Season 7 Episode 9
ReplyDeleteWatch The Walking Dead Season 7 Episode9
The Walking Dead Season 7 Episode 9 Online
The Simpsons Season 28 Episode 14
The Simpsons Season 28 Episode 14 Online
Zumanity Cirque du Soleil
Zumanity Cirque du Soleil Las Vegas
Kentucky Derby 2017
ReplyDeleteWatch Kentucky Derby 2017
2017 Kentucky Derby
Kentucky Derby
Kentucky Derby 2017 Live
Canelo vs Chavez
Canelo vs Chavez jr
Alvarez vs Chavez
Cognex providing AWS Training in chennai. Studying Amazon web server in cognex will amke good hipe in your career.
ReplyDeleteAWS Training in Chennai