Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use scikit-build-core for the build #337

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
cmake_minimum_required(VERSION 3.17)

project(
pybezier
LANGUAGES C
VERSION ${SKBUILD_PROJECT_VERSION})

find_package(Python 3.10 REQUIRED COMPONENTS Interpreter Development.Module
NumPy)

add_subdirectory(src/fortran)

python_add_library(_speedup MODULE src/python/bezier/_speedup.c)
target_link_libraries(_speedup PRIVATE bezier Python::NumPy)
target_compile_definitions(
_speedup
PRIVATE NPY_NO_DEPRECATED_API
PRIVATE NPY_1_7_API_VERSION)

if(APPLE)
set_target_properties(_speedup PROPERTIES INSTALL_RPATH @loader_path/lib)
else()
set_target_properties(_speedup PROPERTIES INSTALL_RPATH $ORIGIN/../lib)
endif()

install(TARGETS _speedup DESTINATION .)
7 changes: 0 additions & 7 deletions MANIFEST.in

This file was deleted.

65 changes: 63 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,64 @@
[build-system]
requires = ["numpy>=1.25.2", "setuptools>=70.0.0", "wheel>=0.43.0"]
build-backend = "setuptools.build_meta:__legacy__"
requires = ["scikit-build-core", "numpy>=2"]
build-backend = "scikit_build_core.build"

[project]
name = "bezier"
version = "2024.6.21.dev1"
description = "Helper for Bézier Curves, Triangles, and Higher Order Objects"
readme = "README.rst"
requires-python = ">=3.10"
authors = [
{ name = "Danny Hermes", email = "[email protected]" },
]
keywords = [
"Bezier",
"Curve",
"Geometry",
"Intersection",
"Python",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Mathematics",
]
dependencies = [
"numpy >= 2.0.0",
]

[project.optional-dependencies]
full = [
"matplotlib >= 3.9.0",
"scipy >= 1.13.1",
"sympy >= 1.12.1",
]

[project.urls]
Changelog = "https://bezier.readthedocs.io/en/latest/releases/index.html"
Documentation = "https://bezier.readthedocs.io/"
Homepage = "https://github.com/dhermes/bezier"
"Issue Tracker" = "https://github.com/dhermes/bezier/issues"


[tool.scikit-build]
minimum-version = "0.9"
wheel.packages = [ "src/python/bezier" ]
wheel.install-dir = "bezier"

[[tool.scikit-build.overrides]]
if.env.BEZIER_NO_EXTENSION = true
wheel.cmake = false

[tool.pytest.ini_options]
addopts = ["--tb=native"]

2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

226 changes: 0 additions & 226 deletions setup.py

This file was deleted.

4 changes: 3 additions & 1 deletion src/fortran/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ if(${BUILD_SHARED_LIBS})
POSITION_INDEPENDENT_CODE ON)
endif()

target_include_directories(bezier PUBLIC $<INSTALL_INTERFACE:include>)
target_include_directories(bezier PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)

if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
# ``-Wextra`` includes ``no-compare-reals``, but we have comparisons like
Expand Down
Loading