如何确保README.rst有效? [英] How to ensure that README.rst is valid?

查看:266
本文介绍了如何确保README.rst有效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的小工具有两个版本:

There are two version of my little tool:

  • https://pypi.python.org/pypi/tbzuploader/2017.11.0
  • https://pypi.python.org/pypi/tbzuploader/2017.12.0 Bug: The pypi page looks ugly.

在上次更新中,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?

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打包机构建议使用替代命令 孪生支票 。要安装麻线

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的其他功能时才需要安装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 in setup.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有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆