I have a python application that has flask dependency.
All I need is to create an RPM out of this application and with this RPM I should be able to install the dependencies to another machine.
Things I have tried,
setup(
name='sample-package',
version='1.0.0.0',
author="Niranj Rajasekaran",
author_email="nrajasekaran@test.com",
package_dir={'': 'src/py'},
namespace_packages=['main'],
packages=find_packages('src/py/'),
install_requires=['Flask']
)
Ran this command
python setup.py bdist_rpm
Got two RPMs in dist/
, one is noarch and other is src
I tried to install noarch rpm using this
yum install {generated-file}.rpm
I am able to get sample-package-1.0.0.0.egg
file in site-packages
but not flask.
Two questions,
bdist_rpm
lacks of a lot of functionality and IMO is not very well maintained. E.g. pyp2rpm
is much better for converting existing PyPI modules. But your module does not seem to be on PyPI, so you need to specify it to bdist_rpm
manually because it cannot retrieve this information from setup.py
.
Run:
python setup.py bdist_rpm --requires python-flask
This will produce an rpm file which requires the python-flask
package. For more recent RHEL/Fedora it would be python3-flask
.