【发布时间】:2019-08-20 16:28:30
【问题描述】:
我将一个包上传到 pypi.org,但我的 RST README 格式不正确。
这是它在 GitHub 上的样子:https://github.com/NinjaSnail1080/akinator.py
这是 PyPi 上的样子:https://pypi.org/project/akinator.py/
出于某种原因,在 GitHub 上,所有内容的格式都正确,但在 PyPi 上,它根本没有格式化。它没有显示 RST 格式的 README,而是完全乱七八糟的未格式化文本。
我尝试在我的项目上运行 python3 -m twine check dist/* 并得到了这个:
Checking distribution dist/akinator.py-1.0.3.dev3-py3-none-any.whl: warning: `long_description_content_type` missing. defaulting to `text/x-rst`.
Failed
The project's long_description has invalid markup which will not be rendered on PyPI. The following syntax errors were detected:
line 26: Error: Unexpected indentation.
Checking distribution dist/akinator.py-1.0.3.dev3.tar.gz: warning: `long_description_content_type` missing. defaulting to `text/x-rst`.
Failed
The project's long_description has invalid markup which will not be rendered on PyPI. The following syntax errors were detected:
line 26: Error: Unexpected indentation.
line 26: Error: Unexpected indentation.
由于某种原因,它说long_description_content_type 丢失了,这是不真实的。我的 setup.py 文件专门写了long_description_content_type="text/x-rst"。它还在long description 的第 26 行提到了意外的缩进,但该行根本没有缩进。
我完全不知道我在这里做错了什么。不知何故,它在 GitHub 上看起来非常好,但在 PyPi 上,它只是一团糟。 twine check 给我的警告没有任何意义。
【问题讨论】:
-
尝试升级
setuptools并重新生成发行版。
标签: python pypi python-packaging twine