我想用诗歌打包我的python代码。我已经设法制作了一个可以使用 pip 安装的 .whl,但是当我在 python 中导入它时,我无法访问任何功能。
这是我当前的pyproject.toml
文件:
[tool.poetry]
name = "package"
version = "0.1.0"
description = "package description"
authors = ["Andrew"]
packages = [{include = "package"}]
include = ["package/helper.py",
"package/scheduler.py"]
[tool.poetry.dependencies]
python = "^3.6"
[tool.poetry.dev-dependencies]
pytest = "^3.0"
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
在诗歌创建的包目录中有 3 个文件helper.py
:scheduler.py
和__init__.py
. 里面helper.py
有一个函数叫做adder(x,y)
.
我希望能够在 python 中调用这个函数,我必须如何修改我的 .toml 文件才能做到这一点?我尝试了各种包的变体并包含参数,但到目前为止没有任何效果。谢谢