Python Package Index

パッケージを登録する

事前にPyPIにアカウントを登録しておきます。

$ python setup.py register
$ python setup.py sdist
$ python setup.py upload

setup.pyのデバッグ

環境変数 DISTUTILS_DEBUG を空文字以外で定義すると setup.py実行時のログが標準出力に出力されるようになります。

$ export DISTUTILS_DEBUG=True

ハマるところ

Upload failed (403): You are not allowed to edit ‘...’ package information

(common)$ python setup.py sdist upload
options (after parsing config files):
options (after parsing command line):
option dict for 'aliases' command:
  {}
option dict for 'sdist' command:
  {}
option dict for 'upload' command:
  {}
running sdist
Distribution.get_command_obj(): creating 'sdist' command object
running egg_info
Distribution.get_command_obj(): creating 'egg_info' command object
writing ....egg-info/PKG-INFO
writing top-level names to ....egg-info/top_level.txt
writing dependency_links to ....egg-info/dependency_links.txt
Distribution.get_command_obj(): creating 'build_py' command object
Distribution.get_command_obj(): creating 'build' command object
reading manifest file '....egg-info/SOURCES.txt'
include_pattern: applying regex r'^...\.egg\-info/.*[^/]*\Z(?ms)'
 adding ....egg-info/dependency_links.txt
 adding ....egg-info/not-zip-safe
 adding ....egg-info/PKG-INFO
 adding ....egg-info/SOURCES.txt
 adding ....egg-info/top_level.txt
exclude_pattern: applying regex r'^build/.*'
exclude_pattern: applying regex r'^...\-1\.0\.0/.*'
exclude_pattern: applying regex r'\/(RCS|CVS|\.svn)\/'
writing manifest file '....egg-info/SOURCES.txt'
running check
Distribution.get_command_obj(): creating 'check' command object
creating ...-1.0.0
creating ...-1.0.0/....egg-info
making hard links in ...-1.0.0...
hard linking README -> ...-1.0.0
hard linking ....py -> ...-1.0.0
hard linking setup.py -> ...-1.0.0
hard linking ....egg-info/PKG-INFO -> ...-1.0.0/....egg-info
hard linking ....egg-info/SOURCES.txt -> ...-1.0.0/....egg-info
hard linking ....egg-info/dependency_links.txt -> ...-1.0.0/....egg-info
hard linking ....egg-info/not-zip-safe -> ...-1.0.0/....egg-info
hard linking ....egg-info/top_level.txt -> ...-1.0.0/....egg-info
Writing ...-1.0.0/setup.cfg
Creating tar archive
removing '...-1.0.0' (and everything under it)
running upload
Distribution.get_command_obj(): creating 'upload' command object
Submitting dist/...-1.0.0.tar.gz to http://pypi.python.org/pypi
Upload failed (403): You are not allowed to edit '...' package information
(common)$

おそらくsetup.pyのclassifiersの値が正しくないか不足しています。 発生時は blockdiagsetup.py を参考に修正しました。

Server response (401): basic auth failed

(common)$ python setup.py register
running register
running egg_info
writing ....egg-info/PKG-INFO
writing top-level names to ....egg-info/top_level.txt
writing dependency_links to ....egg-info/dependency_links.txt
reading manifest file '....egg-info/SOURCES.txt'
writing manifest file '....egg-info/SOURCES.txt'
running check
Registering ... to http://pypi.python.org/pypi
Server response (401): basic auth failed

よくわかりませんが、新規に作成した全てのアカウントが上記エラーにより使用不能でした。 仕方がないので古いアカウントを代替えで使用しました。

inserted by FC2 system