How to ensure that README.rst is valid?(如何确保 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 错误:pypi 页面看起来很丑.
- 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?换句话说,我想避免 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 有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何确保 README.rst 有效?
基础教程推荐
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- 筛选NumPy数组 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01