我编写了这个命令来检查setup.py中的长描述。
python setup.py --long-description | rst2html.py > output.html但它会打印这条信息。
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr我打开output.html,但output.html是白皮书。
我的环境是windows上的Python2.7.5。
请给我建议。
setup.py
from distutils.core import setup
setup(
name = "test",
version = "0.1",
author = "test",
author_email = "test@test.com",
url = "test.com"
packages = ["test"],
license = "MIT License",
description = "test",
long_description = """
====
test
====
""",
classifiers = [
"Programming Language :: Python"
]
)发布于 2014-03-23 02:04:17
这个问题是通过
<Path to setup.py> pip install docutils不会出现错误。
但是output.html仍然是白皮书。
发布于 2014-03-22 13:46:10
您的setup.py中缺少一个逗号
url = "test.com"
packages = ["test"],应该是
url = "test.com",
packages = ["test"],此外,您的描述是缩进的,这破坏了rst。要么使用textwrap.dedent,要么不要缩进它,如下所示:
from distutils.core import setup
long_description = """
test
====
fooo
"""
setup(
name="test",
version="0.1",
author="test",
author_email="test@test.com",
url="test.com",
packages=["test"],
license="MIT License",
description="test",
long_description=long_description,
classifiers=[
"Programming Language :: Python"
]
)https://stackoverflow.com/questions/22577902
复制相似问题