Skip to content

Commit

Permalink
fix: Fortran requires 3.17.2+ & 1.10+
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed May 11, 2023
1 parent 304888e commit b4221b5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/examples/getting_started/fortran/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.15...3.26)
cmake_minimum_required(VERSION 3.17.2...3.26)
project(${SKBUILD_PROJECT_NAME} LANGUAGES C Fortran)

find_package(
Expand Down
4 changes: 4 additions & 0 deletions docs/examples/getting_started/fortran/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ build-backend = "scikit_build_core.build"
name = "example"
version = "0.0.1"
dependencies = ["numpy"]

[tool.scikit-build]
ninja.minimum-required = "1.10"
cmake.minimum-required = "3.17.2"
2 changes: 1 addition & 1 deletion tests/packages/fortran_example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# setup project ###
cmake_minimum_required(VERSION 3.15...3.24)
cmake_minimum_required(VERSION 3.17.2...3.24)

project(
fibby
Expand Down
16 changes: 16 additions & 0 deletions tests/test_fortran.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,25 @@
from pathlib import Path

import pytest
from packaging.version import Version

from scikit_build_core.build import build_wheel
from scikit_build_core.program_search import (
best_program,
get_cmake_programs,
get_ninja_programs,
)

np = pytest.importorskip("numpy")

DIR = Path(__file__).parent.resolve()
FORTRAN_EXAMPLE = DIR / "packages/fortran_example"


cmake_info = best_program(get_cmake_programs(), minimum_version=Version("3.17.2"))
ninja_info = best_program(get_ninja_programs(), minimum_version=Version("1.10"))


@pytest.mark.compile()
@pytest.mark.configure()
@pytest.mark.fortran()
Expand All @@ -22,6 +32,12 @@
sysconfig.get_platform().startswith("win"),
reason="No reasonable Fortran compiler for MSVC",
)
@pytest.mark.skipif(
cmake_info is None, reason="CMake needs to be 3.17.2+ to support Fortran with Ninja"
)
@pytest.mark.skipif(
ninja_info is None, reason="Ninja needs to be 1.10+ to support Fortran with CMake"
)
def test_pep517_wheel(tmp_path, monkeypatch, virtualenv):
dist = tmp_path / "dist"
dist.mkdir()
Expand Down

0 comments on commit b4221b5

Please sign in to comment.