Skip to content

Commit

Permalink
docs: add admonition about tool.pdm.scripts vs project.scripts (#2673)
Browse files Browse the repository at this point in the history
  • Loading branch information
baggiponte authored Mar 7, 2024
1 parent 1bf5eb1 commit a12d0bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/docs/usage/scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <script_name>` to invoke the script in the context of your PDM project. For example:

```toml
Expand Down
1 change: 1 addition & 0 deletions news/2121.docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Document the difference between `[tool.pdm.scripts]` and `[project.scripts]`

0 comments on commit a12d0bc

Please sign in to comment.