我的小工具有两个版本:
There are two version of my little tool:
在上次更新中,README.rst 中的更改会发出警告:
In the last update a change in README.rst cases a warning:
user@host> rst2html.py README.rst > /tmp/foo.html
README.rst:18: (WARNING/2) Inline emphasis start-string without end-string.
README.rst:18: (WARNING/2) Inline emphasis start-string without end-string.
现在 pypi 页面看起来很丑:-(
Now the pypi page looks ugly :-(
我用这个食谱做 CI,bumpversion,上传到 pypi:https://github.com/guettli/github-travis-bumpversion-pypi
I use this recipe to do CI, bumpversion, upload to pypi: https://github.com/guettli/github-travis-bumpversion-pypi
如何确保不再发布损坏的 README.rst?换句话说,我想避免 pypi 页面看起来很丑.
How could I ensure that no broken README.rst gets released any more? With other words I want to avoid that the pypi page looks ugly.
亲爱的细节爱好者:请不要查看 README.rst 中当前的特定错误.那不是问题:-)
Dear detail lovers: Please don't look into the current particular error in the README.rst. That's is not the question :-)
更新
截至 2018 年 9 月 21 日,Python 打包机构推荐了一个替代命令 tine检查
.安装 twine:
As of Sep 21, 2018, the Python Packaging Authority recommends an alternative command twine check
. To install twine:
pip install twine
twine check dist/*
请注意,twine 需要 readme_renderer
.你仍然可以使用 readme_renderer
,如果你想要它的其他功能,你只需要安装 twine,如果你要发布到 PyPI,这无论如何都是个好主意.
Note that twine requires readme_renderer
. You could still use readme_renderer
, and you only need to install twine if you want its other features, which is a good idea anyway if you are releasing to PyPI.
来自官方 Python 打包文档,上传你的项目到 PyPI:
From the official Python packaging docs, Uploading your Project to PyPI:
提示: PyPI 上使用的 reStructuredText 解析器不是 Sphinx!此外,为了确保所有用户的安全,某些类型的 URL 和指令被禁止或去除(例如,.. raw::
指令).在尝试上传您的发行版之前,您应该检查您在 setup.py
中提供的简短/长描述是否有效.您可以按照 pypa/readme_renderer 工具的说明进行操作.
Tip: The reStructuredText parser used on PyPI is not Sphinx! Furthermore, to ensure safety of all users, certain kinds of URLs and directives are forbidden or stripped out (e.g., the
.. raw::
directive). Before trying to upload your distribution, you should check to see if your brief / long descriptions provided insetup.py
are valid. You can do this by following the instructions for the pypa/readme_renderer tool.
从那个工具的README.rst
:
要在本地检查您的详细描述,只需使用以下命令安装 readme_renderer
库:
To check your long description's locally simply install the
readme_renderer
library using:
$ pip install readme_renderer
$ python setup.py check -r -s
这篇关于如何确保 README.rst 有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!