<p><strong>更新</strong></p>
<p>截至2018年9月21日,Python打包机构建议使用一个替代命令<a href="https://github.com/pypa/twine#twine-check" rel="nofollow noreferrer">^{<cd1>}</a>。致<a href="https://github.com/pypa/twine#installation" rel="nofollow noreferrer">install twine</a>:</p>
<pre><code>pip install twine
twine check dist/*
</code></pre>
<p>注意<a href="https://github.com/pypa/twine/blob/77b5c75bd683366bcc475e7ae460b1adb79102b4/setup.py#L74" rel="nofollow noreferrer">twine requires ^{<cd2>}</a>。您仍然可以使用<code>readme_renderer</code>,并且您只需要在需要twine的其他特性时安装twine,如果您要发布到PyPI,这是一个好主意。在</p>
<hr/>
<p>来自官方的Python打包文档,<a href="https://packaging.python.org/tutorials/distributing-packages/#uploading-your-project-to-pypi" rel="nofollow noreferrer">Uploading your Project to PyPI</a>:</p>
<blockquote>
<p><strong>Tip:</strong> The reStructuredText parser used on PyPI is <strong>not</strong> Sphinx! Furthermore, to ensure safety of all users, certain kinds of URLs and directives are forbidden or stripped out (e.g., the <code>.. raw::</code> directive). <strong>Before</strong> trying to upload your distribution, you should check to see if your brief / long descriptions provided in <code>setup.py</code> are valid. You can do this by following the instructions for the <a href="https://github.com/pypa/readme_renderer" rel="nofollow noreferrer">pypa/readme_renderer</a> tool.</p>
</blockquote>
<p>从这个工具的<code>README.rst</code>:</p>
<blockquote>
<p>To check your long description's locally simply install the <code>readme_renderer</code> library using:</p>
</blockquote>
^{pr2}$