我想使用诗歌工具创建一个空的(元)包,主要是为了简化将依赖项列表组合在一起的过程。如果我按如下方式创建我的 project.toml:
[build-system]
requires = ["poetry"]
[tool.poetry]
name = "metapackage"
version = "1.0.0"
description = "My empty metapackage"
authors = ["Me"]
license = "MIT"
[tool.poetry.dependencies]
numpy = "*"
然后执行poetry build
,我得到一个错误:
$ mkdir -p metapackage
$ python -m poetry build --no-interaction --format wheel -vvvUsing virtualenv: /Users/duncan/opt/miniconda3/envs/py37
Building metapackage (1.0.0)
[ValueError]
metapackage is not a package.
Traceback (most recent call last):
File "/Users/duncan/opt/miniconda3/envs/py37/lib/python3.7/site-packages/clikit/console_application.py", line 131, in run
status_code = command.handle(parsed_args, io)
File "/Users/duncan/opt/miniconda3/envs/py37/lib/python3.7/site-packages/clikit/api/command/command.py", line 120, in handle
status_code = self._do_handle(args, io)
File "/Users/duncan/opt/miniconda3/envs/py37/lib/python3.7/site-packages/clikit/api/command/command.py", line 171, in _do_handle
return getattr(handler, handler_method)(args, io, self)
File "/Users/duncan/opt/miniconda3/envs/py37/lib/python3.7/site-packages/cleo/commands/command.py", line 92, in wrap_handle
return self.handle()
File "/Users/duncan/opt/miniconda3/envs/py37/lib/python3.7/site-packages/poetry/console/commands/build.py", line 30, in handle
builder.build(fmt)
File "/Users/duncan/opt/miniconda3/envs/py37/lib/python3.7/site-packages/poetry/masonry/builder.py", line 19, in build
builder = self._FORMATS[fmt](self._poetry, self._env, self._io)
File "/Users/duncan/opt/miniconda3/envs/py37/lib/python3.7/site-packages/poetry/masonry/builders/wheel.py", line 44, in __init__
super(WheelBuilder, self).__init__(poetry, env, io)
File "/Users/duncan/opt/miniconda3/envs/py37/lib/python3.7/site-packages/poetry/masonry/builders/builder.py", line 68, in __init__
includes=self._package.include,
File "/Users/duncan/opt/miniconda3/envs/py37/lib/python3.7/site-packages/poetry/masonry/utils/module.py", line 72, in __init__
source=package.get('from'),
File "/Users/duncan/opt/miniconda3/envs/py37/lib/python3.7/site-packages/poetry/masonry/utils/package_include.py", line 15, in __init__
self.check_elements()
File "/Users/duncan/opt/miniconda3/envs/py37/lib/python3.7/site-packages/poetry/masonry/utils/package_include.py", line 61, in check_elements
raise ValueError('{} is not a package.'.format(root.name))
我是否遗漏了一些东西来告诉诗歌这个包裹没有内容?
附录:我很乐意使用诗歌作为创建一个.dist-info
包含元数据的目录的方法,以便pip
看到已安装的元数据包,如果有更好的工具,我很乐意切换。