Nin*_*080 6 python pypi python-packaging twine
我上传了一个包到 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.
Run Code Online (Sandbox Code Playgroud)
出于某种原因,它说long_description_content_type缺少,这是不真实的。我的 setup.py 文件专门说long_description_content_type="text/x-rst". 它还在 的第 26 行提到了意外的缩进long description,但该行中根本没有缩进。
我完全不知道我在这里做错了什么。不知何故,它在 GitHub 上看起来非常好,但在 PyPi 上,它只是一团糟。twine check给我的警告没有任何意义。
问题是您将整个许可证包含在该License字段中,但该字段应该只是许可证的简短描述或名称——它不应包含换行符。
这将产生以下元数据:
Metadata-Version: 2.1
Name: akinator.py
Version: 1.0.3.dev2
Summary: An API wrapper for the online game, Akinator, written in Python
Home-page: https://github.com/NinjaSnail1080/akinator.py
Author: NinjaSnail1080
Author-email: innuganti.ashwin@gmail.com
License: MIT License
Copyright (c) 2019 NinjaSnail1080
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Run Code Online (Sandbox Code Playgroud)
第一个换行符之后的所有内容都被解释为Long-Description.
要解决这个问题,只需 setlicense="MIT"或完全省略它——它是可选的,并且您已经在分类器列表中拥有它。
这里有一个突出的错误可以解决这个setuptools问题:https : //github.com/pypa/setuptools/issues/1390
| 归档时间: |
|
| 查看次数: |
1489 次 |
| 最近记录: |