@@ -34,58 +34,26 @@ jobs:
3434 if : steps.changes.outputs.docs == 'true' || steps.changes.outputs.root_docs == 'true' || steps.changes.outputs.python_files == 'true'
3535 run : echo "PUBLISH=$(echo true)" >> $GITHUB_ENV
3636
37- - name : Set up Python ${{ matrix.python-version }}
38- uses : actions/setup-python@v3
39- with :
40- python-version : ${{ matrix.python-version }}
41-
42- - name : Get full Python version
43- id : full-python-version
44- if : env.PUBLISH == 'true'
45- shell : bash
46- run : echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
47-
4837 - name : Install poetry
4938 if : env.PUBLISH == 'true'
50- run : |
51- curl -O -sSL https://install.python-poetry.org/install-poetry.py
52- python install-poetry.py -y --version 1.1.14
53- echo "PATH=${HOME}/.poetry/bin:${PATH}" >> $GITHUB_ENV
54- rm install-poetry.py
39+ run : pipx install "poetry==1.1.14"
5540
56- - name : Add ~/.local/bin to PATH
57- run : echo "$HOME/.local/bin" >> $GITHUB_PATH
58-
59- - name : Get poetry cache paths from config
60- if : env.PUBLISH == 'true'
61- run : |
62- echo "poetry_cache_dir=$(poetry config --list | sed -n 's/.*cache-dir = //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV
63- echo "poetry_virtualenvs_path=$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV
64-
65- - name : Configure poetry
41+ - name : Set up Python ${{ matrix.python-version }}
42+ uses : actions/setup-python@v4
6643 if : env.PUBLISH == 'true'
67- shell : bash
68- run : poetry config virtualenvs.in-project true
69-
70- - name : Set up cache
71- uses : actions/cache@v3
72- id : cache
7344 with :
74- path : |
75- .venv
76- {{ env.poetry_cache_dir }}
77- {{ env.poetry_virtualenvs_path }}
78- key : venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
79-
80- - name : Ensure cache is healthy
81- if : steps.cache.outputs.cache-hit == 'true' && env.PUBLISH == 'true'
82- shell : bash
83- run : poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
45+ python-version : ${{ matrix.python-version }}
46+ cache : ' poetry'
8447
8548 - name : Install dependencies [w/ docs]
8649 if : env.PUBLISH == 'true'
8750 run : poetry install --extras "docs lint"
8851
52+ - name : Print python versions
53+ run : |
54+ python -V
55+ poetry run python -V
56+
8957 - name : Build documentation
9058 if : env.PUBLISH == 'true'
9159 run : |
0 commit comments