@@ -34,61 +34,24 @@ 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
- 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
-
49
37
- 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"
60
39
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
76
42
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'
87
45
88
46
- name : Install dependencies [w/ docs]
89
47
if : env.PUBLISH == 'true'
90
48
run : poetry install --extras "docs lint"
91
49
50
+ - name : Print python versions
51
+ run : |
52
+ python -V
53
+ poetry run python -V
54
+
92
55
- name : Build documentation
93
56
if : env.PUBLISH == 'true'
94
57
run : |
0 commit comments