long_description只包含第一行自述文件.rs

2024-05-15 06:21:23 发布

您现在位置:Python中文网/ 问答频道 /正文

我对自述文件.rst用于打包此模块的文件。我查了很多这样的帖子,但没有发现任何有用的东西。在

目前,我正在使用一个非常简单的自述文件进行测试

pytelemetry
===========

pytelemetry enables remote monitoring and control of embedded
devices. Specifically, pytelemetry implements a custom communication
protocol, based on the PubSub messaging pattern.

下面是对设置.py文件

^{pr2}$

我用python setup.py bdist_wheel构建包。使用Python3.5.1,wheels 0.24.0和0.29.0。 print(long_description)工作得非常好,但是当我解压缩生成的轮子时说明.rst文件(我认为应该包含详细说明)只包含:

pytelemetry

对应于我的第一行自述文件.rst. 在pypi上,我得到相同的输出。为什么我最后只有自述的第一行呢?在

  • 我这样想对吗rst描述包含任何给予的东西设置.py在长永描述中?在
  • 我怎样才能解决这个问题?在
  • 以后如何调试类似的问题?在

Tags: 模块and文件ofpyremote自述文件rst
1条回答
网友
1楼 · 发布于 2024-05-15 06:21:23

哇,这是个愚蠢的问题。在

失败的脚本是

try:
    long_description = pypandoc.convert('README.md', 'rst')
except OSError:
    print("Pandoc not found. Long_description conversion failure.")
    import io
    # pandoc is not installed, fallback to using raw contents
    with io.open('README.md', encoding="utf-8") as f:
        long_description = f.read()

我加了一句话:

^{pr2}$

现在,如果我解压缩生成的轮子,我可以看到我完整的自述文件说明.rst! 是啊。 但我不确定是什么导致了这个问题,或者是pypandoc或setup函数有问题。在

为了找到这个解决方案,我简单地找到了pypandoc回购和had a look at their setup.py file,这正是解决问题的方法。在

相关问题 更多 >

    热门问题