5

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

4

1 に答える 1

7

Python の依存関係が RPM としても利用可能であり、RPM で依存関係として宣言されていることが最善だと思います。他の場所で入手できない場合は、自分で作成し、yum リポジトリーに配置します。

RPM インストールの副作用として PyPI インストールを実行することは、適切なアンインストールをサポートしないため、悪いことです (つまり、RPM をアンインストールするとパッケージは削除されますが、依存関係はそのまま残り、適切な削除手順はありません)。

于 2009-08-11T18:55:22.327 に答える