麻绳默认将“ long_description_content_type”设置为text / x-rst

问题描述

这是我的设置

setup(
    name="`...",version="...",description=...,long_description_content_type="text/markdown",long_description=README,author="...",classifiers=[...],packages=["..."],include_package_data=True,)

我使用以下命令打包我的项目

python setup.py sdist bdist_wheel 

但是我跑步时

twine check dist/*

我收到以下错误

Checking dist\Futshane_TBG-1.0.0-py3-none-any.whl: FAILED
  `long_description` has syntax errors in markup and would not be rendered on PyPI.
    line 9: Error: Unexpected indentation.
  warning: `long_description_content_type` missing. defaulting to `text/x-rst`.
Checking dist\Futshane_TBG-1.0.0.tar.gz: FAILED
  `long_description` has syntax errors in markup and would not be rendered on PyPI.
    line 9: Error: Unexpected indentation.
  warning: `long_description_content_type` missing. defaulting to `text/x-rst`.

当我显然提供了一个类型时,为什么无法识别提供的类型呢?

解决方法

我试图切换“ long_description_content_type”和“ long_description”参数的顺序,而不是将description参数分配给包含描述的变量,而是直接将其分配给描述。这样做已经解决了我的问题

setup(
    name="Futshane_TBG",version="1.0.0",description=""" The description of the package   """,long_description_content_type="text/markdown",long_description=README,url="https://github.com/ElLoko233/Text-Based-Game-Package",author="Lelethu Futshane",classifiers=["License :: OSI Approved :: MIT License","Programming Language :: Python :: 3","Programming Language :: Python :: 3.8"],packages=["TBG"],include_package_data=True,)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...