From 2e176e915a4f7f992a7e6570973749b8b77b1921 Mon Sep 17 00:00:00 2001 From: Jeremy Retailleau Date: Sun, 10 Aug 2025 10:46:33 -0700 Subject: [PATCH] Add compatibility with CMake 4.1 --- .github/workflows/test.yml | 4 ++-- README.md | 2 +- build_config.py | 2 +- cmake/FindPytest.cmake | 2 +- cmake/PytestAddTests.cmake | 2 +- doc/release/release_notes.rst | 7 +++++++ pyproject.toml | 2 +- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 896d6b0..b6b346b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,9 +17,9 @@ jobs: fail-fast: false matrix: pytest: [ "7", "8" ] - cmake: [ "3.20", "3.30" ] + cmake: [ "3.20", "4.1" ] os: [ "ubuntu", "macos", "windows" ] - python: [ "3.8", "3.11", "3.12" ] + python: [ "3.8", "3.12", "3.13" ] bundled: [ false, true ] name: | diff --git a/README.md b/README.md index 0efdf59..7e046b5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Pytest CMake [![PyPi version](https://img.shields.io/pypi/v/pytest-cmake.svg?logo=pypi&label=PyPI&logoColor=gold)](https://pypi.python.org/pypi/pytest-cmake) -[![CMake](https://img.shields.io/badge/CMake-3.20...3.30-blue.svg?logo=CMake&logoColor=blue)](https://cmake.org) +[![CMake](https://img.shields.io/badge/CMake-3.20...4.1-blue.svg?logo=CMake&logoColor=blue)](https://cmake.org) [![Test](https://github.com/python-cmake/pytest-cmake/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/python-cmake/pytest-cmake/actions/workflows/test.yml) [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) diff --git a/build_config.py b/build_config.py index 9359e2f..b5eff50 100644 --- a/build_config.py +++ b/build_config.py @@ -33,7 +33,7 @@ def initialize(self, version, build_data): stream.write( "include(CMakePackageConfigHelpers)\n" "write_basic_package_version_file(\n" - f" \"{str(version_config_path)}\"\n" + f" \"{str(version_config_path.as_posix())}\"\n" f" VERSION {pytest.__version__}\n" " COMPATIBILITY AnyNewerVersion\n" ")" diff --git a/cmake/FindPytest.cmake b/cmake/FindPytest.cmake index d9bb693..f3f12c1 100644 --- a/cmake/FindPytest.cmake +++ b/cmake/FindPytest.cmake @@ -17,7 +17,7 @@ # prepend a custom search path. # (https://cmake.org/cmake/help/latest/policy/CMP0074.html) -cmake_minimum_required(VERSION 3.20...3.30) +cmake_minimum_required(VERSION 3.20...4.1) include(FindPackageHandleStandardArgs) diff --git a/cmake/PytestAddTests.cmake b/cmake/PytestAddTests.cmake index 095b3d0..9542750 100644 --- a/cmake/PytestAddTests.cmake +++ b/cmake/PytestAddTests.cmake @@ -1,5 +1,5 @@ # Wrapper used to create individual CTest tests from Pytest tests. -cmake_minimum_required(VERSION 3.20...3.30) +cmake_minimum_required(VERSION 3.20...4.1) if(CMAKE_SCRIPT_MODE_FILE) diff --git a/doc/release/release_notes.rst b/doc/release/release_notes.rst index ffa6f5f..4286e71 100644 --- a/doc/release/release_notes.rst +++ b/doc/release/release_notes.rst @@ -4,6 +4,13 @@ Release Notes ************* +.. release:: Upcoming + + .. change:: new + + Added compatibility with CMake 4.1. + + .. release:: 0.13.0 :date: 2025-02-16 diff --git a/pyproject.toml b/pyproject.toml index 767f9e8..091c7d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ requires = [ "hatchling >= 1.4; python_version >= '3'", "setuptools >= 44; python_version < '3'", - "cmake >= 3.20, < 3.31" + "cmake >= 3.20, < 4.2" ] build-backend = "build_backend" backend-path = ["."]