'How to create a RPM which install python dependencies?

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,

  1. Created a setup.py file,
setup(
    name='sample-package',
    version='1.0.0.0',
    author="Niranj Rajasekaran",
    author_email="[email protected]",
    package_dir={'': 'src/py'},
    namespace_packages=['main'],
    packages=find_packages('src/py/'),
    install_requires=['Flask']
)
  1. Ran this command

    python setup.py bdist_rpm

  2. Got two RPMs in dist/, one is noarch and other is src

  3. 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,

  1. Is my approach correct?
  2. If so what is something that I am missing?


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source