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

prrng v0.5.0 #7

Merged
merged 16 commits into from
May 20, 2021
13 changes: 13 additions & 0 deletions .ci_support/linux_64_.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
boost_cpp:
- 1.74.0
cdt_name:
- cos6
channel_sources:
Expand All @@ -10,7 +12,16 @@ cxx_compiler_version:
- '9'
docker_image:
- quay.io/condaforge/linux-anvil-comp7
numpy:
- '1.18'
- '1.17'
- '1.19'
- '1.17'
- '1.17'
- '1.19'
pin_run_as_build:
boost-cpp:
max_pin: x.x.x
python:
min_pin: x.x
max_pin: x.x
Expand All @@ -26,3 +37,5 @@ target_platform:
zip_keys:
- - cdt_name
- docker_image
- - python
- numpy
14 changes: 14 additions & 0 deletions .ci_support/osx_64_.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
MACOSX_DEPLOYMENT_TARGET:
- '10.9'
boost_cpp:
- 1.74.0
channel_sources:
- conda-forge,defaults
channel_targets:
Expand All @@ -10,7 +12,16 @@ cxx_compiler_version:
- '11'
macos_machine:
- x86_64-apple-darwin13.4.0
numpy:
- '1.18'
- '1.17'
- '1.19'
- '1.17'
- '1.17'
- '1.19'
pin_run_as_build:
boost-cpp:
max_pin: x.x.x
python:
min_pin: x.x
max_pin: x.x
Expand All @@ -23,3 +34,6 @@ python:
- 3.9.* *_cpython
target_platform:
- osx-64
zip_keys:
- - python
- numpy
12 changes: 12 additions & 0 deletions .ci_support/win_64_.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
boost_cpp:
- 1.74.0
channel_sources:
- conda-forge,defaults
channel_targets:
- conda-forge main
cxx_compiler:
- vs2017
numpy:
- '1.17'
- '1.17'
- '1.17'
- '1.19'
pin_run_as_build:
boost-cpp:
max_pin: x.x.x
python:
min_pin: x.x
max_pin: x.x
Expand All @@ -15,3 +24,6 @@ python:
- 3.9.* *_cpython
target_platform:
- win-64
zip_keys:
- - python
- numpy
11 changes: 8 additions & 3 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{% set name = "prrng" %}
{% set version = "0.4.0" %}
{% set version = "0.5.0" %}

package:
name: {{ name|lower }}-split
version: {{ version }}

source:
url: https://github.com/tdegeus/{{ name }}/archive/v{{ version }}.tar.gz
sha256: 77a8c38e70c80074b23e3a07fef56a1b5164452a8db8d2aacb935211a6877d2d
sha256: 59bbcac3102281bdc5121dc3d8bad7efe6b0d6ca61de092b2ea8c810e5cf657e
patches:
- mypatch.patch

build:
number: 0
Expand Down Expand Up @@ -52,7 +54,10 @@ outputs:
- python
- pip
- setuptools_scm
- pyxtensor
- xtensor
- xtensor-python
- numpy
- boost-cpp
run:
- python

Expand Down
46 changes: 46 additions & 0 deletions recipe/mypatch.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7922631..89d3cb2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.1..3.19)
+cmake_minimum_required(VERSION 3.18..3.20)

# Basic settings
# ==============
@@ -92,16 +92,16 @@ endif()
# Python API

if(BUILD_PYTHON OR BUILD_ALL)
- find_package(pybind11 CONFIG REQUIRED)
+ find_package(Python REQUIRED COMPONENTS Interpreter Development NumPy)
+ find_package(pybind11 REQUIRED CONFIG)
find_package(xtensor-python REQUIRED)
- find_package(Python REQUIRED COMPONENTS NumPy)

- pybind11_add_module(python python/main.cpp)
- set_target_properties(python PROPERTIES OUTPUT_NAME ${PROJECT_NAME})
- target_link_libraries(python PUBLIC ${PROJECT_NAME}
+ pybind11_add_module(mypymod python/main.cpp)
+ set_target_properties(mypymod PROPERTIES OUTPUT_NAME ${PROJECT_NAME})
+ target_link_libraries(mypymod PUBLIC ${PROJECT_NAME}
pybind11::module xtensor-python Python::NumPy prrng::use_boost)

- target_compile_definitions(python PRIVATE VERSION_INFO=${PROJECT_VERSION})
+ target_compile_definitions(mypymod PRIVATE VERSION_INFO=${PROJECT_VERSION})
endif()

# Documentation
diff --git a/setup.py b/setup.py
index fbb4b5c..604e7dc 100644
--- a/setup.py
+++ b/setup.py
@@ -48,7 +48,7 @@ class CMakeBuild(build_ext):
cmake_args = [
"-DBUILD_PYTHON=1",
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={}".format(extdir),
- "-DPYTHON_EXECUTABLE={}".format(sys.executable),
+ "-DPython_EXECUTABLE={}".format(sys.executable),
"-DCMAKE_BUILD_TYPE={}".format(cfg), # not used on MSVC, but no harm
]
build_args = []