Documentation improvements
continuous-integration/drone the build was successful Details

This commit is contained in:
Olivier 'reivilibre' 2021-10-24 15:07:07 +01:00
parent 0da228c5c9
commit 1dde1d0d6b
3 changed files with 37 additions and 1 deletions

View File

@ -18,7 +18,9 @@
- [Git Recipes](./recipes/filesystem/git.md)
- [Database Recipes](./recipes/database/index.md)
- [Postgres](./recipes/database/postgres.md)
- [Docker](./recipes/docker.md)
- [Environments](./recipes/environments/index.md)
- [Docker](./recipes/environments/docker.md)
- [Python](./recipes/environments/python.md)
- [Resources](./resources/index.md)
- [Filesystem Resources](./resources/filesystem.md)
- [Utensils]()

View File

@ -0,0 +1,34 @@
# 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"
```