I think I'm missing something simple
I have a python poetry application:
name = "my-first-api"
version = "0.1.0"
description = ""
readme = "README.md"
packages = [{include = "application"}]
[tool.poetry.scripts]
start = "main:start"
[tool.poetry.dependencies]
python = ">=3.10,<3.12"
pip= "23.0.1"
setuptools="65.5.0"
fastapi="0.89.1"
uvicorn="0.20.0"
[tool.poetry.group.dev.dependencies]
pyinstaller = "^5.10.1"
pytest = "^7.3.1"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
I can run this and build this using Poetry, however, I would like to be able to create the executable with a poetry script as well.
Now I build it like this:
poetry run pyinstaller main.py --collect-submodules application --onefile --name myapi
I would like something like
poetry package
to automatically create this executable as well. How do I hook that up?
Btw. ths does not work :(
[tool.poetry.scripts]
start = "main:start"
builddist = "poetry run pyinstaller main.py --collect-submodules application --onefile --name myapi"
tar.gz
and thewhl
, this is only a problem if you also wanna distribute your program such that it is also installable with pip – Choanocyte