python - 如何在制作模块时在 python setup.py 中附加 Readme.md 之类的文件
问题描述
我正在尝试升级一个名为 computerpeak 的模块,我想将 Readme.md 附加到我的模块但我无法附加它
我尝试使用
Long_Description: file: 'Readme.md',
但我没有工作,我只是展示了
Readme.md
在详细描述区域
解决方案
这应该工作
from setuptools import setup
# read the contents of your README file
from pathlib import Path
this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text()
setup(
name='an_example_package',
# other arguments omitted
long_description=long_description,
long_description_content_type='text/markdown'
)
来源:https ://packaging.python.org/guides/making-a-pypi-friendly-readme/
推荐阅读
- reactjs - 为什么一个 axios 解决方案有效,而另一个无效?
- javascript - 如何从数据库导入数据并将其存储在 node.js 应用程序的变量中以供以后使用
- path - Julia:尝试设置值时未定义 JULIA_LOAD_PATH
- powerbi-desktop - Power BI - KPI 视觉对象中的动态“目标”标签
- javascript - 基于数组渲染单选按钮
- automated-tests - WinAppDriver - Windows 应用程序启动时带有额外的登录屏幕,我无法打开登录屏幕
- python - 如何停止两个任务之一
- ruby - 如何从托管 nexpose 实例的 Windows 服务器执行 nexpose 票务 gem 脚本?
- vba - 尝试使用 VBA 在 Word 表格中的文本之后插入图像
- c# - 使用 OfficeOpenXml.Core.ExcelPackage 将 ExcelWorksheet 附加到工作簿中