@@ -34,61 +34,24 @@ 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- if : env.PUBLISH == 'true'
40- with :
41- python-version : ${{ matrix.python-version }}
42-
43- - name : Get full Python version
44- id : full-python-version
45- shell : bash
46- if : env.PUBLISH == 'true'
47- run : echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
48-
4937 - name : Install poetry
50- if : env.PUBLISH == 'true'
51- run : |
52- curl -O -sSL https://install.python-poetry.org/install-poetry.py
53- python install-poetry.py -y --version 1.1.14
54- echo "PATH=${HOME}/.poetry/bin:${PATH}" >> $GITHUB_ENV
55- rm install-poetry.py
56-
57- - name : Add ~/.local/bin to PATH
58- run : echo "$HOME/.local/bin" >> $GITHUB_PATH
59- if : env.PUBLISH == 'true'
38+ run : pipx install "poetry==1.1.14"
6039
61- - name : Get poetry cache paths from config
62- if : env.PUBLISH == 'true'
63- run : |
64- echo "poetry_virtualenvs_path=$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV
65- echo "poetry_virtualenvs_path=$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV
66-
67- - name : Configure poetry
68- shell : bash
69- if : env.PUBLISH == 'true'
70- run : poetry config virtualenvs.in-project true
71-
72- - name : Set up cache
73- uses : actions/cache@v3
74- if : env.PUBLISH == 'true'
75- id : cache
40+ - name : Set up Python ${{ matrix.python-version }}
41+ uses : actions/setup-python@v4
7642 with :
77- path : |
78- .venv
79- {{ env.poetry_cache_dir }}
80- {{ env.poetry_virtualenvs_path }}
81- key : venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
82-
83- - name : Ensure cache is healthy
84- if : steps.cache.outputs.cache-hit == 'true' && env.PUBLISH == 'true'
85- shell : bash
86- run : poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
43+ python-version : ${{ matrix.python-version }}
44+ cache : ' poetry'
8745
8846 - name : Install dependencies [w/ docs]
8947 if : env.PUBLISH == 'true'
9048 run : poetry install --extras "docs lint"
9149
50+ - name : Print python versions
51+ run : |
52+ python -V
53+ poetry run python -V
54+
9255 - name : Build documentation
9356 if : env.PUBLISH == 'true'
9457 run : |
0 commit comments