From 94a53f1d491f1e8b6c209fda50bc0204616962f4 Mon Sep 17 00:00:00 2001 From: Eric Joanis Date: Fri, 13 Dec 2024 17:23:04 -0500 Subject: [PATCH] docs: update readme-heroku.md to match the current reality --- readme-heroku.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/readme-heroku.md b/readme-heroku.md index 06f56443..678d1442 100644 --- a/readme-heroku.md +++ b/readme-heroku.md @@ -1,16 +1,26 @@ Our production Heroku deployment is controlled by the following files: - `Procfile`: tells Heroku what command to launch in each Dyno; - `runtime.txt`: tells Heroku which run-time engine to use (i.e., which version of Python); + - `requirements.txt`: tells Heroku what our production dependencies are; + - `bin/post_compile`: Heroku builds run this after doing `pip install -r requirements.txt`. - Heroku detects Python by default, but `runtime.txt` lets us specify/bump the version as needed; - - `requirements.txt`: tells Heroku what our production dependencies are. +Updating dependencies: + - Our dependencies are declared in `pyproject.toml`, edit this file to modify them. + - `requirements.txt` is a generated "lock" file. To update it, run: + + hatch env remove prod + rm requirements.txt + hatch env create prod + + It is also possible to edit it manually, e.g., to fix a critical vulnerability, + but an occasional full rebuild is a good idea to stay up to date. Updating `g2p`: - By default, `g2p` only gets updated for `readalong-studio` on Heroku when: - - we make a new release of `g2p` on PyPI - - we update `requirements.min.txt` here to ask for that release + - we make a new release of `g2p` on PyPI, **and** + - we update `requirements.txt` here to ask for that release - Manual override: it is also possible to update g2p to the current commit on the `main` branch using this procedure: - - Change `requirements.min.txt` to specify `g2p @ git+https://github.com/roedoejet/g2p@main`. + - Change `requirements.txt` to specify `g2p @ git+https://github.com/roedoejet/g2p@main`. - Commit that change to `main` in a sandbox connected to Heroku. - `git push heroku main` - This will force a build which will fetch the main branch of g2p from GitHub.