@@ -34,58 +34,26 @@ jobs:
34
34
if : steps.changes.outputs.docs == 'true' || steps.changes.outputs.root_docs == 'true' || steps.changes.outputs.python_files == 'true'
35
35
run : echo "PUBLISH=$(echo true)" >> $GITHUB_ENV
36
36
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
-
48
37
- name : Install poetry
49
38
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"
55
40
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
66
43
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
73
44
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'
84
47
85
48
- name : Install dependencies [w/ docs]
86
49
if : env.PUBLISH == 'true'
87
50
run : poetry install --extras "docs lint"
88
51
52
+ - name : Print python versions
53
+ run : |
54
+ python -V
55
+ poetry run python -V
56
+
89
57
- name : Build documentation
90
58
if : env.PUBLISH == 'true'
91
59
run : |
0 commit comments