From a12d0bc916b26c971edd9e5b8455af7f0e76eff0 Mon Sep 17 00:00:00 2001 From: baggiponte <57922983+baggiponte@users.noreply.github.com> Date: Fri, 8 Mar 2024 00:08:26 +0100 Subject: [PATCH] docs: add admonition about tool.pdm.scripts vs project.scripts (#2673) --- docs/docs/usage/scripts.md | 3 +++ news/2121.docs.md | 1 + 2 files changed, 4 insertions(+) create mode 100644 news/2121.docs.md diff --git a/docs/docs/usage/scripts.md b/docs/docs/usage/scripts.md index 2e0374cd5e..f91c101c37 100644 --- a/docs/docs/usage/scripts.md +++ b/docs/docs/usage/scripts.md @@ -14,6 +14,9 @@ It will run `flask run -p 54321` in the environment that is aware of packages in PDM also supports custom script shortcuts in the optional `[tool.pdm.scripts]` section of `pyproject.toml`. +!!! NOTE + The `[tool.pdm.scripts]` directory must not be confused with `[project.scripts]`. The latter is used to install a command as part of your package, as explained [here](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#creating-executable-scripts). + You can then run `pdm run ` to invoke the script in the context of your PDM project. For example: ```toml diff --git a/news/2121.docs.md b/news/2121.docs.md new file mode 100644 index 0000000000..b9ed079c29 --- /dev/null +++ b/news/2121.docs.md @@ -0,0 +1 @@ +Document the difference between `[tool.pdm.scripts]` and `[project.scripts]`