File tree Expand file tree Collapse file tree 3 files changed +26
-20
lines changed
Expand file tree Collapse file tree 3 files changed +26
-20
lines changed Original file line number Diff line number Diff line change 1+ name : Install python from pyproject.toml
2+ description : ' Installs Python from the version found in the pyproject.toml'
3+
4+ inputs :
5+ pyproject-file-path :
6+ required : False
7+ description : " Path to the pyproject.toml including filename"
8+ default : " ./pyproject.toml"
9+
10+ runs :
11+ using : composite
12+ steps :
13+ - name : Get project version with yq
14+ id : get_python_version
15+ uses : mikefarah/yq@v4.46.1
16+ with :
17+ cmd : yq '.project.requires-python' ${{ inputs.pyproject-file-path }}
18+
19+ - name : Set up Python
20+ uses : actions/setup-python@v5.6.0
21+ with :
22+ python-version : ${{ steps.get_python_version.outputs.result }}
Original file line number Diff line number Diff line change @@ -4,16 +4,8 @@ description: 'Sets up and caches a python env. Will only install dependencies if
44runs :
55 using : composite
66 steps :
7- - name : Get project version with yq
8- id : get_python_version
9- uses : mikefarah/yq@v4.46.1
10- with :
11- cmd : yq '.project.requires-python' pyproject.toml
12-
13- - name : Set up Python
14- uses : actions/setup-python@v5.6.0
15- with :
16- python-version : ${{ steps.get_python_version.outputs.result }}
7+ - name : Setup Python from pyproject.toml
8+ uses : ./.github/actions/python_from_pyproject
179
1810 - name : Cache Env
1911 uses : actions/cache@v4.2.3
Original file line number Diff line number Diff line change 1818 persist-credentials : false
1919 fetch-depth : 0
2020
21- - name : Get project version with yq
22- id : get_python_version
23- uses : mikefarah/yq@v4.46.1
24- with :
25- cmd : yq '.project.requires-python' pyproject.toml
26-
27- - name : Initialize Python
28- uses : actions/setup-python@v5
29- with :
30- python-version : ${{ steps.get_python_version.outputs.result }}
21+ - name : Setup Python from pyproject.toml
22+ uses : ./.github/actions/python_from_pyproject
3123
3224 - name : Install build
3325 run : >-
You can’t perform that action at this time.
0 commit comments