Skip to content

Commit 64900a8

Browse files
committed
ci: add a py3-none-any fallback wheel
1 parent 3b1a30c commit 64900a8

File tree

2 files changed

+56
-11
lines changed

2 files changed

+56
-11
lines changed

.github/workflows/release.yml

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,46 @@ jobs:
3535
name: wheels-${{ matrix.platform.arch }}
3636
path: wheelhouse/*.whl
3737

38+
build-py3-none-any:
39+
runs-on: ubuntu-24.04
40+
steps:
41+
- uses: actions/checkout@v4
42+
- uses: astral-sh/setup-uv@v4
43+
- uses: actions/setup-python@v2
44+
with:
45+
python-version: "3.12"
46+
- name: Build py3-none-any wheel
47+
env:
48+
PYTEST_CODSPEED_SKIP_EXTENSION_BUILD: "1"
49+
run: uv build --wheel --out-dir dist/
50+
51+
- uses: actions/upload-artifact@v4
52+
with:
53+
name: wheels-py3-none-any
54+
path: dist/*.whl
55+
56+
build-sdist:
57+
runs-on: ubuntu-24.04
58+
steps:
59+
- uses: actions/checkout@v4
60+
- uses: astral-sh/setup-uv@v4
61+
- uses: actions/setup-python@v2
62+
with:
63+
python-version: "3.12"
64+
- name: Build the source dist
65+
run: uv build --sdist --out-dir dist/
66+
67+
- uses: actions/upload-artifact@v4
68+
with:
69+
name: sdist
70+
path: dist/*.tar.gz
71+
3872
publish:
39-
needs: build-wheels
73+
needs:
74+
- build-wheels
75+
- build-py3-none-any
76+
- build-sdist
77+
4078
runs-on: ubuntu-24.04
4179
steps:
4280
- uses: actions/download-artifact@v4
@@ -54,9 +92,6 @@ jobs:
5492
merge-multiple: true
5593
path: dist/
5694

57-
- name: Build the source dist
58-
run: uv build --sdist --out-dir dist/
59-
6095
- name: List artifacts
6196
run: ls -al dist/*
6297

setup.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,19 @@
2828
IS_EXTENSION_REQUIRED = (
2929
os.environ.get("PYTEST_CODSPEED_FORCE_EXTENSION_BUILD") is not None
3030
)
31+
32+
SKIP_EXTENSION_BUILD = (
33+
os.environ.get("PYTEST_CODSPEED_SKIP_EXTENSION_BUILD") is not None
34+
)
35+
36+
if SKIP_EXTENSION_BUILD and IS_EXTENSION_REQUIRED:
37+
raise ValueError("Extension build required but the build requires to skip it")
38+
3139
if IS_EXTENSION_REQUIRED and not IS_EXTENSION_BUILDABLE:
3240
raise ValueError(
3341
"The extension is required but the current platform is not supported"
3442
)
3543

36-
3744
ffi_extension = build.ffibuilder.distutils_extension()
3845
ffi_extension.optional = not IS_EXTENSION_REQUIRED
3946

@@ -43,11 +50,14 @@
4350
)
4451

4552
setup(
46-
package_data={
47-
"pytest_codspeed": [
48-
"instruments/valgrind/_wrapper/*.h",
49-
"instruments/valgrind/_wrapper/*.c",
50-
]
53+
exclude_package_data={
54+
"pytest_codspeed.instruments.valgrind._wrapper": [
55+
"*.c",
56+
"*.h",
57+
"build.py",
58+
],
5159
},
52-
ext_modules=[ffi_extension] if IS_EXTENSION_BUILDABLE else [],
60+
ext_modules=(
61+
[ffi_extension] if IS_EXTENSION_BUILDABLE and not SKIP_EXTENSION_BUILD else []
62+
),
5363
)

0 commit comments

Comments
 (0)