Skip to content

Commit df4d86a

Browse files
committed
Fix flag for install from file for docs requirements and add missing file
Use scripts for conda recipe for python wrapper
1 parent a2795bb commit df4d86a

File tree

8 files changed

+75
-4
lines changed

8 files changed

+75
-4
lines changed

.github/workflows/test-suite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ jobs:
389389
conda-remove-defaults: true
390390
- name: Install doc dependencies
391391
run: |
392-
conda install -f environment_docs.yml
392+
conda install --file environment_docs.yml
393393
- name: Build docs
394394
if: matrix.os != 'windows-latest'
395395
run: |

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ message(STATUS "CONDA_PREFIX = ${CONDA_PREFIX}")
8282

8383
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${PROJECT_SOURCE_DIR}/cmake")
8484

85+
option(BUILD_CXX "Build CXX library & executable." ON)
8586
option(BUILD_TESTS "Build ePhotosynthesis tests.")
8687
option(TEST_COVERAGE "Include test coverage in the tests (turns BUILD_TESTS ON)")
8788
option(PRESERVE_TEST_OUTPUT "Don't clean up test output after the test runs")
@@ -93,6 +94,14 @@ option(EPHOTO_USE_SCOPED_ENUM "Build using a scoped enumerator for the ValueSet
9394
option(MAKE_EQUIVALENT_TO_MATLAB "Build with settings that make this model equivalent to the Matlab C3 model")
9495
option(WITH_YGGDRASIL "Compile with yggdrasil enabled")
9596

97+
if(SKBUILD)
98+
set(BUILD_CXX OFF)
99+
set(BUILD_PYTHON ON)
100+
set(BUILD_TESTS OFF)
101+
set(BUILD_DOCS OFF)
102+
set(WITH_YGGDRASIL ON)
103+
endif()
104+
96105
if(NOT BUILD_PYTHON)
97106
set(BUILD_PYTHON OFF)
98107
else()

environment_docs.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
channels:
2+
- conda-forge
3+
dependencies:
4+
- setuptools_scm
5+
- doxygen>=1.9.2
6+
- graphviz

recipe/bld_cpp.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ cd conda_build
88
cmake -GNinja ^
99
-D CMAKE_BUILD_TYPE=%CONFIGURATION% ^
1010
-D CMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
11-
-D CMAKE_VERBOSE_MAKEFILE:BOOL=ON ..
11+
-D CMAKE_VERBOSE_MAKEFILE:BOOL=ON ^
12+
-D WITH_YGGDRASIL:BOOL=ON ..
1213
if errorlevel 1 exit 1
1314

1415
:: Using ninja

recipe/bld_python.bat

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@setlocal
2+
3+
"%PYTHON%" -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv
4+
5+
rem set CONFIGURATION=Release
6+
7+
rem mkdir conda_build
8+
rem cd conda_build
9+
10+
rem :: Call cmake
11+
rem cmake -GNinja ^
12+
rem -D CMAKE_BUILD_TYPE=%CONFIGURATION% ^
13+
rem -D CMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
14+
rem -D CMAKE_VERBOSE_MAKEFILE:BOOL=ON ^
15+
rem -D BUILD_CXX:BOOL=OFF ^
16+
rem -D BUILD_PYTHON:BOOL=ON ^
17+
rem -D WITH_YGGDRASIL:BOOL=ON ..
18+
rem if errorlevel 1 exit 1
19+
20+
rem :: Using ninja
21+
rem ninja all
22+
rem ninja install
23+
24+
rem :: Run tests
25+
rem if errorlevel 1 exit 1
26+
rem ctest -C "%Configuration%" -V
27+
rem if errorlevel 1 exit 1
28+
29+
@endlocal

recipe/build_cpp.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ set -euo pipefail
44
# Using cmake
55
mkdir conda_build
66
cd conda_build
7-
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=$PREFIX -D CMAKE_VERBOSE_MAKEFILE:BOOL=ON ..
7+
cmake ${CMAKE_ARGS} \
8+
-D CMAKE_BUILD_TYPE=Release \
9+
-D CMAKE_INSTALL_PREFIX=$PREFIX \
10+
-D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \
11+
-D WITH_YGGDRASIL:BOOL=ON ..
812

913
# Build all, run tests, then install
1014
cmake --build . --config Release

recipe/build_python.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
set -euo pipefail
3+
4+
"${PYTHON}" -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv
5+
6+
# # Using cmake
7+
# mkdir conda_build
8+
# cd conda_build
9+
# cmake ${CMAKE_ARGS} \
10+
# -D CMAKE_BUILD_TYPE=Release \
11+
# -D CMAKE_INSTALL_PREFIX=$PREFIX \
12+
# -D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \
13+
# -D BUILD_CXX:BOOL=OFF \
14+
# -D BUILD_PYTHON:BOOL=ON \
15+
# -D WITH_YGGDRASIL:BOOL=ON ..
16+
17+
# # Build all, run tests, then install
18+
# cmake --build . --config Release
19+
# ctest -V
20+
# cmake --install .

recipe/meta.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ outputs:
5656
- if not exist %LIBRARY_BIN%\\ePhoto.exe exit 1 # [win]
5757
- name: pyphotosynthesis
5858
version: {{ version }}
59-
script: python -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv
59+
script: build_python.sh # [unix]
60+
script: bld_python.bat # [win]
61+
# script: python -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv
6062
about:
6163
summary:
6264
description: |

0 commit comments

Comments
 (0)