Skip to content

Commit

Permalink
Cleans up pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
PTNobel committed Nov 9, 2024
1 parent 846b071 commit 5fc4836
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 3 deletions.
26 changes: 26 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Require CMake 3.15+ (matching scikit-build-core) Use new versions of all
# policies up to CMake 3.27
cmake_minimum_required(VERSION 3.15...3.27)

# Scikit-build-core sets these values for you, or you can just hard-code the
# name and version.
project(
${SKBUILD_PROJECT_NAME}
VERSION ${SKBUILD_PROJECT_VERSION}
LANGUAGES CXX)

# Find the module development requirements (requires FindPython from 3.17 or
# scikit-build-core's built-in backport)
find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
find_package(pybind11 CONFIG REQUIRED)

# Add a library using FindPython's tooling (pybind11 also provides a helper like
# this)
python_add_library(_core MODULE cpp/src/wrapper.cpp WITH_SOABI)
target_link_libraries(_core PRIVATE pybind11::headers)

# This is passing in the version as a define just as an example
target_compile_definitions(_core PRIVATE VERSION_INFO=${PROJECT_VERSION})

# The install directory is the output (wheel) directory
install(TARGETS _core DESTINATION scikit_build_example)
30 changes: 27 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@

[project]
requires-python = ">= 3.8"
name = "diffcp"
version = "1.1"
description = "A library to compute gradients for convex optimization problems"
requires-python = ">= 3.10"

requires = [
"threadpoolctl >= 1.1"
]
urls = {Homepage = "https://github.com/cvxgrp/diffcp/"}
license = {text = "Apache License, Version 2.0"}

[build-system]
requires = [
"numpy>=2.0",
"scipy>=1.1.0",
"pybind11>=2.4",
"setuptools",
"wheel"
"setuptools >= 68.1.0",
"pytest",
"wheel",
"scikit-build-core",
"pybind11",
]
build-backend = "scikit_build_core.build"

[project.optional-dependencies]
test = [
"clarabel >= 0.5.1",
"ecos >= 2.0.10",
"scs >= 2.0.2",
]

[tool.scikit-build]
wheel.expand-macos-universal-tags = true

0 comments on commit 5fc4836

Please sign in to comment.