這是我的 setup.py 的樣子:from distutils.core import setupsetup( author='...', description='...', download_url='...', license='...', long_description=open('README.md', 'r').read(), long_description_content_type='text/markdown', name='...', packages=['...'], url='...', version='...')然后,我可以python setup.py sdist毫無錯誤地運行。但是如果我用 twine ( ) 檢查包裹twine check dist/*,我會收到以下警告: `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`.我所有的包都是最新的,我沒有重復或多行屬性。是什么原因造成的,我該如何解決?
1 回答

www說
TA貢獻1775條經驗 獲得超8個贊
這是因為您正在使用distutils.core
. 改用setuptools
:
from setuptools import setup
distutils.core
不希望long_description_content_type
提供,并且似乎忽略了它。當你運行 setup.py 時,它實際上是這樣說的:
UserWarning: Unknown distribution option: 'long_description_content_type'
盡管這很容易被遺漏,因為它位于一長串原本沒有錯誤的日志的頂部。
添加回答
舉報
0/150
提交
取消