Repository navigation
Packaging click app without setuptools #1714
Unanswered
NeoCortex97
asked this question in
Q&A
Replies: 1 comment
|
Use the standard For a small [project]
name = "click-demo"
version = "0.1.0"
requires-python = ">=3.12,<3.13"
dependencies = ["click>=8,<9"]
[project.scripts]
hello-demo = "click_demo.cli:main"
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[tool.pdm]
distribution = trueCreate an empty import click
@click.command()
@click.option("--name", default="world")
def main(name: str) -> None:
click.echo(f"Hello, {name}!")Then: pdm install
pdm run hello-demo --name Ada
pdm build --no-sdistI ran these with PDM 2.29.2 and Python 3.12.14. The command printed
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi, I wanted to use pdm to develop a cli app with click. And I would like my package to register commands for my app, but I don't know how.
Do you have any leads for me?
All reactions