diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 5c44f57e726baa5974919e13e3370f14d489932f..31ee52c4c85be2a880e0e65b84e02e730bb32f11 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - platform: [ubuntu-latest, macos-latest] # TODO: windows after 2016 doesn't config correctly + platform: [ubuntu-latest, macos-latest, windows-latest] python-version: ["3.8", "3.10"] runs-on: ${{ matrix.platform }} diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 8120546c0a5faab5ff4a431971be398e0973a482..f3de814f7779840d21b403823c3dcab9f28b5e61 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -49,7 +49,7 @@ jobs: - uses: pypa/cibuildwheel@v2.11.2 env: - CIBW_ARCHS_MACOS: auto universal2 + CIBW_ARCHS_MACOS: universal2 - name: Verify clean directory run: git diff --exit-code diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 09cd8c9ee3010406f9b8c9b210f64e93d612156c..84bf635e42dc49fc8e094f06e72299bba7b0b330 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -51,7 +51,7 @@ repos: rev: v3.2.2 hooks: - id: pyupgrade - args: ["--py36-plus"] + args: ["--py37-plus"] # Changes tabs to spaces - repo: https://github.com/Lucas-C/pre-commit-hooks diff --git a/CMakeLists.txt b/CMakeLists.txt index 17efbafb1e72845a3e4aef713bfb687c842c1f5d..f6354213e54887f65dff487af04773dad1116d67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,24 +1,10 @@ -cmake_minimum_required(VERSION 3.15...3.22) +cmake_minimum_required(VERSION 3.15...3.25) -project(scikit_build_example VERSION "0.0.1") +project(${SKBUILD_PROJECT_NAME} VERSION ${SKBUILD_PROJECT_VERSION}) -if(SKBUILD) - # Scikit-Build does not add your site-packages to the search path - # automatically, so we need to add it _or_ the pybind11 specific directory - # here. - execute_process( - COMMAND "${PYTHON_EXECUTABLE}" -c - "import pybind11; print(pybind11.get_cmake_dir())" - OUTPUT_VARIABLE _tmp_dir - OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND_ECHO STDOUT) - list(APPEND CMAKE_PREFIX_PATH "${_tmp_dir}") -endif() - -# Now we can find pybind11 find_package(pybind11 CONFIG REQUIRED) pybind11_add_module(_core MODULE src/main.cpp) - target_compile_definitions(_core PRIVATE VERSION_INFO=${PROJECT_VERSION}) -install(TARGETS _core DESTINATION .) +install(TARGETS _core DESTINATION scikit_build_example) diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml index 956c909e2b7b89c14de7dadd06e5fff6f5f1a82b..e0ff66ac783b38af1f82cc1e67ba9221d42501de 100644 --- a/conda.recipe/meta.yaml +++ b/conda.recipe/meta.yaml @@ -7,19 +7,18 @@ source: build: number: 0 - script: python -m pip install . -vvv + script: {{ PYTHON }} -m pip install . -vv requirements: build: + - python - {{ compiler('cxx') }} host: - python - pip - - pybind11 >=2.6.0 - - scikit-build - - cmake >=3.18 - - ninja + - scikit-build-core + - pybind11 >=2.10.0 run: - python diff --git a/pyproject.toml b/pyproject.toml index 4aae51896b58763aa05a40a187bfcb4d294b50fc..3b389eff3225a43d53ecd4b2d20206c5d608eba2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,16 +1,28 @@ [build-system] -requires = [ - "setuptools>=42", - "pybind11>=2.10.1", - "cmake>=3.22", - "scikit-build>=0.15.0", -] -build-backend = "setuptools.build_meta" +requires = ["scikit-build-core", "pybind11"] +build-backend = "scikit_build_core.build" + + +[project] +name = "scikit_build_example" +version = "0.0.1" +requires-python = ">=3.7" + + +[tool.scikit-build] +wheel.expand-macos-universal-tags = true + + +[project.optional-dependencies] +test = ["pytest"] + [tool.isort] profile = "black" + [tool.cibuildwheel] test-command = "pytest {project}/tests" test-extras = ["test"] test-skip = ["*universal2:arm64"] +build-verbosity = 1