[英]twine: warning: `long_description_content_type` missing
This is what my setup.py looks like:这就是我的 setup.py 的样子:
from distutils.core import setup
setup(
author='...',
description='...',
download_url='...',
license='...',
long_description=open('README.md', 'r').read(),
long_description_content_type='text/markdown',
name='...',
packages=['...'],
url='...',
version='...'
)
Then, I can run python setup.py sdist
without any errors.然后,我可以运行
python setup.py sdist
没有任何错误。 But if I check the package with twine ( twine check dist/*
), I get the following warning:但是,如果我用麻线(
twine check dist/*
)检查 package,我会收到以下警告:
`long_description` has syntax errors in markup and would not be rendered on PyPI.
warning: `long_description_content_type` missing. defaulting to `text/x-rst`.
All of my packages are up to date, and I have no duplicate or multi-line attributes.我所有的包都是最新的,我没有重复或多行属性。 What is causing this, and how can I fix it?
是什么原因造成的,我该如何解决?
This is because you're using the setup function provided by distutils.core
.这是因为您使用的是
distutils.core
提供的设置 function 。 Use setuptools
instead:请改用
setuptools
:
from setuptools import setup
distutils.core
doesn't expect the long_description_content_type
to be provided, and seemingly ignores it. distutils.core
不希望提供long_description_content_type
,并且似乎忽略了它。 It actually says this when you run setup.py:当您运行 setup.py 时,它实际上是这样说的:
UserWarning: Unknown distribution option: 'long_description_content_type'
Although that's easy to miss, since it's at the top of a long block of otherwise error-free logs.尽管这很容易被忽略,因为它位于一长串无错误日志的顶部。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.