Livingdeadの日記: Pythonのパッケージ配布にはsetuptoolsの代わりにdistributeを使うべきなのか?
Pythonにはパッケージを配布するための仕組みであるdistutilsが標準で用意されている。setuptoolsパッケージはdistutilsを強化するものである。setuptoolsを入れるとdistutilsのsetup()関数に与えられるパラメータが強化されたり、egg形式でのパッケージ配布が可能になったり、easy_setupと呼ばれるコマンドラインツールが使えるようになったりする。
setuptools is a collection of enhancements to the Python distutils (for Python 2.3.5 and up on most platforms; 64-bit platforms require a minimum of Python 2.4) that allow you to more easily build and distribute Python packages, especially ones that have dependencies on other packages.
setuptools - The PEAK Developers' Center
とまぁここまでは既知なのだが、最近setuptoolsに代わってpipを使うといいよと教えられた。
pip is a replacement for easy_install. It uses mostly the same techniques for finding packages, so packages that were made easy_installable should be pip-installable as well.
pip — pip v0.6.1 documentation
pip って何(・ω・ )Commentsに書いてあるとおりパッケージを持ち運んだりするのに便利そうだし、パッケージのアンインストール機能もあるようだ。まぁそもそもsetuptoolsにアンインストールの機能がないのがなぜだって話だったのだが(正確に言えばインストールしたパッケージを構成するファイルの一覧は取得できるので手動でのアンインストールはできる)。しかぁし、残念ながらWindows環境ではあまりテストされていないようだ。私はPythonをクロスプラットフォームで使いまくりなので、easy_installからpipに完全に乗り換えるというわけにはまだ行かないようだ。
Maybe it doesn’t work on Windows. At least, the author doesn’t test on Windows often.
pip — pip v0.6.1 documentation
Pythonのパッケージ配布にはsetuptoolsの代わりにdistributeを使うべきなのか? More ログイン