简体   繁体   中英

using setuptools with post-install and python dependencies

This is somewhat related to this question . Let's say I have a package that I want to deploy via rpm because I need to do some file copying on post-install and I have some non-python dependencies I want to declare. But let's also say I have some python dependencies that are easily available in PyPI. It seems like if I just package as an egg, an unzip followed by python setup.py install will automatically take care of my python dependencies, at the expense of losing any post-install functionality and non-python dependencies.

Is there any recommended way of doing this? I suppose I could specify this in a pre-install script, but then I'm getting into information duplication and not really using setuptools for much of anything.

(My current setup involves passing install_requires = ['dependency_name'] to setup , which works for python setup.py bdist_egg and unzip my_package.egg; python my_package/setup.py install , but not for python setup.py bdist_rpm --post-install post-install.sh and rpm --install my_package.rpm .)

I think it would be best if your python dependencies were available as RPMs also, and declared as dependencies in the RPM. If they aren't available elsewhere, create them yourself, and put them in your yum repository.

Running PyPI installations as a side effect of RPM installation is evil, as it won't support proper uninstallation (ie uninstalling your RPM will remove your package, but leave the dependencies behind, with no proper removal procedure).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM