Skip to content

Commit 8f95399

Browse files
authored
chore(docs): add script type file example (#9572)
1 parent 9d9423e commit 8f95399

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

docs/pyproject.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,7 @@ for more information on other keys and specifying version ranges.
723723
### scripts
724724

725725
**Deprecated**: Use `project.scripts` instead.
726+
Use `[tool.poetry.scripts]` only for scripts of type "file", because those are not supported in `[project.scripts]`.
726727

727728
This section describes the scripts or executables that will be installed when installing the package
728729

@@ -737,7 +738,17 @@ Here, we will have the `my_package_cli` script installed which will execute the
737738
When a script is added or updated, run `poetry install` to make them available in the project's virtualenv.
738739
{{% /note %}}
739740

740-
### extras
741+
```toml
742+
[tool.poetry.scripts]
743+
my_executable = { reference = "some_binary.exe", type = "file" }
744+
```
745+
746+
This tells Poetry to include the specified file, relative to your project directory, in distribution builds. It will then be copied to the appropriate installation directory for your operating system when your package is installed.
747+
748+
* On Windows the file is placed in the `Scripts/` directory.
749+
* On *nix system the file is placed in the `bin/` directory.
750+
751+
### `extras`
741752

742753
**Deprecated**: Use `project.optional-dependencies` instead.
743754

0 commit comments

Comments
 (0)