Configure Python apps¶
The python_apps state file performs common operations for Python apps. In your app’s state file, include it with:
include:
- python_apps
If you already have an include state, add python_apps to its list.
Add basic configuration¶
In the server’s Pillar file, add, for example:
python_apps:
kingfisher_summarize:
user: summarize
git:
url: https://github.com/open-contracting/kingfisher-summarize.git
branch: main
target: kingfisher-summarize
This will:
Install packages for creating Python virtual environments
Fetch the git repository into the
targetdirectory within the home directory of theuserInitialize a virtual environment in a
.vedirectory within the repository’s directoryInstall
requirements.txtwithuv pip syncfrom uv
Add configuration files¶
To create configuration files within the user’s .config directory, add, for example:
python_apps:
kingfisher_summarize:
user: summarize
git:
url: https://github.com/open-contracting/kingfisher-summarize.git
branch: main
target: kingfisher-summarize
config:
kingfisher-summarize/logging.json: salt://kingfisher/summarize/files/logging.json
You can add as many configuration files as you like.