我使用 typer 在 python 中创建了一个 cli 应用程序,但我不想调用
py main.py
,而是想使用命令 starfish
来调用该程序。过去我使用诗歌包装创建并发布了 cli 应用程序,但这次我遇到了问题。
pyproject.toml
[tool.poetry]
name = "starfish"
version = "0.1.0"
description = "A python based File Transfer Protocol(FTP) program."
authors = ["777advait"]
license = "MIT License"
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.9"
rich = "^13.3.4"
questionary = "^1.10.0"
bcrypt = "^4.0.1"
typer = "^0.7.0"
scapy = "^2.5.0"
[tool.poetry.scripts]
starfish="starfish.main:run"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
尝试
poetry run starfish
或使用
poetry shell
输入诗歌 venv,然后只需 starfish