Skip to content

Commit 504b606

Browse files
authored
Validate wheel with twine 5.1.1, fix to maturin 1.7.5 (#182)
- Use twine 5.1.1 for validating wheels until pypa/gh-action-pypi-publish#309 is merged. - twine 5.1.1 does not supports metadata 2.4, thus fix `maturin == 1.7.5` since it uses metadata 2.4 until 1.7.6 PyO3/maturin#2335
1 parent 2b260df commit 504b606

File tree

3 files changed

+36
-4
lines changed

3 files changed

+36
-4
lines changed

.github/actions/setup-test-environment/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ runs:
4646
run: |
4747
pip install "ruff >= 0.7.0, < 0.8.0"
4848
pip install pytest-github-actions-annotate-failures
49+
pip install "twine == 5.1.1" # Please keep in sync with https://github.com/pypa/gh-action-pypi-publish/
4950
5051
- name: Install uv
5152
uses: astral-sh/setup-uv@v3

.github/workflows/release_python.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
tags:
66
- python-*
7+
branches:
8+
- main
79
workflow_dispatch:
810

911
jobs:
@@ -114,11 +116,40 @@ jobs:
114116
path: ./dist/
115117
retention-days: 30
116118

119+
check-wheel:
120+
runs-on: ubuntu-latest
121+
needs: [linux, macos, windows, python-mip-adapter, pyscipopt-adapter]
122+
steps:
123+
- name: Checkout
124+
uses: actions/checkout@v4
125+
126+
- name: Setup Test Environment
127+
uses: ./.github/actions/setup-test-environment
128+
129+
- name: Download artifacts
130+
uses: actions/download-artifact@v4
131+
with:
132+
path: dist
133+
pattern: "*"
134+
merge-multiple: true
135+
136+
- name: Check wheel
137+
run: twine check --strict dist/*
138+
117139
publish:
140+
if: startsWith(github.ref, 'refs/tags/python-')
118141
runs-on: ubuntu-latest
119142
permissions:
120143
id-token: write
121-
needs: [linux, macos, windows, python-mip-adapter, pyscipopt-adapter]
144+
needs:
145+
[
146+
linux,
147+
macos,
148+
windows,
149+
python-mip-adapter,
150+
pyscipopt-adapter,
151+
check-wheel,
152+
]
122153
steps:
123154
- name: Download artifacts
124155
uses: actions/download-artifact@v4

python/ommx/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[build-system]
2-
requires = ["maturin>=1.5,<2.0"]
2+
requires = ["maturin == 1.7.5"]
33
build-backend = "maturin"
44

55
[project]
66
name = "ommx"
77

88
version = "1.4.4"
99
description = "Open Mathematical prograMming eXchange (OMMX)"
10-
authors = [{ name="Jij Inc.", email="[email protected]" }]
10+
authors = [{ name = "Jij Inc.", email = "[email protected]" }]
1111
readme = "README.md"
1212

1313
classifiers = [
@@ -61,4 +61,4 @@ module-name = "ommx._ommx_rust"
6161
features = ["pyo3/extension-module"]
6262

6363
[tool.ruff.lint]
64-
per-file-ignores = {"*_pb2.py" = ["ALL"]}
64+
per-file-ignores = { "*_pb2.py" = ["ALL"] }

0 commit comments

Comments
 (0)