From ce207c8817be230ca9aa568013514b0cdcf0279b Mon Sep 17 00:00:00 2001 From: Melvyn Sopacua <78786958+melvyn-oviavo@users.noreply.github.com> Date: Sat, 27 Mar 2021 16:12:34 +0100 Subject: [PATCH] doc(python-pipenv): Add run example Using the cache is only effective when not using install as it will run `pipenv --rm` if it detects an old environment. On top of that, pip is a lot faster at detecting satisfied requirements. --- examples.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples.md b/examples.md index ac4630d..4663938 100644 --- a/examples.md +++ b/examples.md @@ -417,6 +417,15 @@ jobs: ${{ runner.os }}-pipenv- ``` +To use the cache effectively: +```yaml +- name: Install packages + run: | + pipenv --venv && \ + (pipenv lock -r |cat - ci-requirements.txt|pipenv run pip install -r /dev/stdin) || \ + (pipenv install --python ${{ matrix.python-version }} --deploy) +``` + ## R - renv For renv, the cache directory will vary by OS. Look at https://rstudio.github.io/renv/articles/renv.html#cache