File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,15 +26,23 @@ jobs:
2626 - name : Install hatch
2727 run : uv tool install hatch
2828
29- - name : Clean build artifacts
30- run : |
31- rm -rf dist/*
32- rm -rf build/*
33- rm -f src/em511/_version.py
34-
3529 - name : Build distributions with uv
3630 run : uv build
31+
32+ - name : Add build tag
33+ run : |
34+ FILE_WHL=$(ls dist/*.whl)
35+ BASE_WHL=$(basename "$FILE_WHL")
36+
37+ DIST="python_em511"
38+ VERSION=$(grep '^version' pyproject.toml | head -1 | cut -d '"' -f2)
39+ BUILD="${{ github.run_number }}${{ github.run_attempt }}"
40+ SUFFIX=$(echo "$BASE_WHL" | cut -d'-' -f3-)
41+
42+ NEW="dist/${DIST}-${VERSION}-${BUILD}-${SUFFIX}"
3743
44+ mv "$FILE_WHL" "$NEW"
45+
3846 - name : Upload distributions as artifact
3947 uses : actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
4048 with :
Original file line number Diff line number Diff line change 11[project ]
22name = " python-em511"
3- dynamic = [ " version " ]
3+ version = " 0.0.1 "
44description = " Driver for Carlo Gavazzi EM511 Series Single Phase Energy Meters using Modbus RTU"
55readme = " README.md"
66
@@ -36,15 +36,11 @@ classifiers = [
3636]
3737
3838[build-system ]
39- requires = [" setuptools>=64 " , " setuptools-scm " ]
40- build-backend = " setuptools.build_meta "
39+ requires = [" hatchling " ]
40+ build-backend = " hatchling.build "
4141
42- [tool .setuptools .packages .find ]
43- where = [" src" ]
44-
45- [tool .setuptools_scm ]
46- write_to = " src/em511/_version.py"
47- local_scheme = " no-local-version"
42+ [tool .hatch .build .targets .wheel ]
43+ packages = [" src/em511" ]
4844
4945[dependency-groups ]
5046dev = [
You can’t perform that action at this time.
0 commit comments