【发布时间】:2021-12-12 00:10:03
【问题描述】:
我正在关注a tutorial 开发 Python 包。在本教程中,他们展示了如何设置基本的setup.cfg 文件,如下所示。
[metadata]
name = example-pkg-YOUR-USERNAME-HERE
version = 0.0.1
author = Example Author
author_email = author@example.com
description = A small example package
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/pypa/sampleproject
project_urls =
Bug Tracker = https://github.com/pypa/sampleproject/issues
classifiers =
Programming Language :: Python :: 3
License :: OSI Approved :: MIT License
Operating System :: OS Independent
[options]
package_dir =
= src
packages = find:
python_requires = >=3.6
[options.packages.find]
where = src
我的问题与这部分有关。
package_dir =
= src
我不明白为什么这会延伸到多行。当我用单行 package_dir = src 替换这两行时,我在尝试构建时发现以下错误。
distutils.errors.DistutilsOptionError: Unable to parse option value to dict: src
ERROR Backend subproccess exited when trying to invoke get_requires_for_build_sdist
多行或赋值运算符的明显必要性是怎么回事?
【问题讨论】:
标签: python setuptools python-packaging