Skip to content

Commit 90e41de

Browse files
committed
ci: print out packages, test on CMake 3.20
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 9342bde commit 90e41de

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ jobs:
3434
pipx run nox -s pylint
3535
3636
checks:
37-
name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
37+
name:
38+
🐍 ${{ matrix.python-version }} on ${{ matrix.runs-on }} ${{ matrix.cmake
39+
}}
3840
runs-on: ${{ matrix.runs-on }}
3941
needs: [pre-commit]
4042
strategy:
@@ -46,6 +48,9 @@ jobs:
4648
include:
4749
- python-version: pypy-3.10
4850
runs-on: ubuntu-latest
51+
- python-version: "3.9"
52+
runs-on: ubuntu-latest
53+
cmake: "3.20.x"
4954

5055
steps:
5156
- uses: actions/checkout@v4
@@ -57,6 +62,11 @@ jobs:
5762
python-version: ${{ matrix.python-version }}
5863
allow-prereleases: true
5964

65+
- uses: jwlawson/actions-setup-cmake@v2
66+
if: matrix.cmake != ''
67+
with:
68+
cmake-version: ${{ matrix.cmake }}
69+
6070
- uses: yezz123/setup-uv@v4
6171

6272
- name: Install package

tests/conftest.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
from __future__ import annotations
2+
3+
import importlib.metadata
4+
import shutil
5+
import subprocess
6+
7+
8+
def _get_program(name: str) -> str:
9+
res = shutil.which(name)
10+
if res is None:
11+
return f"No {name} executable found on PATH"
12+
result = subprocess.run(
13+
[res, "--version"], check=True, text=True, capture_output=True
14+
)
15+
version = result.stdout.splitlines()[0]
16+
return f"{res}: {version}"
17+
18+
19+
def pytest_report_header() -> str:
20+
interesting_packages = {
21+
"cmake",
22+
"ninja",
23+
"packaging",
24+
"pip",
25+
"scikit-build-core",
26+
}
27+
valid = []
28+
for package in interesting_packages:
29+
try:
30+
version = importlib.metadata.version(package)
31+
except ModuleNotFoundError:
32+
continue
33+
valid.append(f"{package}=={version}")
34+
reqs = " ".join(sorted(valid))
35+
pkg_line = f"installed packages of interest: {reqs}"
36+
prog_lines = [_get_program(n) for n in ("cmake3", "cmake", "ninja")]
37+
38+
return "\n".join([pkg_line, *prog_lines])

tests/packages/simple/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.20...3.26)
1+
cmake_minimum_required(VERSION 3.20...3.29)
22
project(${SKBUILD_PROJECT_NAME} LANGUAGES C)
33

44
find_package(

0 commit comments

Comments
 (0)