All checks were successful
continuous-integration/drone the build was successful
35 lines
1.6 KiB
Markdown
35 lines
1.6 KiB
Markdown
# Python
|
|
|
|
Python is a programming language. Scone supports creating virtual Python environments to isolate dependencies.
|
|
|
|
| Recipe | Needs | Provides |
|
|
| -----: | ----- | -------- |
|
|
| [`python-venv`](#python-venv) | `directory` | `directory` `file`? `directory`? |
|
|
|
|
|
|
## `python-venv`
|
|
|
|
Creates a Python virtual environment, installing the specified dependencies.
|
|
|
|
**Provides:** `directory({dir})` and `file({dir})/bin/python`. In the future, there may be the ability to check for (and expose) other executables in the venv.
|
|
|
|
| Argument | Accepted Values | Default | Description |
|
|
| -------: | --------------- | ------- | ----------- |
|
|
| dir | path | *required* | This is the directory to create the virtual environment in. |
|
|
| interpreter | string or path | *required* | This specifies the desired virtual interpreter. Usually this is `python3`. |
|
|
| install | list of requirements | *required* | This is a list of Python dependencies to install. You should specify `dir /path/to/dir` for directories, `git /path/to/dir` for local git repositories and `-r /path/to/requirements.txt` for requirements files. |
|
|
|
|
`dir` and `git` requirements are currently synonymous and ensure that the venv will keep up to date using the specified directory. For now, `python-venv` is unable to cache execution if directories are in use (though this is rarely a problem). Use of the `git` keyword should be preferred for git repositories as that may allow for better performance in the future.
|
|
|
|
### Example
|
|
|
|
```scoml
|
|
[[python-venv]]
|
|
dir = "/home/abc/venv"
|
|
interpreter = "python3"
|
|
install:
|
|
- "dir /home/abc/abc"
|
|
- "-r /home/abc/requirements.txt"
|
|
- "hypercorn"
|
|
```
|