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

WIP: use scikit-build-core #389

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
28 changes: 22 additions & 6 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: Check 🐍 pkg PROPOSAL.

on: [push]
on:
push:
branches:
- main
tags:
- "**"
pull_request:

env:
CMAKE_TOOLCHAIN_FILE: build/conan_toolchain.cmake

jobs:
build:
Expand All @@ -10,6 +19,7 @@ jobs:
include:
- os : "ubuntu-latest"
- os : "macos-latest"

steps:
- uses: actions/checkout@v2
- name: Cache conan
Expand All @@ -18,11 +28,17 @@ jobs:
with:
path: ~/.conan
key: ${{ runner.os }}-cache-conan-${{ matrix.compiler }}-${{ hashFiles('conanfile.py') }}-key
- name: Install conan
run: python3 -m pip install conan

- name: Setup conan
run: |
python3 -m pip install conan
conan profile detect

- name: Install C++ dependencies using conan
run: conan install . -o with_python=True -o with_testing=False --build=missing

- name: Install Python 🐍 distributions 📦
run: python3 -m pip install .
- name: Install pytest
run: python3 -m pip install pytest
run: python3 -m pip install .[tests]

- name: run pytest
run: python3 -m pytest tests/python -v
39 changes: 33 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,35 @@
[build-system]
requires = [
"setuptools>=45",
"wheel",
"cmake>=3.16",
"conan>=2.0.0",
requires = ["scikit-build-core[pyproject]", "pybind11", "setuptools_scm[toml]"]
build-backend = "scikit_build_core.build"

[project]
name = "proposal"
version = "7.6.3"
description = "Python bindings for PROPOSAL"
readme = "README.md"
requires-pyton = ">= 3.9"
license = {text = "BSD-3-Clause"}
maintainers = [
{name = "Jean-Marco Alamedine", email = "[email protected]"},
]

[project.urls]
repository = "https://github.com/tudo-astroparticlephysics/PROPOSAL"


[project.optional-dependencies]
tests = [
"pytest",
]

all = ["proposal[tests]"]


[tool.scikit-build]
sdist.cmake = true
cmake.targets = ["pyPROPOSAL"]
cmake.args = [
"-DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON",
"-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON",
"-DBUILD_PYTHON=ON",
]
build-backend = "setuptools.build_meta"
24 changes: 0 additions & 24 deletions setup.cfg

This file was deleted.

130 changes: 0 additions & 130 deletions setup.py

This file was deleted.

7 changes: 7 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
include(GNUInstallDirs)

if(SKBUILD)
message(STATUS "SKBUILD")
set(CMAKE_INSTALL_LIBDIR ".")
set(CMAKE_INSTALL_INCLUDEDIR "proposal/include")
endif()
add_subdirectory(PROPOSAL)

if(BUILD_PYTHON)
Expand Down
2 changes: 0 additions & 2 deletions src/PROPOSAL/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include(GNUInstallDirs)

add_library(PROPOSAL)
add_library(PROPOSAL::PROPOSAL ALIAS PROPOSAL)

Expand Down
Loading