python – 在尝试发布新的软件包版本时,如何解决pypi的500响应问题?

我正在尝试向pypi发布新版本的软件包.这是使用
python 2.7,我目前的目标是使用pythons 2.6 / 2.7进行消费.

该软件包的当前版本为0.0.2-1. (-1是我在某处读到的构建标记约定;我正在改变这种做法,将b用于beta,这更相关.)

基本上,如果我有版本(在setup()调用中)和build标签(来自setup.cfg)的组合,而不是pypi上已有的当前版本,则register和upload命令都会失败:

ethan@walrus:~/source/python-mandrel$python setup.py register
running register
running egg_info
writing requirements to mandrel.egg-info/requires.txt
writing mandrel.egg-info/PKG-INFO
writing top-level names to mandrel.egg-info/top_level.txt
writing dependency_links to mandrel.egg-info/dependency_links.txt
writing entry points to mandrel.egg-info/entry_points.txt
reading manifest file 'mandrel.egg-info/SOURCES.txt'
writing manifest file 'mandrel.egg-info/SOURCES.txt'
running check
Registering mandrel to http://pypi.python.org/pypi
Server response (500): There's been a problem with your request

这是版本0.0.3和b的构建标记.

但是,如果我应用此补丁:

--- a/setup.cfg
+++ b/setup.cfg
@@ -1,3 +1,3 @@
 [egg_info]
-tag_build = b
+tag_build = -1

diff --git a/setup.py b/setup.py
index 14761cf..beb8278 100644
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ import os

 setup(
     name = "mandrel",
-    version = "0.0.3",
+    version = "0.0.2",
     author = "Ethan Rowe",
     author_email = "ethan@the-rowes.com",
     description = ("Provides bootstrapping for sane configuration management"),

然后注册调用(并可能是上传)将成功:

ethan@walrus:~/source/python-mandrel$python setup.py register
running register
...
running check
Registering mandrel to http://pypi.python.org/pypi
Server response (200): OK

如果我将构建标记更改为-2,那么注册调用将再次失败.这表明失败与pypi尚未知道的任何完整版本字符串有关.

不幸的是,当服务器以500代码响应时,使用上传时的–show-response选项是无用的. distutils的upload命令仅报告服务器遇到错误的事实,没有任何用处继续.

有关我可能采取哪些措施进行故障排除的任何建议?

最佳答案 我也有500错误,其中诊断的问题在于:
https://sourceforge.net/tracker/index.php?func=detail&aid=3573564&group_id=66150&atid=513503.

我用pdb调试了它.显然,show-response选项并没有真正以有用的方式实现.我在我的Python dist中,在第291行的distutils / command / register.py中放了一个“import pdb; pdb.set_trace()”,在我的发行版中是在post_to_server()方法中.我在那里做了“print req.data”,然后通过它“next”,以便查看异常catch中安装的响应.

点赞