1414 description : Create a (pre-)release when CI passes
1515 default : false
1616 required : false
17+ update_dependencies :
18+ type : boolean
19+ description : Update dependencies to their latest version
20+ default : false
21+ required : false
1722 outputs :
1823 tag :
1924 description : " The created release tag"
@@ -31,33 +36,41 @@ jobs:
3136 steps :
3237
3338 - name : Checkout source code
34- uses : actions/checkout@v4
39+ uses : actions/checkout@v5
3540
36- - name : Setup Python 3.13
37- uses : actions/setup-python@v5
41+ - name : Install uv
42+ uses : astral-sh/setup-uv@v6
43+ if : ${{ always() }}
3844 with :
39- python-version : " 3.13"
45+ activate-environment : true
46+ enable-cache : true
47+
48+ - name : Install dependencies
49+ if : ${{ always() }}
50+ run : uv sync
51+
52+ - name : Update dependencies
53+ if : ${{ inputs.update_dependencies }}
54+ run : uv update
4055
4156 - name : Set PyPI version
4257 uses : PowerGridModel/pgm-version-bump@main
4358 with :
4459 token : ${{ secrets.GITHUB_TOKEN }}
4560
46- - name : Build
47- run : |
48- cat PYPI_VERSION
49- pip install build
50- python -m build --outdir wheelhouse .
51-
5261 - name : Save version
5362 id : version
5463 run : echo "version=$(cat PYPI_VERSION)" >> $GITHUB_OUTPUT
5564
65+ - name : Build
66+ run : |
67+ uv build
68+
5669 - name : Store built wheel file
5770 uses : actions/upload-artifact@v4
5871 with :
5972 name : power-grid-model-ds
60- path : wheelhouse /
73+ path : dist /
6174
6275 tests :
6376 needs : build-python
@@ -70,26 +83,33 @@ jobs:
7083
7184 steps :
7285 - name : Checkout source code
73- uses : actions/checkout@v4
86+ uses : actions/checkout@v5
7487
75- - name : Setup Python ${{ matrix.python }}
76- uses : actions/setup-python@v5
88+ - name : Install uv
89+ uses : astral-sh/setup-uv@v6
90+ if : ${{ always() }}
7791 with :
78- python-version : ${{ matrix.python }}
92+ activate-environment : true
93+ enable-cache : true
94+
95+ - name : install poe
96+ run : uv tool install poethepoet
7997
8098 - name : Load built wheel file
8199 uses : actions/download-artifact@v4
82100 with :
83101 name : power-grid-model-ds
84- path : wheelhouse /
102+ path : dist /
85103
86104 - name : Install built wheel file
87- run : pip install power-grid-model-ds[dev]==${{ needs.build-python.outputs.version }} --find-links=wheelhouse
105+ run : uv pip install power-grid-model-ds[dev]==${{ needs.build-python.outputs.version }} --find-links=dist
88106
89- - name : Unit test and coverage
90- run : pytest --verbose
107+ - name : Run Code Quality Checks & Tests
108+ run : poe all --check
109+
91110
92111 github-release :
112+ if : ${{ inputs.create_release == 'true' }}
93113 needs :
94114 - build-python
95115 - tests
@@ -99,19 +119,14 @@ jobs:
99119 outputs :
100120 tag : ${{ steps.tag.outputs.tag }}
101121 steps :
102- - name : Setup Python 3.13
103- uses : actions/setup-python@v5
104- with :
105- python-version : " 3.13"
106-
107122 - name : Checkout source code
108- uses : actions/checkout@v4 # needed by 'Prevent automatic major/minor release'
123+ uses : actions/checkout@v5
109124
110125 - name : Load built wheel file
111126 uses : actions/download-artifact@v4
112127 with :
113128 name : power-grid-model-ds
114- path : wheelhouse /
129+ path : dist /
115130
116131 - name : Prevent automatic major/minor release
117132 if : (github.event_name == 'push')
@@ -143,7 +158,7 @@ jobs:
143158 uses : softprops/action-gh-release@v2
144159 with :
145160 files : |
146- ./wheelhouse /*
161+ ./dist /*
147162 tag_name : ${{ steps.tag.outputs.tag }}
148163 prerelease : ${{github.ref != 'refs/heads/main'}}
149164 generate_release_notes : true
0 commit comments