From 7518caa9fb5bce67b6b4c4b6f6b15a5a2afb0006 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Tue, 12 Sep 2023 15:27:12 -0400 Subject: [PATCH 01/47] Pin R package vdiffr due to https://github.com/r-lib/vdiffr/issues/137 --- yggdrasil/languages/R/DESCRIPTION | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yggdrasil/languages/R/DESCRIPTION b/yggdrasil/languages/R/DESCRIPTION index e6396e26a..6a752a5dc 100644 --- a/yggdrasil/languages/R/DESCRIPTION +++ b/yggdrasil/languages/R/DESCRIPTION @@ -14,7 +14,8 @@ Imports: Rcpp, units, zeallot, - R6 + R6, + vdiffr (<= 1.0.5) Depends: R (>= 3.1.0), zeallot From e0758c3362152b17063d82b005df4799166ef8d4 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Tue, 12 Sep 2023 15:32:04 -0400 Subject: [PATCH 02/47] Correct import --- tests/examples/types/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/examples/types/types.py b/tests/examples/types/types.py index 76acf2021..54efa5fa8 100644 --- a/tests/examples/types/types.py +++ b/tests/examples/types/types.py @@ -1,6 +1,6 @@ import os import argparse -from yggdrasil.examples.tests.test_types import TestExampleTypes +from tests.examples.test_types import TestExampleTypes from yggdrasil.languages import get_language_ext from yggdrasil.runner import run _this_dir = os.path.dirname(__file__) From 528420c9f14676d70c9025faa0714dba32628dac Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Tue, 12 Sep 2023 16:13:23 -0400 Subject: [PATCH 03/47] Move install of pinned vdiffr to setup script --- yggdrasil/languages/R/DESCRIPTION | 3 +-- yggdrasil/languages/R/install.py | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/yggdrasil/languages/R/DESCRIPTION b/yggdrasil/languages/R/DESCRIPTION index 6a752a5dc..e6396e26a 100644 --- a/yggdrasil/languages/R/DESCRIPTION +++ b/yggdrasil/languages/R/DESCRIPTION @@ -14,8 +14,7 @@ Imports: Rcpp, units, zeallot, - R6, - vdiffr (<= 1.0.5) + R6 Depends: R (>= 3.1.0), zeallot diff --git a/yggdrasil/languages/R/install.py b/yggdrasil/languages/R/install.py index 41f27b18f..f38538ef4 100644 --- a/yggdrasil/languages/R/install.py +++ b/yggdrasil/languages/R/install.py @@ -380,6 +380,7 @@ def install(args=None, with_sudo=None, skip_requirements=None, requirements = requirements_from_description() if os.environ.get('BUILDDOCS', '') == '1': requirements += ['roxygen2', 'Rd2md'] + requirements.insert(0, 'vdiffr (<= 1.0.5)') if not install_packages(requirements, update=update_requirements, R_exe=Rscript_exe, **kwargs): logger.error("Failed to install dependencies") From d668d07e4f742cfee0848afe99b1c719c60966e5 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Tue, 12 Sep 2023 17:00:07 -0400 Subject: [PATCH 04/47] Install pinned R packages first --- yggdrasil/languages/R/install.py | 45 +++++++++++++++++--------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/yggdrasil/languages/R/install.py b/yggdrasil/languages/R/install.py index f38538ef4..c342602c8 100644 --- a/yggdrasil/languages/R/install.py +++ b/yggdrasil/languages/R/install.py @@ -143,6 +143,7 @@ def install_packages(package_list, update=False, repos=None, **kwargs): r'(?P[^\s=<>]+?)\s*\))?') req_ver = [] req_nover = [] + logger.info(f"package_list = {package_list}") for x in package_list: out = re.fullmatch(regex_ver, x).groupdict() kws = {} @@ -167,27 +168,7 @@ def install_packages(package_list, update=False, repos=None, **kwargs): req_nover.append(out['name']) if repos is None: repos = 'http://cloud.r-project.org' - if req_nover: - req_list = 'c(%s)' % ', '.join(['\"%s\"' % x for x in req_nover]) - if update: - # R_cmd = ['install.packages(%s, repos="%s")' % (req_list, repos)] - R_cmd += ['req <- %s' % req_list, - 'for (x in req) {', - ' if (is.element(x, installed.packages()[,1])) {', - ' remove.packages(x)', - ' }', - ' install.packages(x, dep=TRUE, repos="%s")' % repos, - '}'] - else: - R_cmd += ['req <- %s' % req_list, - 'for (x in req) {', - ' if (!is.element(x, installed.packages()[,1])) {', - ' print(sprintf("Installing \'%s\' from CRAN.", x))', - ' install.packages(x, dep=TRUE, repos="%s")' % repos, - ' } else {', - ' print(sprintf("%s already installed.", x))', - ' }', - '}'] + logger.info(f"req_ver = {req_ver}") if req_ver: for x in req_ver: name = "\"%s\"" % x['name'] @@ -215,6 +196,28 @@ def install_packages(package_list, update=False, repos=None, **kwargs): '} else {', ' print("%s already installed.")' % x['name'], '}'] + logger.info(f"req_nover = {req_nover}") + if req_nover: + req_list = 'c(%s)' % ', '.join(['\"%s\"' % x for x in req_nover]) + if update: + # R_cmd = ['install.packages(%s, repos="%s")' % (req_list, repos)] + R_cmd += ['req <- %s' % req_list, + 'for (x in req) {', + ' if (is.element(x, installed.packages()[,1])) {', + ' remove.packages(x)', + ' }', + ' install.packages(x, dep=TRUE, repos="%s")' % repos, + '}'] + else: + R_cmd += ['req <- %s' % req_list, + 'for (x in req) {', + ' if (!is.element(x, installed.packages()[,1])) {', + ' print(sprintf("Installing \'%s\' from CRAN.", x))', + ' install.packages(x, dep=TRUE, repos="%s")' % repos, + ' } else {', + ' print(sprintf("%s already installed.", x))', + ' }', + '}'] if not call_R(R_cmd, **kwargs): logger.error("Error installing dependencies: %s" % ', '.join(package_list)) return False From e8e0bb5df89277cbe50f695711fa224c5aca4435 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Tue, 12 Sep 2023 17:52:08 -0400 Subject: [PATCH 05/47] Prune all SQL paths from PATH on windows GHA jobs --- utils/setup_test_env.py | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/utils/setup_test_env.py b/utils/setup_test_env.py index f0ccede6d..f06d6fcfc 100644 --- a/utils/setup_test_env.py +++ b/utils/setup_test_env.py @@ -522,17 +522,24 @@ def add_argument(*a_args, **a_kwargs): def prune_windows_path(): - to_remove = [ - 'C:\\Program Files\\Microsoft SQL Server\\140\\DTS\\Binn', - 'C:\\Program Files\\Microsoft SQL Server\\150\\DTS\\Binn', - 'C:\\Program Files\\Microsoft SQL Server\\160\\DTS\\Binn'] - print(f"PRUNING PATH: {os.environ['PATH']}") - path_list = os.environ['PATH'].split(os.pathsep) - for x in to_remove: - if x in path_list: - path_list.remove(x) + to_remove = ( + 'C:\\Program Files\\Microsoft SQL Server', ) + # to_remove = [ + # 'C:\\Program Files\\Microsoft SQL Server\\140\\DTS\\Binn', + # 'C:\\Program Files\\Microsoft SQL Server\\150\\DTS\\Binn', + # 'C:\\Program Files\\Microsoft SQL Server\\160\\DTS\\Binn'] + print(f"PRUNING PATH ({len(os.environ['PATH'])}): " + f"{os.environ['PATH']}") + old_path_list = os.environ['PATH'].split(os.pathsep) + path_list = [] + for x in old_path_list: + if not x.startswith(to_remove): + path_list.append(x) + # for x in to_remove: + # if x in path_list: + # path_list.remove(x) new_path = os.pathsep.join(path_list) - print(f"PRUNED PATH: {new_path}") + print(f"PRUNED PATH ({len(os.environ['PATH'])}): {new_path}") cmds = [f"set \"PATH={new_path}\""] return cmds From 45c86dc4ed038cdd7e11a6712b3c7d8b7452a55c Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Tue, 12 Sep 2023 18:56:22 -0400 Subject: [PATCH 06/47] Force install of deps --- yggdrasil/languages/R/install.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yggdrasil/languages/R/install.py b/yggdrasil/languages/R/install.py index c342602c8..fdeb2bcb5 100644 --- a/yggdrasil/languages/R/install.py +++ b/yggdrasil/languages/R/install.py @@ -180,7 +180,8 @@ def install_packages(package_list, update=False, repos=None, **kwargs): ('packageurl <- \"http://cran.r-project.org/src/contrib/Archive/%s/' '%s_%s.tar.gz\"') % (x['name'], x['name'], x['ver'])) name = 'packageurl' - args = ('repos=NULL, type=\"source\"' + # args = ('repos=NULL, type=\"source\"' + args = ('type=\"source\", dep=TRUE' + ("," if x.get('args', '') else "") + x.get('args', '')) if update: From d1b014c64896143930041071c73a60d6c1874b31 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Wed, 13 Sep 2023 13:55:09 -0400 Subject: [PATCH 07/47] Try to fix error where conda pytest is not available in command promp cmake test Use devtools to install specific version of an R package --- .github/workflows/test-install.yml | 35 +++++++++--------------------- utils/test-install-base.yml | 5 +++-- yggdrasil/languages/R/install.py | 32 ++++++++++++++++----------- 3 files changed, 32 insertions(+), 40 deletions(-) diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index 98d362b72..9b91e8441 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -434,11 +434,8 @@ jobs: run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: 'cmake -h - - pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py - - ' + run: 'cmake -h where.exe python # pytest --import-mode=importlib --ci --cov-append + --nocapture tests/drivers/test_CMakeModelDriver.py' shell: cmd /C CALL {0} timeout-minutes: 180 - continue-on-error: true @@ -781,11 +778,8 @@ jobs: run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: 'cmake -h - - pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py - - ' + run: 'cmake -h where.exe python # pytest --import-mode=importlib --ci --cov-append + --nocapture tests/drivers/test_CMakeModelDriver.py' shell: cmd /C CALL {0} timeout-minutes: 180 - continue-on-error: true @@ -1120,11 +1114,8 @@ jobs: run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: 'cmake -h - - pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py - - ' + run: 'cmake -h where.exe python # pytest --import-mode=importlib --ci --cov-append + --nocapture tests/drivers/test_CMakeModelDriver.py' shell: cmd /C CALL {0} timeout-minutes: 180 - continue-on-error: true @@ -1442,11 +1433,8 @@ jobs: run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: 'cmake -h - - pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py - - ' + run: 'cmake -h where.exe python # pytest --import-mode=importlib --ci --cov-append + --nocapture tests/drivers/test_CMakeModelDriver.py' shell: cmd /C CALL {0} timeout-minutes: 180 - continue-on-error: true @@ -1763,11 +1751,8 @@ jobs: run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: 'cmake -h - - pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py - - ' + run: 'cmake -h where.exe python # pytest --import-mode=importlib --ci --cov-append + --nocapture tests/drivers/test_CMakeModelDriver.py' shell: cmd /C CALL {0} timeout-minutes: 180 - continue-on-error: true diff --git a/utils/test-install-base.yml b/utils/test-install-base.yml index 2e88ad16e..3abd893d0 100644 --- a/utils/test-install-base.yml +++ b/utils/test-install-base.yml @@ -267,9 +267,10 @@ jobs: timeout-minutes: 180 if: runner.os == 'Windows' shell: cmd /C CALL {0} - run: | + run: >- cmake -h - pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + where.exe python + # pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py - name: Run tests (1st) timeout-minutes: 180 diff --git a/yggdrasil/languages/R/install.py b/yggdrasil/languages/R/install.py index fdeb2bcb5..d2977473a 100644 --- a/yggdrasil/languages/R/install.py +++ b/yggdrasil/languages/R/install.py @@ -175,27 +175,33 @@ def install_packages(package_list, update=False, repos=None, **kwargs): args = ('repos=\"%s\"' % repos + ("," if x.get('args', '') else "") + x.get('args', '')) + install_method = 'install.packages' if 'ver' in x: - R_cmd.append( - ('packageurl <- \"http://cran.r-project.org/src/contrib/Archive/%s/' - '%s_%s.tar.gz\"') % (x['name'], x['name'], x['ver'])) - name = 'packageurl' - # args = ('repos=NULL, type=\"source\"' - args = ('type=\"source\", dep=TRUE' + R_cmd += [ + 'install.packages("devtools")', + # ('packageurl <- \"http://cran.r-project.org/src/contrib/Archive/%s/' + # '%s_%s.tar.gz\"') % (x['name'], x['name'], x['ver']) + ] + install_method = 'devtools::install_version' + args = (f"version=\"{x['ver']}\"" + ("," if x.get('args', '') else "") + x.get('args', '')) + # name = 'packageurl' + # args = ('repos=NULL, type=\"source\"' + # + ("," if x.get('args', '') else "") + # + x.get('args', '')) if update: R_cmd += [ - 'if (is.element(\"%s\", installed.packages()[,1])) {' % x['name'], - ' remove.packages(\"%s\")' % x['name'], - '}' - 'install.packages(%s, %s)' % (name, args)] + f"if (is.element(\"{x['name']}\", installed.packages()[,1])) {{", + f" remove.packages(\"{x['name']}\")", + '}', + f"{install_method}({name}, {args})"] else: R_cmd += [ - 'if (!is.element(\"%s\", installed.packages()[,1])) {' % x['name'], - ' install.packages(%s, %s)' % (name, args), + f"if (!is.element(\"{x['name']}\", installed.packages()[,1])) {{", + f"{install_method}({name}, {args})", '} else {', - ' print("%s already installed.")' % x['name'], + f" print(\"{x['name']} already installed.\")", '}'] logger.info(f"req_nover = {req_nover}") if req_nover: From c50ff5147456291b5175fccdd196f3774996b317 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Thu, 14 Sep 2023 13:18:40 -0400 Subject: [PATCH 08/47] Add missing R install parameters and requirements Updated rapidjson --- yggdrasil/languages/R/install.py | 6 ++++-- yggdrasil/rapidjson | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/yggdrasil/languages/R/install.py b/yggdrasil/languages/R/install.py index d2977473a..4fdfa8c04 100644 --- a/yggdrasil/languages/R/install.py +++ b/yggdrasil/languages/R/install.py @@ -178,12 +178,14 @@ def install_packages(package_list, update=False, repos=None, **kwargs): install_method = 'install.packages' if 'ver' in x: R_cmd += [ - 'install.packages("devtools")', + f'install.packages("devtools", repos="{repos}", ' + f'dependencies=TRUE)', # ('packageurl <- \"http://cran.r-project.org/src/contrib/Archive/%s/' # '%s_%s.tar.gz\"') % (x['name'], x['name'], x['ver']) ] install_method = 'devtools::install_version' - args = (f"version=\"{x['ver']}\"" + args = (f"version=\"{x['ver']}\", repos=\"{repos}\"" + f"dependencies=TRUE" + ("," if x.get('args', '') else "") + x.get('args', '')) # name = 'packageurl' diff --git a/yggdrasil/rapidjson b/yggdrasil/rapidjson index 2834c199c..60dc74c5e 160000 --- a/yggdrasil/rapidjson +++ b/yggdrasil/rapidjson @@ -1 +1 @@ -Subproject commit 2834c199c414d6228a3551c117ba5ae016d3fdf9 +Subproject commit 60dc74c5e4ea192f88d7b5de073bd63053fdafd3 From eee468a5ca9ef08dccaf569660fa6769b7ea2e1e Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Thu, 14 Sep 2023 13:36:01 -0400 Subject: [PATCH 09/47] Added non-R dependencies for devtools to requirements --- recipe/meta.yaml | 2 + utils/requirements/requirements.json | 42 +++++++++++++++++++ utils/requirements/requirements.yaml | 16 +++++++ utils/requirements/requirements_condaonly.txt | 1 + 4 files changed, 61 insertions(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 48d509fc4..d41f2b1c3 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -122,6 +122,7 @@ outputs: - python - r-base - r-bit64 + - r-devtools - r-r6 - r-reticulate - r-units @@ -130,6 +131,7 @@ outputs: - {{ pin_subpackage('yggdrasil', exact=True) }} - r-base - r-bit64 + - r-devtools - r-r6 - r-reticulate - r-units diff --git a/utils/requirements/requirements.json b/utils/requirements/requirements.json index 00793ea82..353063df6 100644 --- a/utils/requirements/requirements.json +++ b/utils/requirements/requirements.json @@ -218,6 +218,48 @@ ] } }, + { + "r-devtools": { + "options": [ + { + "method": "conda", + "host": true + }, + { + "method": "cran" + } + ] + } + }, + { + "harfbuzz": { + "options": [ + { + "name": "libharfbuzz-dev", + "method": "apt", + "add": [ + "libfribidi-dev", + "r-cran-devtools" + ] + }, + { + "name": "harfbuzz", + "add": [ + "fribidi", + "libgit2" + ], + "method": "brew" + }, + { + "method": "skip", + "os": "win" + }, + { + "method": "conda_skip" + } + ] + } + }, { "r-bit64": [ { diff --git a/utils/requirements/requirements.yaml b/utils/requirements/requirements.yaml index 943277cd8..6b6d9f263 100644 --- a/utils/requirements/requirements.yaml +++ b/utils/requirements/requirements.yaml @@ -133,6 +133,22 @@ extras: add: [r-base-dev] - name: r method: brew + - r-devtools: + options: + - method: conda + host: True + - method: cran + - harfbuzz: + options: + - name: libharfbuzz-dev + method: apt + add: [libfribidi-dev, r-cran-devtools] + - name: harfbuzz + add: [fribidi, libgit2] + method: brew + - method: skip + os: win + - method: conda_skip - r-bit64: - method: conda host: True diff --git a/utils/requirements/requirements_condaonly.txt b/utils/requirements/requirements_condaonly.txt index 6d13b56e1..1fd666069 100644 --- a/utils/requirements/requirements_condaonly.txt +++ b/utils/requirements/requirements_condaonly.txt @@ -15,6 +15,7 @@ msmpi; platform_system == 'Windows' # [conda,mpi] openmpi; platform_system == 'Darwin' # [conda,mpi] r-base # [conda,r] r-bit64 # [conda,r] +r-devtools # [conda,r] r-r6 # [conda,r] r-reticulate # [conda,r] r-units # [conda,r] From ffde63581f51e807ea9a4655e2195140ec035d31 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Thu, 14 Sep 2023 13:37:22 -0400 Subject: [PATCH 10/47] Added missing comma --- yggdrasil/languages/R/install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yggdrasil/languages/R/install.py b/yggdrasil/languages/R/install.py index 4fdfa8c04..9c4eb7c15 100644 --- a/yggdrasil/languages/R/install.py +++ b/yggdrasil/languages/R/install.py @@ -184,7 +184,7 @@ def install_packages(package_list, update=False, repos=None, **kwargs): # '%s_%s.tar.gz\"') % (x['name'], x['name'], x['ver']) ] install_method = 'devtools::install_version' - args = (f"version=\"{x['ver']}\", repos=\"{repos}\"" + args = (f"version=\"{x['ver']}\", repos=\"{repos}\", " f"dependencies=TRUE" + ("," if x.get('args', '') else "") + x.get('args', '')) From 76f253c15fc9106539113f3b742754b711a455a8 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Thu, 14 Sep 2023 13:56:56 -0400 Subject: [PATCH 11/47] Updated vendored python_rapidjson --- _vendor/python_rapidjson/units.cpp | 12 ++++++++++++ yggdrasil/units.cpp | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/_vendor/python_rapidjson/units.cpp b/_vendor/python_rapidjson/units.cpp index 86045b60a..04ff1e854 100644 --- a/_vendor/python_rapidjson/units.cpp +++ b/_vendor/python_rapidjson/units.cpp @@ -1368,6 +1368,18 @@ static PyObject* quantity_array__array_ufunc__(PyObject* self, PyObject* args, P goto cleanup; } } + } else if (ufunc_name == "exp") { + if (_has_units(i0)) { + tmp2 = _get_units(i0); + if (((UnitsObject*)tmp2)->units->is_null()) { + Py_DECREF(tmp2); + convert_units = get_empty_units(); + } else { + // Allow radians here? + Py_DECREF(tmp2); + goto cleanup; + } + } } else if (ufunc_name == "sin" || ufunc_name == "cos" || ufunc_name == "tan" || diff --git a/yggdrasil/units.cpp b/yggdrasil/units.cpp index b3f5c9fe1..829280fc1 100644 --- a/yggdrasil/units.cpp +++ b/yggdrasil/units.cpp @@ -1368,6 +1368,18 @@ static PyObject* quantity_array__array_ufunc__(PyObject* self, PyObject* args, P goto cleanup; } } + } else if (ufunc_name == "exp") { + if (_has_units(i0)) { + tmp2 = _get_units(i0); + if (((UnitsObject*)tmp2)->units->is_null()) { + Py_DECREF(tmp2); + convert_units = get_empty_units(); + } else { + // Allow radians here? + Py_DECREF(tmp2); + goto cleanup; + } + } } else if (ufunc_name == "sin" || ufunc_name == "cos" || ufunc_name == "tan" || From f82cdd8ddd1401d76649c8e57935d73054607973 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Thu, 14 Sep 2023 14:22:30 -0400 Subject: [PATCH 12/47] Fix include order to ensure PY_ARRAY_UNIQUE_SYMBOL is set before numpy headers are included --- yggdrasil/languages/C/datatypes/datatypes.cpp | 1 - .../languages/C/datatypes/serialization.h | 3 +- yggdrasil/languages/C/tools.h | 30 ++++--------------- yggdrasil/rapidjson | 2 +- 4 files changed, 8 insertions(+), 28 deletions(-) diff --git a/yggdrasil/languages/C/datatypes/datatypes.cpp b/yggdrasil/languages/C/datatypes/datatypes.cpp index 244517dc4..be6f324d8 100644 --- a/yggdrasil/languages/C/datatypes/datatypes.cpp +++ b/yggdrasil/languages/C/datatypes/datatypes.cpp @@ -3,7 +3,6 @@ #include "utils.h" #include "serialization.h" -#define RAPIDJSON_YGGDRASIL #include "rapidjson/document.h" #include "rapidjson/writer.h" #include "rapidjson/prettywriter.h" diff --git a/yggdrasil/languages/C/datatypes/serialization.h b/yggdrasil/languages/C/datatypes/serialization.h index 3b98449f4..84661a0c9 100644 --- a/yggdrasil/languages/C/datatypes/serialization.h +++ b/yggdrasil/languages/C/datatypes/serialization.h @@ -7,11 +7,10 @@ #else #include "../regex/regex_posix.h" #endif +#include "../tools.h" #include "../constants.h" #include "utils.h" -#define RAPIDJSON_YGGDRASIL -#define RAPIDJSON_HAS_STDSTRING 1 #include "rapidjson/document.h" #include "rapidjson/writer.h" #include "rapidjson/prettywriter.h" diff --git a/yggdrasil/languages/C/tools.h b/yggdrasil/languages/C/tools.h index 6ee8604b0..51aea29d4 100644 --- a/yggdrasil/languages/C/tools.h +++ b/yggdrasil/languages/C/tools.h @@ -111,34 +111,16 @@ typedef long double _Complex complex_long_double; #define print_complex(x) printf("%lf+%lfj\n", (double)creal(x), (double)cimag(x)) #endif +#include // Required to prevent error when using mingw on windows + +#define RAPIDJSON_YGGDRASIL +#define RAPIDJSON_HAS_STDSTRING 1 +#include "rapidjson/pyrj_c.h" + #ifdef __cplusplus /* If this is a C++ compiler, use C linkage */ extern "C" { #endif -#include // Required to prevent error when using mingw on windows -#ifdef YGGDRASIL_DISABLE_PYTHON_C_API -#ifndef PyObject -#define PyObject void* -#endif -#ifndef npy_intp -#define npy_intp int -#endif -#else // YGGDRASIL_DISABLE_PYTHON_C_API -#ifdef _DEBUG -#undef _DEBUG -#include -#include -#include -#include -#define _DEBUG -#else -#include -#include -#include -#include -#endif -#endif // YGGDRASIL_DISABLE_PYTHON_C_API - /*! @brief Wrapper for a complex number with float components. */ typedef struct complex_float_t { float re; //!< Real component diff --git a/yggdrasil/rapidjson b/yggdrasil/rapidjson index 60dc74c5e..2d73ea373 160000 --- a/yggdrasil/rapidjson +++ b/yggdrasil/rapidjson @@ -1 +1 @@ -Subproject commit 60dc74c5e4ea192f88d7b5de073bd63053fdafd3 +Subproject commit 2d73ea373785153f06040845c3a0ce229293f934 From a439d5d5ee57a0f2d6a36baaf6f343b6b1e329d4 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Thu, 14 Sep 2023 15:37:36 -0400 Subject: [PATCH 13/47] Fix bug where static Python library ignored on unix systems unless set in config file Only install devtools if it is not already installed --- yggdrasil/drivers/CModelDriver.py | 10 ++++++---- yggdrasil/languages/R/install.py | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/yggdrasil/drivers/CModelDriver.py b/yggdrasil/drivers/CModelDriver.py index dff798013..38a5aaeca 100755 --- a/yggdrasil/drivers/CModelDriver.py +++ b/yggdrasil/drivers/CModelDriver.py @@ -554,11 +554,13 @@ class MSVCArchiver(ArchiverBase): libtype_order = ['static', 'shared'] else: libtype_order = ['shared', 'static'] - _python_lib = ygg_cfg.get('c', 'python_%s' % libtype_order[0], - ygg_cfg.get('c', 'python_%s' % libtype_order[1], None)) - if (_python_lib is None) or (not os.path.isfile(_python_lib)): # pragma: no cover + _python_lib = ygg_cfg.get('c', f'python_{libtype_order[0]}', + ygg_cfg.get('c', f'python_{libtype_order[1]}', None)) + for _python_libtype in libtype_order: + if (_python_lib is not None) and os.path.isfile(_python_lib): + break _python_lib = tools.get_python_c_library( - allow_failure=True, libtype=libtype_order[0]) + allow_failure=True, libtype=_python_libtype) except BaseException as e: # pragma: debug warnings.warn("ERROR LOCATING PYTHON LIBRARY: %s" % e) _python_lib = None diff --git a/yggdrasil/languages/R/install.py b/yggdrasil/languages/R/install.py index 9c4eb7c15..b15567ad0 100644 --- a/yggdrasil/languages/R/install.py +++ b/yggdrasil/languages/R/install.py @@ -178,8 +178,10 @@ def install_packages(package_list, update=False, repos=None, **kwargs): install_method = 'install.packages' if 'ver' in x: R_cmd += [ - f'install.packages("devtools", repos="{repos}", ' + "if (!is.element(\"devtools\", installed.packages()[,1])) {", + f' install.packages("devtools", repos="{repos}", ' f'dependencies=TRUE)', + "}", # ('packageurl <- \"http://cran.r-project.org/src/contrib/Archive/%s/' # '%s_%s.tar.gz\"') % (x['name'], x['name'], x['ver']) ] From 212ea35826e9ccc8a2ec469f8fb996748b0dafbf Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Fri, 15 Sep 2023 11:41:59 -0400 Subject: [PATCH 14/47] Added specialized header that can be include outside of the main source file for an model (e.g. in the case of OSR where there is more than one source file) --- docs/source/development/todo.rst | 1 + yggdrasil/languages/C/YggInterface.c | 1 + yggdrasil/languages/C/YggInterface.h | 3 +++ yggdrasil/languages/C/YggLibrary.h | 7 +++++++ yggdrasil/languages/C/communication/communication.h | 1 + yggdrasil/languages/CPP/YggInterface.cpp | 1 + yggdrasil/languages/CPP/YggLibrary.hpp | 7 +++++++ 7 files changed, 21 insertions(+) create mode 100755 yggdrasil/languages/C/YggLibrary.h create mode 100755 yggdrasil/languages/CPP/YggLibrary.hpp diff --git a/docs/source/development/todo.rst b/docs/source/development/todo.rst index 1a8fffbdb..bfc865013 100644 --- a/docs/source/development/todo.rst +++ b/docs/source/development/todo.rst @@ -20,6 +20,7 @@ Documentation * Expand development section into contributing guide * Go through and update/prune interface documentation * Docs on default_file/default_value +* Docs on use of YggInterface.h vs YggLibrary.h in main source vs. other source files when a module has more than one Refactor -------- diff --git a/yggdrasil/languages/C/YggInterface.c b/yggdrasil/languages/C/YggInterface.c index 4109ee449..3d322506b 100644 --- a/yggdrasil/languages/C/YggInterface.c +++ b/yggdrasil/languages/C/YggInterface.c @@ -1 +1,2 @@ +#define YGGINTERFACE_OUTSIDE_MAIN #include "YggInterface.h" diff --git a/yggdrasil/languages/C/YggInterface.h b/yggdrasil/languages/C/YggInterface.h index 8d26a67d2..8625db882 100755 --- a/yggdrasil/languages/C/YggInterface.h +++ b/yggdrasil/languages/C/YggInterface.h @@ -2,6 +2,9 @@ #ifndef YGGINTERFACE_H_ #define YGGINTERFACE_H_ +#ifndef YGGINTERFACE_OUTSIDE_MAIN +#define RAPIDJSON_FORCE_IMPORT_ARRAY +#endif // YGGINTERFACE_OUTSIDE_MAIN #include "../tools.h" #include "../datatypes/datatypes.h" #include "../communication/communication.h" diff --git a/yggdrasil/languages/C/YggLibrary.h b/yggdrasil/languages/C/YggLibrary.h new file mode 100755 index 000000000..4b40f48e4 --- /dev/null +++ b/yggdrasil/languages/C/YggLibrary.h @@ -0,0 +1,7 @@ +#ifndef YGGLIBRARY_H_ +#define YGGLIBRARY_H_ + +#define YGGINTERFACE_OUTSIDE_MAIN +#include "YggInterface.h" + +#endif // YGGLIBRARY_H_ diff --git a/yggdrasil/languages/C/communication/communication.h b/yggdrasil/languages/C/communication/communication.h index ef8fa0d40..b4896b57d 100644 --- a/yggdrasil/languages/C/communication/communication.h +++ b/yggdrasil/languages/C/communication/communication.h @@ -310,6 +310,7 @@ int ygg_init() { #endif ygglog_debug("ygg_init: clean_registered = %d", clean_registered); if (clean_registered == 0) { + init_python_API(); #if defined(ZMQINSTALLED) if (!(ygg_zsys_init())) { out = -1; diff --git a/yggdrasil/languages/CPP/YggInterface.cpp b/yggdrasil/languages/CPP/YggInterface.cpp index 78de68684..936ee72c4 100644 --- a/yggdrasil/languages/CPP/YggInterface.cpp +++ b/yggdrasil/languages/CPP/YggInterface.cpp @@ -1 +1,2 @@ +#define YGGINTERFACE_OUTSIDE_MAIN #include "YggInterface.hpp" diff --git a/yggdrasil/languages/CPP/YggLibrary.hpp b/yggdrasil/languages/CPP/YggLibrary.hpp new file mode 100755 index 000000000..f10c2b0be --- /dev/null +++ b/yggdrasil/languages/CPP/YggLibrary.hpp @@ -0,0 +1,7 @@ +#ifndef YGGLIBRARY_HPP_ +#define YGGLIBRARY_HPP_ + +#define YGGINTERFACE_OUTSIDE_MAIN +#include "YggInterface.hpp" + +#endif // YGGLIBRARY_HPP_ From 427470a674c31f01bc47e554284a50b7be2c9ed9 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Fri, 15 Sep 2023 11:54:12 -0400 Subject: [PATCH 15/47] Only install devtools if package with version is installed --- yggdrasil/languages/R/install.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/yggdrasil/languages/R/install.py b/yggdrasil/languages/R/install.py index b15567ad0..ce63e6527 100644 --- a/yggdrasil/languages/R/install.py +++ b/yggdrasil/languages/R/install.py @@ -175,9 +175,10 @@ def install_packages(package_list, update=False, repos=None, **kwargs): args = ('repos=\"%s\"' % repos + ("," if x.get('args', '') else "") + x.get('args', '')) - install_method = 'install.packages' + before_install = '' + install_method = [] if 'ver' in x: - R_cmd += [ + before_install = [ "if (!is.element(\"devtools\", installed.packages()[,1])) {", f' install.packages("devtools", repos="{repos}", ' f'dependencies=TRUE)', @@ -198,12 +199,16 @@ def install_packages(package_list, update=False, repos=None, **kwargs): R_cmd += [ f"if (is.element(\"{x['name']}\", installed.packages()[,1])) {{", f" remove.packages(\"{x['name']}\")", - '}', + '}'] + R_cmd += before_install + R_cmd += [ f"{install_method}({name}, {args})"] else: R_cmd += [ - f"if (!is.element(\"{x['name']}\", installed.packages()[,1])) {{", - f"{install_method}({name}, {args})", + f"if (!is.element(\"{x['name']}\", installed.packages()[,1])) {{"] + R_cmd += [' ' + iline for iline in before_install] + R_cmd += [ + f" {install_method}({name}, {args})", '} else {', f" print(\"{x['name']} already installed.\")", '}'] From 86c8e3188836558e81a0fe743f730337be058ada Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Fri, 15 Sep 2023 12:00:29 -0400 Subject: [PATCH 16/47] Add missing library statement and only install pinned diffr on ubuntu --- yggdrasil/languages/R/install.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yggdrasil/languages/R/install.py b/yggdrasil/languages/R/install.py index ce63e6527..0db0fefa1 100644 --- a/yggdrasil/languages/R/install.py +++ b/yggdrasil/languages/R/install.py @@ -183,6 +183,7 @@ def install_packages(package_list, update=False, repos=None, **kwargs): f' install.packages("devtools", repos="{repos}", ' f'dependencies=TRUE)', "}", + "library(devtools)", # ('packageurl <- \"http://cran.r-project.org/src/contrib/Archive/%s/' # '%s_%s.tar.gz\"') % (x['name'], x['name'], x['ver']) ] @@ -399,7 +400,8 @@ def install(args=None, with_sudo=None, skip_requirements=None, requirements = requirements_from_description() if os.environ.get('BUILDDOCS', '') == '1': requirements += ['roxygen2', 'Rd2md'] - requirements.insert(0, 'vdiffr (<= 1.0.5)') + if 'linux' in sys.platform: + requirements.insert(0, 'vdiffr (<= 1.0.5)') if not install_packages(requirements, update=update_requirements, R_exe=Rscript_exe, **kwargs): logger.error("Failed to install dependencies") From 8341621a62b9b7658b2665faee80b9e7ac01da5e Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Mon, 18 Sep 2023 13:06:03 -0400 Subject: [PATCH 17/47] Fix syntax error in R install --- yggdrasil/languages/R/install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yggdrasil/languages/R/install.py b/yggdrasil/languages/R/install.py index 0db0fefa1..dc2d65af9 100644 --- a/yggdrasil/languages/R/install.py +++ b/yggdrasil/languages/R/install.py @@ -176,7 +176,7 @@ def install_packages(package_list, update=False, repos=None, **kwargs): + ("," if x.get('args', '') else "") + x.get('args', '')) before_install = '' - install_method = [] + install_method = 'install.packages' if 'ver' in x: before_install = [ "if (!is.element(\"devtools\", installed.packages()[,1])) {", From 1c5dcd25c22e060bd8caf29c8ef41affdea186d7 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Mon, 18 Sep 2023 14:48:47 -0400 Subject: [PATCH 18/47] Use tar instead of gtar if gtar not available for R devtools install --- yggdrasil/languages/R/install.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yggdrasil/languages/R/install.py b/yggdrasil/languages/R/install.py index dc2d65af9..3b1520c27 100644 --- a/yggdrasil/languages/R/install.py +++ b/yggdrasil/languages/R/install.py @@ -187,6 +187,11 @@ def install_packages(package_list, update=False, repos=None, **kwargs): # ('packageurl <- \"http://cran.r-project.org/src/contrib/Archive/%s/' # '%s_%s.tar.gz\"') % (x['name'], x['name'], x['ver']) ] + if not shutil.which('gtar'): + tar_exe = shutil.which('tar') + assert tar_exe + before_install.insert( + 0, f'Sys.setenv(TAR = "{tar_exe}")') install_method = 'devtools::install_version' args = (f"version=\"{x['ver']}\", repos=\"{repos}\", " f"dependencies=TRUE" From 0df3a15b52d92a180faf3420ace5bd8c2eee0ee7 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Mon, 18 Sep 2023 15:23:47 -0400 Subject: [PATCH 19/47] Only install vdiffr 1.0.5 on non-conda install --- yggdrasil/languages/R/install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yggdrasil/languages/R/install.py b/yggdrasil/languages/R/install.py index 3b1520c27..10a680452 100644 --- a/yggdrasil/languages/R/install.py +++ b/yggdrasil/languages/R/install.py @@ -405,7 +405,7 @@ def install(args=None, with_sudo=None, skip_requirements=None, requirements = requirements_from_description() if os.environ.get('BUILDDOCS', '') == '1': requirements += ['roxygen2', 'Rd2md'] - if 'linux' in sys.platform: + if 'linux' in sys.platform and (not os.environ.get('CONDA_PREFIX', '')): requirements.insert(0, 'vdiffr (<= 1.0.5)') if not install_packages(requirements, update=update_requirements, R_exe=Rscript_exe, **kwargs): From d9e091a30c6fbf4c243cea547bbcf64a4b5e6b6d Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Mon, 18 Sep 2023 15:54:44 -0400 Subject: [PATCH 20/47] Multiple lines in command prompt --- .github/workflows/test-install.yml | 45 +++++++++++++++++++++++------- utils/test-install-base.yml | 2 +- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index 9b91e8441..3648fce47 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -434,8 +434,13 @@ jobs: run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: 'cmake -h where.exe python # pytest --import-mode=importlib --ci --cov-append - --nocapture tests/drivers/test_CMakeModelDriver.py' + run: 'cmake -h + + where.exe python + + # pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + + ' shell: cmd /C CALL {0} timeout-minutes: 180 - continue-on-error: true @@ -778,8 +783,13 @@ jobs: run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: 'cmake -h where.exe python # pytest --import-mode=importlib --ci --cov-append - --nocapture tests/drivers/test_CMakeModelDriver.py' + run: 'cmake -h + + where.exe python + + # pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + + ' shell: cmd /C CALL {0} timeout-minutes: 180 - continue-on-error: true @@ -1114,8 +1124,13 @@ jobs: run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: 'cmake -h where.exe python # pytest --import-mode=importlib --ci --cov-append - --nocapture tests/drivers/test_CMakeModelDriver.py' + run: 'cmake -h + + where.exe python + + # pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + + ' shell: cmd /C CALL {0} timeout-minutes: 180 - continue-on-error: true @@ -1433,8 +1448,13 @@ jobs: run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: 'cmake -h where.exe python # pytest --import-mode=importlib --ci --cov-append - --nocapture tests/drivers/test_CMakeModelDriver.py' + run: 'cmake -h + + where.exe python + + # pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + + ' shell: cmd /C CALL {0} timeout-minutes: 180 - continue-on-error: true @@ -1751,8 +1771,13 @@ jobs: run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: 'cmake -h where.exe python # pytest --import-mode=importlib --ci --cov-append - --nocapture tests/drivers/test_CMakeModelDriver.py' + run: 'cmake -h + + where.exe python + + # pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + + ' shell: cmd /C CALL {0} timeout-minutes: 180 - continue-on-error: true diff --git a/utils/test-install-base.yml b/utils/test-install-base.yml index 3abd893d0..489637348 100644 --- a/utils/test-install-base.yml +++ b/utils/test-install-base.yml @@ -267,7 +267,7 @@ jobs: timeout-minutes: 180 if: runner.os == 'Windows' shell: cmd /C CALL {0} - run: >- + run: | cmake -h where.exe python # pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py From 02063fa937f7678f02330eefd2d9713a2018db1d Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Tue, 19 Sep 2023 14:53:09 -0400 Subject: [PATCH 21/47] Fix missing symbol on compilation of shared library --- yggdrasil/languages/C/YggInterface.c | 2 +- yggdrasil/languages/CPP/YggInterface.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/yggdrasil/languages/C/YggInterface.c b/yggdrasil/languages/C/YggInterface.c index 3d322506b..594d1f663 100644 --- a/yggdrasil/languages/C/YggInterface.c +++ b/yggdrasil/languages/C/YggInterface.c @@ -1,2 +1,2 @@ -#define YGGINTERFACE_OUTSIDE_MAIN +// #define YGGINTERFACE_OUTSIDE_MAIN #include "YggInterface.h" diff --git a/yggdrasil/languages/CPP/YggInterface.cpp b/yggdrasil/languages/CPP/YggInterface.cpp index 936ee72c4..c75884f95 100644 --- a/yggdrasil/languages/CPP/YggInterface.cpp +++ b/yggdrasil/languages/CPP/YggInterface.cpp @@ -1,2 +1,2 @@ -#define YGGINTERFACE_OUTSIDE_MAIN +// #define YGGINTERFACE_OUTSIDE_MAIN #include "YggInterface.hpp" From 368108aba04e3efc1e16045d408b0e82e0b3031a Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Wed, 20 Sep 2023 13:23:34 -0400 Subject: [PATCH 22/47] Move all types into datatypes and fix undefined/duplicate numpy array API symbols --- yggdrasil/languages/C/YggInterface.c | 3 +- yggdrasil/languages/C/YggInterface.h | 6 +- yggdrasil/languages/C/datatypes/datatypes.cpp | 7 +- yggdrasil/languages/C/datatypes/datatypes.h | 120 +++++++++++++++++- yggdrasil/languages/C/tools.h | 106 ---------------- yggdrasil/languages/CPP/YggInterface.cpp | 3 +- yggdrasil/languages/CPP/YggInterface.hpp | 1 - 7 files changed, 131 insertions(+), 115 deletions(-) diff --git a/yggdrasil/languages/C/YggInterface.c b/yggdrasil/languages/C/YggInterface.c index 594d1f663..2d81b3746 100644 --- a/yggdrasil/languages/C/YggInterface.c +++ b/yggdrasil/languages/C/YggInterface.c @@ -1,2 +1,3 @@ -// #define YGGINTERFACE_OUTSIDE_MAIN +#define RAPIDJSON_FORCE_IMPORT_ARRAY +#include "rapidjson/pyrj_c.h" #include "YggInterface.h" diff --git a/yggdrasil/languages/C/YggInterface.h b/yggdrasil/languages/C/YggInterface.h index 8625db882..89d52954b 100755 --- a/yggdrasil/languages/C/YggInterface.h +++ b/yggdrasil/languages/C/YggInterface.h @@ -2,9 +2,9 @@ #ifndef YGGINTERFACE_H_ #define YGGINTERFACE_H_ -#ifndef YGGINTERFACE_OUTSIDE_MAIN -#define RAPIDJSON_FORCE_IMPORT_ARRAY -#endif // YGGINTERFACE_OUTSIDE_MAIN +/* #ifndef YGGINTERFACE_OUTSIDE_MAIN */ +/* #define RAPIDJSON_FORCE_IMPORT_ARRAY */ +/* #endif // YGGINTERFACE_OUTSIDE_MAIN */ #include "../tools.h" #include "../datatypes/datatypes.h" #include "../communication/communication.h" diff --git a/yggdrasil/languages/C/datatypes/datatypes.cpp b/yggdrasil/languages/C/datatypes/datatypes.cpp index be6f324d8..25d9cb440 100644 --- a/yggdrasil/languages/C/datatypes/datatypes.cpp +++ b/yggdrasil/languages/C/datatypes/datatypes.cpp @@ -1,4 +1,3 @@ -#include "../tools.h" #include "datatypes.h" #include "utils.h" #include "serialization.h" @@ -1706,6 +1705,12 @@ extern "C" { return out; } + python_t init_python() { + python_t out; + out.obj = NULL; + return out; + } + void destroy_python(python_t *x) { if (x != NULL) { if (x->obj != NULL) { diff --git a/yggdrasil/languages/C/datatypes/datatypes.h b/yggdrasil/languages/C/datatypes/datatypes.h index 4848f208c..85eb5a589 100644 --- a/yggdrasil/languages/C/datatypes/datatypes.h +++ b/yggdrasil/languages/C/datatypes/datatypes.h @@ -3,12 +3,117 @@ #include -#include "../tools.h" +#define RAPIDJSON_YGGDRASIL +#define RAPIDJSON_HAS_STDSTRING 1 + +#ifdef YGGDRASIL_DISABLE_PYTHON_C_API + +#ifndef PyObject +#define PyObject void* +#endif + +#else // YGGDRASIL_DISABLE_PYTHON_C_API + +#ifdef _DEBUG +#undef _DEBUG +#include +#define _DEBUG +#else +#include +#endif + +#endif // YGGDRASIL_DISABLE_PYTHON_C_API + +#ifdef USE_OSR_YGG +struct complex_float{ + float re; + float im; +}; +struct complex_double{ + double re; + double im; +}; +struct complex_long_double{ + long double re; + long double im; +}; +typedef struct complex_float complex_float; +typedef struct complex_double complex_double; +typedef struct complex_long_double complex_long_double; +#define creal(x) x.re +#define crealf(x) x.re +#define creall(x) x.re +#define cimag(x) x.im +#define cimagf(x) x.im +#define cimagl(x) x.im +#else /*USE_YGG_OSR*/ +#ifdef _MSC_VER +#ifdef __cplusplus +#include +typedef std::complex complex_float; +typedef std::complex complex_double; +typedef std::complex complex_long_double; +#ifndef creal +#define creal(x) x.real() +#define crealf(x) x.real() +#define creall(x) x.real() +#define cimag(x) x.imag() +#define cimagf(x) x.imag() +#define cimagl(x) x.imag() +#endif /*creal*/ +#else /*__cplusplus*/ +#include +typedef _Fcomplex complex_float; +typedef _Dcomplex complex_double; +typedef _Lcomplex complex_long_double; +#define print_complex(x) printf("%lf+%lfj\n", (double)(x._Val[0]), (double)(x._Val[1])) +#endif /*__cplusplus*/ +#else // Unix +#ifdef __cplusplus +#include +typedef std::complex complex_float; +typedef std::complex complex_double; +typedef std::complex complex_long_double; +#ifndef creal +#define creal(x) x.real() +#define crealf(x) x.real() +#define creall(x) x.real() +#define cimag(x) x.imag() +#define cimagf(x) x.imag() +#define cimagl(x) x.imag() +#endif /*creal*/ +#else /*__cplusplus*/ +#include +typedef float _Complex complex_float; +typedef double _Complex complex_double; +typedef long double _Complex complex_long_double; +#endif /*__cplusplus*/ +#endif /*Unix*/ +#endif /*USE_YGG_OSR*/ +#ifndef print_complex +#define print_complex(x) printf("%lf+%lfj\n", (double)creal(x), (double)cimag(x)) +#endif #ifdef __cplusplus /* If this is a C++ compiler, use C linkage */ extern "C" { #endif +/*! @brief Wrapper for a complex number with float components. */ +typedef struct complex_float_t { + float re; //!< Real component + float im; //!< Imaginary component +} complex_float_t; +/*! @brief Wrapper for a complex number with double components. */ +typedef struct complex_double_t { + double re; //!< Real component + double im; //!< Imaginary component +} complex_double_t; +/*! @brief Wrapper for a complex number with long double components. */ +typedef struct complex_long_double_t { + long double re; //!< Real component + long double im; //!< Imaginary component +} complex_long_double_t; + /*! @brief C-friendly definition of rapidjson::Document. */ typedef struct dtype_t { void *metadata; //!< Pointer ot rapidjson::Document containing additional metadata. @@ -32,6 +137,11 @@ typedef struct va_list_t { void* va; } va_list_t; +/*! @brief Structure used to wrap Python objects. */ +typedef struct python_t { + PyObject *obj; //!< Python object. +} python_t; + /*! @brief C-friendly definition of vector object. */ typedef generic_t json_array_t; @@ -421,7 +531,13 @@ int generic_set_item(generic_t x, const char *type, void* value); /*! ->>>>>>> topic/timesync + @brief Initialize a structure to contain a Python object. + @returns python_t New Python object structure. + */ +python_t init_python(); + + +/*! @brief Destroy a structure containing a Python object. @param[in] x python_t* Pointer to Python object structure that should be freed. */ diff --git a/yggdrasil/languages/C/tools.h b/yggdrasil/languages/C/tools.h index 51aea29d4..112dfd704 100644 --- a/yggdrasil/languages/C/tools.h +++ b/yggdrasil/languages/C/tools.h @@ -41,101 +41,12 @@ #include -#ifdef USE_OSR_YGG -struct complex_float{ - float re; - float im; -}; -struct complex_double{ - double re; - double im; -}; -struct complex_long_double{ - long double re; - long double im; -}; -typedef struct complex_float complex_float; -typedef struct complex_double complex_double; -typedef struct complex_long_double complex_long_double; -#define creal(x) x.re -#define crealf(x) x.re -#define creall(x) x.re -#define cimag(x) x.im -#define cimagf(x) x.im -#define cimagl(x) x.im -#else /*USE_YGG_OSR*/ -#ifdef _MSC_VER -#ifdef __cplusplus -#include -typedef std::complex complex_float; -typedef std::complex complex_double; -typedef std::complex complex_long_double; -#ifndef creal -#define creal(x) x.real() -#define crealf(x) x.real() -#define creall(x) x.real() -#define cimag(x) x.imag() -#define cimagf(x) x.imag() -#define cimagl(x) x.imag() -#endif /*creal*/ -#else /*__cplusplus*/ -#include -typedef _Fcomplex complex_float; -typedef _Dcomplex complex_double; -typedef _Lcomplex complex_long_double; -#define print_complex(x) printf("%lf+%lfj\n", (double)(x._Val[0]), (double)(x._Val[1])) -#endif /*__cplusplus*/ -#else // Unix -#ifdef __cplusplus -#include -typedef std::complex complex_float; -typedef std::complex complex_double; -typedef std::complex complex_long_double; -#ifndef creal -#define creal(x) x.real() -#define crealf(x) x.real() -#define creall(x) x.real() -#define cimag(x) x.imag() -#define cimagf(x) x.imag() -#define cimagl(x) x.imag() -#endif /*creal*/ -#else /*__cplusplus*/ -#include -typedef float _Complex complex_float; -typedef double _Complex complex_double; -typedef long double _Complex complex_long_double; -#endif /*__cplusplus*/ -#endif /*Unix*/ -#endif /*USE_YGG_OSR*/ -#ifndef print_complex -#define print_complex(x) printf("%lf+%lfj\n", (double)creal(x), (double)cimag(x)) -#endif - #include // Required to prevent error when using mingw on windows -#define RAPIDJSON_YGGDRASIL -#define RAPIDJSON_HAS_STDSTRING 1 -#include "rapidjson/pyrj_c.h" - #ifdef __cplusplus /* If this is a C++ compiler, use C linkage */ extern "C" { #endif -/*! @brief Wrapper for a complex number with float components. */ -typedef struct complex_float_t { - float re; //!< Real component - float im; //!< Imaginary component -} complex_float_t; -/*! @brief Wrapper for a complex number with double components. */ -typedef struct complex_double_t { - double re; //!< Real component - double im; //!< Imaginary component -} complex_double_t; -/*! @brief Wrapper for a complex number with long double components. */ -typedef struct complex_long_double_t { - long double re; //!< Real component - long double im; //!< Imaginary component -} complex_long_double_t; // Platform specific #ifdef _WIN32 #include "regex/regex_win32.h" @@ -213,11 +124,6 @@ unsigned long ptr2seed(void *ptr) { }; -/*! @brief Structure used to wrap Python objects. */ -typedef struct python_t { - PyObject *obj; //!< Python object. -} python_t; - /*! @brief Get the ID for the current thread (if inside one). @returns int Thread ID. @@ -238,18 +144,6 @@ int get_thread_id() { }; -/*! - @brief Initialize a structure to contain a Python object. - @returns python_t New Python object structure. - */ -static inline -python_t init_python() { - python_t out; - out.obj = NULL; - return out; -}; - - //============================================================================== /*! Logging diff --git a/yggdrasil/languages/CPP/YggInterface.cpp b/yggdrasil/languages/CPP/YggInterface.cpp index c75884f95..ba1e337a7 100644 --- a/yggdrasil/languages/CPP/YggInterface.cpp +++ b/yggdrasil/languages/CPP/YggInterface.cpp @@ -1,2 +1,3 @@ -// #define YGGINTERFACE_OUTSIDE_MAIN +#define RAPIDJSON_FORCE_IMPORT_ARRAY +#include "rapidjson/pyrj_c.h" #include "YggInterface.hpp" diff --git a/yggdrasil/languages/CPP/YggInterface.hpp b/yggdrasil/languages/CPP/YggInterface.hpp index b803220ce..79387ff03 100755 --- a/yggdrasil/languages/CPP/YggInterface.hpp +++ b/yggdrasil/languages/CPP/YggInterface.hpp @@ -2,7 +2,6 @@ #ifndef YGGINTERFACE_HPP_ #define YGGINTERFACE_HPP_ -#define RAPIDJSON_YGGDRASIL #include "YggInterface.h" #include "datatypes/serialization.h" #include From 808d376f374f8c4821ca2d913323f93e899f2b66 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Wed, 20 Sep 2023 13:28:51 -0400 Subject: [PATCH 23/47] Uncomment pytest command in windows command prompt --- .github/workflows/test-install.yml | 10 +++++----- utils/test-install-base.yml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index 3648fce47..bbf514664 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -438,7 +438,7 @@ jobs: where.exe python - # pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + python -m pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py ' shell: cmd /C CALL {0} @@ -787,7 +787,7 @@ jobs: where.exe python - # pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + python -m pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py ' shell: cmd /C CALL {0} @@ -1128,7 +1128,7 @@ jobs: where.exe python - # pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + python -m pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py ' shell: cmd /C CALL {0} @@ -1452,7 +1452,7 @@ jobs: where.exe python - # pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + python -m pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py ' shell: cmd /C CALL {0} @@ -1775,7 +1775,7 @@ jobs: where.exe python - # pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + python -m pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py ' shell: cmd /C CALL {0} diff --git a/utils/test-install-base.yml b/utils/test-install-base.yml index 489637348..f59f4866b 100644 --- a/utils/test-install-base.yml +++ b/utils/test-install-base.yml @@ -270,7 +270,7 @@ jobs: run: | cmake -h where.exe python - # pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + python -m pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py - name: Run tests (1st) timeout-minutes: 180 From cb33e893e478c7c805bbf50815f9d6db8029141a Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Wed, 20 Sep 2023 13:35:01 -0400 Subject: [PATCH 24/47] Updated rapidjson --- yggdrasil/rapidjson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yggdrasil/rapidjson b/yggdrasil/rapidjson index 2d73ea373..1b5501349 160000 --- a/yggdrasil/rapidjson +++ b/yggdrasil/rapidjson @@ -1 +1 @@ -Subproject commit 2d73ea373785153f06040845c3a0ce229293f934 +Subproject commit 1b5501349ee6cbbc1b71c10b930c7225ed61eb6f From c22d1372b92d0a23cf6dacaa0d4e6153da719b8c Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Wed, 20 Sep 2023 14:46:02 -0400 Subject: [PATCH 25/47] Fix imports for MSVC --- yggdrasil/languages/C/datatypes/datatypes.h | 29 +++++++++++++++++++ yggdrasil/languages/C/tools.h | 31 +-------------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/yggdrasil/languages/C/datatypes/datatypes.h b/yggdrasil/languages/C/datatypes/datatypes.h index 85eb5a589..5d6c39345 100644 --- a/yggdrasil/languages/C/datatypes/datatypes.h +++ b/yggdrasil/languages/C/datatypes/datatypes.h @@ -1,6 +1,35 @@ #ifndef DATATYPES_H_ #define DATATYPES_H_ +// Required for M_PI on MSVC +#ifndef _USE_MATH_DEFINES +#define _USE_MATH_DEFINES +#endif + +#ifndef RAPIDJSON_NO_INT64DEFINE +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS +#endif +#ifndef __STDC_CONSTANT_MACROS +#define __STDC_CONSTANT_MACROS +#endif +#if defined(_MSC_VER) && (_MSC_VER < 1800) // Visual Studio 2013 +#include "rapidjson/msinttypes/stdint.h" +#include "rapidjson/msinttypes/inttypes.h" +#else +// Other compilers should have this. +#include +#include +#endif +#endif // RAPIDJSON_NO_INT64DEFINE + +#ifdef _MSC_VER +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS 1 +#endif +#endif + +#include // Required to prevent error when using mingw on windows #include #define RAPIDJSON_YGGDRASIL diff --git a/yggdrasil/languages/C/tools.h b/yggdrasil/languages/C/tools.h index 112dfd704..94a4933dd 100644 --- a/yggdrasil/languages/C/tools.h +++ b/yggdrasil/languages/C/tools.h @@ -1,33 +1,7 @@ #ifndef YGGTOOLS_H_ #define YGGTOOLS_H_ -// Required for M_PI on MSVC -#ifndef _USE_MATH_DEFINES -#define _USE_MATH_DEFINES -#endif - -#ifndef RAPIDJSON_NO_INT64DEFINE -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS -#endif -#ifndef __STDC_CONSTANT_MACROS -#define __STDC_CONSTANT_MACROS -#endif -#if defined(_MSC_VER) && (_MSC_VER < 1800) // Visual Studio 2013 -#include "rapidjson/msinttypes/stdint.h" -#include "rapidjson/msinttypes/inttypes.h" -#else -// Other compilers should have this. -#include -#include -#endif -#endif // RAPIDJSON_NO_INT64DEFINE - -#ifdef _MSC_VER -#ifndef _CRT_SECURE_NO_WARNINGS -#define _CRT_SECURE_NO_WARNINGS 1 -#endif -#endif +#include "datatypes/datatypes.h" #ifdef _OPENMP #include @@ -40,9 +14,6 @@ #include #include - -#include // Required to prevent error when using mingw on windows - #ifdef __cplusplus /* If this is a C++ compiler, use C linkage */ extern "C" { #endif From 1f7e0544667cc7a3c60b513912d038bd197cc64f Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Wed, 20 Sep 2023 16:05:02 -0400 Subject: [PATCH 26/47] Additional fixes to numpy symbol --- yggdrasil/languages/C/YggInterface.c | 2 -- yggdrasil/languages/C/datatypes/datatypes.cpp | 2 ++ yggdrasil/languages/CPP/YggInterface.cpp | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/yggdrasil/languages/C/YggInterface.c b/yggdrasil/languages/C/YggInterface.c index 2d81b3746..4109ee449 100644 --- a/yggdrasil/languages/C/YggInterface.c +++ b/yggdrasil/languages/C/YggInterface.c @@ -1,3 +1 @@ -#define RAPIDJSON_FORCE_IMPORT_ARRAY -#include "rapidjson/pyrj_c.h" #include "YggInterface.h" diff --git a/yggdrasil/languages/C/datatypes/datatypes.cpp b/yggdrasil/languages/C/datatypes/datatypes.cpp index 25d9cb440..434d91999 100644 --- a/yggdrasil/languages/C/datatypes/datatypes.cpp +++ b/yggdrasil/languages/C/datatypes/datatypes.cpp @@ -1,3 +1,5 @@ +#define RAPIDJSON_FORCE_IMPORT_ARRAY +#include "rapidjson/pyrj_c.h" #include "datatypes.h" #include "utils.h" #include "serialization.h" diff --git a/yggdrasil/languages/CPP/YggInterface.cpp b/yggdrasil/languages/CPP/YggInterface.cpp index ba1e337a7..78de68684 100644 --- a/yggdrasil/languages/CPP/YggInterface.cpp +++ b/yggdrasil/languages/CPP/YggInterface.cpp @@ -1,3 +1 @@ -#define RAPIDJSON_FORCE_IMPORT_ARRAY -#include "rapidjson/pyrj_c.h" #include "YggInterface.hpp" From eb7d23cd0a3c232374c2445db55ea13b7d305b9b Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Wed, 20 Sep 2023 18:44:34 -0400 Subject: [PATCH 27/47] Added missing header Attempt setting _USE_MATH_DEFINES on command line --- yggdrasil/drivers/CompiledModelDriver.py | 1 + yggdrasil/languages/C/datatypes/datatypes.h | 42 +++++++++++---------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/yggdrasil/drivers/CompiledModelDriver.py b/yggdrasil/drivers/CompiledModelDriver.py index eae17938c..b3d763dd5 100644 --- a/yggdrasil/drivers/CompiledModelDriver.py +++ b/yggdrasil/drivers/CompiledModelDriver.py @@ -1592,6 +1592,7 @@ def get_flags(cls, dont_link=None, add_linker_switch=False, from yggdrasil import __version__ kwargs.setdefault('definitions', []) kwargs['definitions'].append('WITH_YGGDRASIL') + kwargs['definitions'].append('_USE_MATH_DEFINES') yggver = __version__.split('+')[0].split('v')[-1].split('.') if len(yggver) > 0: kwargs['definitions'] += [f'YGGVER_MAJOR={yggver[0]}'] diff --git a/yggdrasil/languages/C/datatypes/datatypes.h b/yggdrasil/languages/C/datatypes/datatypes.h index 5d6c39345..69c8793c9 100644 --- a/yggdrasil/languages/C/datatypes/datatypes.h +++ b/yggdrasil/languages/C/datatypes/datatypes.h @@ -5,6 +5,7 @@ #ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES #endif +#include #ifndef RAPIDJSON_NO_INT64DEFINE #ifndef __STDC_LIMIT_MACROS @@ -29,30 +30,13 @@ #endif #endif -#include // Required to prevent error when using mingw on windows #include +#include +#include #define RAPIDJSON_YGGDRASIL #define RAPIDJSON_HAS_STDSTRING 1 -#ifdef YGGDRASIL_DISABLE_PYTHON_C_API - -#ifndef PyObject -#define PyObject void* -#endif - -#else // YGGDRASIL_DISABLE_PYTHON_C_API - -#ifdef _DEBUG -#undef _DEBUG -#include -#define _DEBUG -#else -#include -#endif - -#endif // YGGDRASIL_DISABLE_PYTHON_C_API - #ifdef USE_OSR_YGG struct complex_float{ float re; @@ -127,6 +111,26 @@ typedef long double _Complex complex_long_double; extern "C" { #endif +#include // Required to prevent error when using mingw on windows + +#ifdef YGGDRASIL_DISABLE_PYTHON_C_API + +#ifndef PyObject +#define PyObject void* +#endif + +#else // YGGDRASIL_DISABLE_PYTHON_C_API + +#ifdef _DEBUG +#undef _DEBUG +#include +#define _DEBUG +#else +#include +#endif + +#endif // YGGDRASIL_DISABLE_PYTHON_C_API + /*! @brief Wrapper for a complex number with float components. */ typedef struct complex_float_t { float re; //!< Real component From 85bee3fa9ae29e7983f9c9e43bbe139a5013eeb9 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Wed, 20 Sep 2023 20:05:03 -0400 Subject: [PATCH 28/47] Remove cmath include --- yggdrasil/languages/C/datatypes/datatypes.h | 1 - 1 file changed, 1 deletion(-) diff --git a/yggdrasil/languages/C/datatypes/datatypes.h b/yggdrasil/languages/C/datatypes/datatypes.h index 69c8793c9..9d0972bbb 100644 --- a/yggdrasil/languages/C/datatypes/datatypes.h +++ b/yggdrasil/languages/C/datatypes/datatypes.h @@ -5,7 +5,6 @@ #ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES #endif -#include #ifndef RAPIDJSON_NO_INT64DEFINE #ifndef __STDC_LIMIT_MACROS From 0fa00403661da2de20b3769d99d77fd656b4fef6 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Wed, 20 Sep 2023 20:26:31 -0400 Subject: [PATCH 29/47] Revert to old method of calling cmake tests from command promp --- .github/workflows/test-install.yml | 10 +++++----- utils/test-install-base.yml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index bbf514664..7ee2edeec 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -438,7 +438,7 @@ jobs: where.exe python - python -m pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py ' shell: cmd /C CALL {0} @@ -787,7 +787,7 @@ jobs: where.exe python - python -m pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py ' shell: cmd /C CALL {0} @@ -1128,7 +1128,7 @@ jobs: where.exe python - python -m pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py ' shell: cmd /C CALL {0} @@ -1452,7 +1452,7 @@ jobs: where.exe python - python -m pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py ' shell: cmd /C CALL {0} @@ -1775,7 +1775,7 @@ jobs: where.exe python - python -m pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py ' shell: cmd /C CALL {0} diff --git a/utils/test-install-base.yml b/utils/test-install-base.yml index f59f4866b..ac92a50be 100644 --- a/utils/test-install-base.yml +++ b/utils/test-install-base.yml @@ -270,7 +270,7 @@ jobs: run: | cmake -h where.exe python - python -m pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py - name: Run tests (1st) timeout-minutes: 180 From 9bc28d3f7bcbe3164b99936622959c212a270749 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Thu, 21 Sep 2023 10:34:34 -0400 Subject: [PATCH 30/47] Update test & rapidjson to handle header order errors on MSVC with Python.h --- tests/drivers/test_CompiledModelDriver.py | 2 +- yggdrasil/languages/C/datatypes/datatypes.h | 7 +++++-- yggdrasil/rapidjson | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/drivers/test_CompiledModelDriver.py b/tests/drivers/test_CompiledModelDriver.py index 32e85dfda..ac4e9c2f6 100644 --- a/tests/drivers/test_CompiledModelDriver.py +++ b/tests/drivers/test_CompiledModelDriver.py @@ -197,7 +197,7 @@ def test_get_flags(self, python_class): from yggdrasil import __version__ as yggver yggver = yggver.split('+')[0].split('v')[-1].split('.') assert (python_class.get_flags(flags='hello', libtype='object') - == ['hello', '-DWITH_YGGDRASIL', + == ['hello', '-DWITH_YGGDRASIL', '-D_USE_MATH_DEFINES', f'-DYGGVER_MAJOR={yggver[0]}']) def test_get_executable_command(self, python_class): diff --git a/yggdrasil/languages/C/datatypes/datatypes.h b/yggdrasil/languages/C/datatypes/datatypes.h index 9d0972bbb..a06e246a6 100644 --- a/yggdrasil/languages/C/datatypes/datatypes.h +++ b/yggdrasil/languages/C/datatypes/datatypes.h @@ -5,6 +5,11 @@ #ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES #endif +#ifdef __cplusplus +#include +#else // __cplusplus +#include // Required to prevent error when using mingw on windows +#endif // __cplusplus #ifndef RAPIDJSON_NO_INT64DEFINE #ifndef __STDC_LIMIT_MACROS @@ -110,8 +115,6 @@ typedef long double _Complex complex_long_double; extern "C" { #endif -#include // Required to prevent error when using mingw on windows - #ifdef YGGDRASIL_DISABLE_PYTHON_C_API #ifndef PyObject diff --git a/yggdrasil/rapidjson b/yggdrasil/rapidjson index 1b5501349..db1bec6be 160000 --- a/yggdrasil/rapidjson +++ b/yggdrasil/rapidjson @@ -1 +1 @@ -Subproject commit 1b5501349ee6cbbc1b71c10b930c7225ed61eb6f +Subproject commit db1bec6bee173bff419cd5c3f4010ddd244e6f32 From 2b3444e6db94691a23f95d14f5499f07d144cd4a Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Thu, 21 Sep 2023 11:15:14 -0400 Subject: [PATCH 31/47] Updated HISTORY --- HISTORY.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index 13116fa41..b17db8011 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,6 +2,13 @@ History ======= +1.10.2 (2023-09-22) Minor bug fixes and dependency updates +------------------- + +* Updated rapidjson version to include normalization of units in human readable strings +* Fix CI R dependency installation bug by pinning vdiffr to 1.0.5 +* Fix bug in types test that assumed different directory structure + 1.10.1 (2023-06-27) New map transformation, composite function wrapping example, and various refactoring of internal methods ------------------- From e0bb76dedc050082f2a1574db7135f29471fcf7b Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Mon, 25 Sep 2023 13:04:01 -0400 Subject: [PATCH 32/47] Add debug info to determine which version of make is being used to compile OSR on conda/windows --- yggdrasil/drivers/OSRModelDriver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yggdrasil/drivers/OSRModelDriver.py b/yggdrasil/drivers/OSRModelDriver.py index 0270cb1b2..49bc0b15e 100644 --- a/yggdrasil/drivers/OSRModelDriver.py +++ b/yggdrasil/drivers/OSRModelDriver.py @@ -191,7 +191,8 @@ def compile_dependencies(cls, target='OpenSimRootYgg', toolname=None, elif not os.path.isfile(cls.executable_path): return cmd = ['make', target] + flags - logger.debug(f"Calling {cmd} from {cwd}") + logger.info(f"Calling {cmd} from {cwd} with make=" + f"{shutil.which('make')}") subprocess.check_call(cmd, cwd=cwd, env=env) def write_wrappers(self, **kwargs): From c6dace83897e6a81120a4bf530ed081f8f1211c5 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Mon, 25 Sep 2023 14:16:48 -0400 Subject: [PATCH 33/47] Show path in OSR debug message --- yggdrasil/drivers/OSRModelDriver.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/yggdrasil/drivers/OSRModelDriver.py b/yggdrasil/drivers/OSRModelDriver.py index 49bc0b15e..7e7c9ebc4 100644 --- a/yggdrasil/drivers/OSRModelDriver.py +++ b/yggdrasil/drivers/OSRModelDriver.py @@ -191,8 +191,10 @@ def compile_dependencies(cls, target='OpenSimRootYgg', toolname=None, elif not os.path.isfile(cls.executable_path): return cmd = ['make', target] + flags - logger.info(f"Calling {cmd} from {cwd} with make=" - f"{shutil.which('make')}") + logger.info( + f"Calling {cmd} from {cwd} with make=" + f"{shutil.which('make')} and PATH=\n " + + '\n '.join(os.environ['PATH'].split(os.pathsep))) subprocess.check_call(cmd, cwd=cwd, env=env) def write_wrappers(self, **kwargs): From e99a69252406444f164fa32d4738c93685f43a3c Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Mon, 25 Sep 2023 14:21:34 -0400 Subject: [PATCH 34/47] Add mingw make to windows conda requriements --- recipe/meta.yaml | 1 + utils/requirements/requirements.json | 13 +++++++++++-- utils/requirements/requirements.yaml | 8 ++++++-- utils/requirements/requirements_condaonly.txt | 1 + 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index d41f2b1c3..e9af8b77b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -96,6 +96,7 @@ outputs: - {{ pin_subpackage('yggdrasil.zmq', exact=True) }} # [win] - cmake # [not win] - compiler-rt # [osx] + - m2w64-make # [win] - make # [not win] - {{ compiler('c') }} - {{ compiler('cxx') }} diff --git a/utils/requirements/requirements.json b/utils/requirements/requirements.json index 353063df6..ad87f647b 100644 --- a/utils/requirements/requirements.json +++ b/utils/requirements/requirements.json @@ -122,8 +122,17 @@ }, { "make": { - "method": "conda", - "os": "unix" + "options": [ + { + "method": "conda", + "os": "unix" + }, + { + "name": "m2w64-make", + "method": "conda", + "os": "win" + } + ] } }, { diff --git a/utils/requirements/requirements.yaml b/utils/requirements/requirements.yaml index 6b6d9f263..9769242f3 100644 --- a/utils/requirements/requirements.yaml +++ b/utils/requirements/requirements.yaml @@ -72,8 +72,12 @@ extras: method: conda os: unix - make: - method: conda - os: unix + options: + - method: conda + os: unix + - name: m2w64-make + method: conda + os: win - "{{ compiler('c') }}": method: conda_recipe - "{{ compiler('cxx') }}": diff --git a/utils/requirements/requirements_condaonly.txt b/utils/requirements/requirements_condaonly.txt index 1fd666069..f04e4a59e 100644 --- a/utils/requirements/requirements_condaonly.txt +++ b/utils/requirements/requirements_condaonly.txt @@ -7,6 +7,7 @@ git # [conda] juliaup # [conda,julia] lz4 # [conda,zmq] m2w64-gcc-fortran; platform_system == 'Windows' # [conda,fortran] +m2w64-make; platform_system == 'Windows' # [conda,c] m2w64-toolchain_win-64; platform_system == 'Windows' # [conda,fortran] make; platform_system != 'Windows' # [conda,c] matplotlib-base # [conda] From a1d6da4cd0c10c4827fdce212250caace3494288 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Mon, 25 Sep 2023 17:55:56 -0400 Subject: [PATCH 35/47] Try using mingw32-make explicitly on windows --- yggdrasil/drivers/OSRModelDriver.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/yggdrasil/drivers/OSRModelDriver.py b/yggdrasil/drivers/OSRModelDriver.py index 7e7c9ebc4..b7690e14e 100644 --- a/yggdrasil/drivers/OSRModelDriver.py +++ b/yggdrasil/drivers/OSRModelDriver.py @@ -105,6 +105,14 @@ def parse_arguments(self, *args, **kwargs): self.compile_dependencies(**compile_kwargs) assert os.path.isfile(self.executable_path) + @classmethod + def make_name(cls): + r"""str: Name of make executable to use""" + make_base = 'make' + if platform._is_win: # pragma: windows + make_base = 'mingw32-make' + return shutil.which(make_base) + @classmethod def is_library_installed(cls, lib, **kwargs): r"""Determine if a dependency is installed. @@ -120,7 +128,7 @@ def is_library_installed(cls, lib, **kwargs): # Need to treat gnu make as dependency since OSR Makefile is not # compatible with nmake if lib == 'make': - return bool(shutil.which('make')) + return bool(cls.make_name()) return super(OSRModelDriver, cls).is_library_installed( lib, **kwargs) # pragma: debug @@ -190,10 +198,9 @@ def compile_dependencies(cls, target='OpenSimRootYgg', toolname=None, **kwargs) elif not os.path.isfile(cls.executable_path): return - cmd = ['make', target] + flags + cmd = [cls.make_name(), target] + flags logger.info( - f"Calling {cmd} from {cwd} with make=" - f"{shutil.which('make')} and PATH=\n " + f"Calling {cmd} from {cwd} with PATH=\n " + '\n '.join(os.environ['PATH'].split(os.pathsep))) subprocess.check_call(cmd, cwd=cwd, env=env) From aa751361b140fb77e114d1e8dfffbde51703f7b8 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Tue, 26 Sep 2023 11:30:04 -0400 Subject: [PATCH 36/47] Remove make from conda requirements on windows --- .github/workflows/test-install.yml | 20 +++++++++---------- recipe/meta.yaml | 1 - utils/requirements/requirements.json | 13 ++---------- utils/requirements/requirements.yaml | 12 +++++------ utils/requirements/requirements_condaonly.txt | 1 - utils/test-install-base.yml | 2 +- 6 files changed, 19 insertions(+), 30 deletions(-) diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index 7ee2edeec..c8974d2bf 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -273,8 +273,8 @@ jobs: ' shell: bash -l {0} - - if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC - == 1 + - if: runner.os == 'Windows' && env.INSTALLC == 1 && matrix.install-method == + 'pip' name: (WINDOWS,PIP) Set up MSVC Compiler uses: ilammy/msvc-dev-cmd@v1 with: @@ -622,8 +622,8 @@ jobs: ' shell: bash -l {0} - - if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC - == 1 + - if: runner.os == 'Windows' && env.INSTALLC == 1 && matrix.install-method == + 'pip' name: (WINDOWS,PIP) Set up MSVC Compiler uses: ilammy/msvc-dev-cmd@v1 with: @@ -963,8 +963,8 @@ jobs: ' shell: bash -l {0} - - if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC - == 1 + - if: runner.os == 'Windows' && env.INSTALLC == 1 && matrix.install-method == + 'pip' name: (WINDOWS,PIP) Set up MSVC Compiler uses: ilammy/msvc-dev-cmd@v1 with: @@ -1287,8 +1287,8 @@ jobs: ' shell: bash -l {0} - - if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC - == 1 + - if: runner.os == 'Windows' && env.INSTALLC == 1 && matrix.install-method == + 'pip' name: (WINDOWS,PIP) Set up MSVC Compiler uses: ilammy/msvc-dev-cmd@v1 with: @@ -1610,8 +1610,8 @@ jobs: ' shell: bash -l {0} - - if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC - == 1 + - if: runner.os == 'Windows' && env.INSTALLC == 1 && matrix.install-method == + 'pip' name: (WINDOWS,PIP) Set up MSVC Compiler uses: ilammy/msvc-dev-cmd@v1 with: diff --git a/recipe/meta.yaml b/recipe/meta.yaml index e9af8b77b..d41f2b1c3 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -96,7 +96,6 @@ outputs: - {{ pin_subpackage('yggdrasil.zmq', exact=True) }} # [win] - cmake # [not win] - compiler-rt # [osx] - - m2w64-make # [win] - make # [not win] - {{ compiler('c') }} - {{ compiler('cxx') }} diff --git a/utils/requirements/requirements.json b/utils/requirements/requirements.json index ad87f647b..353063df6 100644 --- a/utils/requirements/requirements.json +++ b/utils/requirements/requirements.json @@ -122,17 +122,8 @@ }, { "make": { - "options": [ - { - "method": "conda", - "os": "unix" - }, - { - "name": "m2w64-make", - "method": "conda", - "os": "win" - } - ] + "method": "conda", + "os": "unix" } }, { diff --git a/utils/requirements/requirements.yaml b/utils/requirements/requirements.yaml index 9769242f3..bb1fd1c5d 100644 --- a/utils/requirements/requirements.yaml +++ b/utils/requirements/requirements.yaml @@ -72,12 +72,12 @@ extras: method: conda os: unix - make: - options: - - method: conda - os: unix - - name: m2w64-make - method: conda - os: win + # options: + method: conda + os: unix + # - name: m2w64-make + # method: conda + # os: win - "{{ compiler('c') }}": method: conda_recipe - "{{ compiler('cxx') }}": diff --git a/utils/requirements/requirements_condaonly.txt b/utils/requirements/requirements_condaonly.txt index f04e4a59e..1fd666069 100644 --- a/utils/requirements/requirements_condaonly.txt +++ b/utils/requirements/requirements_condaonly.txt @@ -7,7 +7,6 @@ git # [conda] juliaup # [conda,julia] lz4 # [conda,zmq] m2w64-gcc-fortran; platform_system == 'Windows' # [conda,fortran] -m2w64-make; platform_system == 'Windows' # [conda,c] m2w64-toolchain_win-64; platform_system == 'Windows' # [conda,fortran] make; platform_system != 'Windows' # [conda,c] matplotlib-base # [conda] diff --git a/utils/test-install-base.yml b/utils/test-install-base.yml index ac92a50be..720307b04 100644 --- a/utils/test-install-base.yml +++ b/utils/test-install-base.yml @@ -105,7 +105,7 @@ jobs: # ======================================================== - name: (WINDOWS,PIP) Set up MSVC Compiler uses: ilammy/msvc-dev-cmd@v1 - if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC == 1 + if: runner.os == 'Windows' && env.INSTALLC == 1 && matrix.install-method == 'pip' with: toolset: 14.0 - name: (WINDOWS,PIP) Set up MSMPI From 1955cc348eef90828068524d8ac3a6f7525667f3 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Wed, 27 Sep 2023 14:03:15 -0400 Subject: [PATCH 37/47] Test git commands prior to yggcompile --- .github/workflows/test-install.yml | 40 ++++++++++++++++++++++++++---- utils/test-install-base.yml | 5 +++- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index c8974d2bf..ed486d627 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -431,7 +431,13 @@ jobs: - name: Verify installation run: python utils/setup_test_env.py verify - name: Compile libraries - run: yggcompile + run: 'git rev-parse --short=10 HEAD + + git diff-index --quiet HEAD || echo "plus uncommitted changes" + + yggcompile + + ' - if: runner.os == 'Windows' name: Run cmake test in command prompt run: 'cmake -h @@ -780,7 +786,13 @@ jobs: - name: Verify installation run: python utils/setup_test_env.py verify - name: Compile libraries - run: yggcompile + run: 'git rev-parse --short=10 HEAD + + git diff-index --quiet HEAD || echo "plus uncommitted changes" + + yggcompile + + ' - if: runner.os == 'Windows' name: Run cmake test in command prompt run: 'cmake -h @@ -1121,7 +1133,13 @@ jobs: - name: Verify installation run: python utils/setup_test_env.py verify - name: Compile libraries - run: yggcompile + run: 'git rev-parse --short=10 HEAD + + git diff-index --quiet HEAD || echo "plus uncommitted changes" + + yggcompile + + ' - if: runner.os == 'Windows' name: Run cmake test in command prompt run: 'cmake -h @@ -1445,7 +1463,13 @@ jobs: - name: Verify installation run: python utils/setup_test_env.py verify - name: Compile libraries - run: yggcompile + run: 'git rev-parse --short=10 HEAD + + git diff-index --quiet HEAD || echo "plus uncommitted changes" + + yggcompile + + ' - if: runner.os == 'Windows' name: Run cmake test in command prompt run: 'cmake -h @@ -1768,7 +1792,13 @@ jobs: - name: Verify installation run: python utils/setup_test_env.py verify - name: Compile libraries - run: yggcompile + run: 'git rev-parse --short=10 HEAD + + git diff-index --quiet HEAD || echo "plus uncommitted changes" + + yggcompile + + ' - if: runner.os == 'Windows' name: Run cmake test in command prompt run: 'cmake -h diff --git a/utils/test-install-base.yml b/utils/test-install-base.yml index 720307b04..a1dd53f2e 100644 --- a/utils/test-install-base.yml +++ b/utils/test-install-base.yml @@ -262,7 +262,10 @@ jobs: - name: Verify installation run: python utils/setup_test_env.py verify - name: Compile libraries - run: yggcompile + run: | + git rev-parse --short=10 HEAD + git diff-index --quiet HEAD || echo "plus uncommitted changes" + yggcompile - name: Run cmake test in command prompt timeout-minutes: 180 if: runner.os == 'Windows' From ff303873bfe204239a9be773a783e76b58dcb48b Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Wed, 27 Sep 2023 15:27:25 -0400 Subject: [PATCH 38/47] Remove YggLibrary --- yggdrasil/languages/C/YggInterface.h | 3 --- yggdrasil/languages/C/YggLibrary.h | 7 ------- yggdrasil/languages/CPP/YggLibrary.hpp | 7 ------- 3 files changed, 17 deletions(-) delete mode 100755 yggdrasil/languages/C/YggLibrary.h delete mode 100755 yggdrasil/languages/CPP/YggLibrary.hpp diff --git a/yggdrasil/languages/C/YggInterface.h b/yggdrasil/languages/C/YggInterface.h index 89d52954b..8d26a67d2 100755 --- a/yggdrasil/languages/C/YggInterface.h +++ b/yggdrasil/languages/C/YggInterface.h @@ -2,9 +2,6 @@ #ifndef YGGINTERFACE_H_ #define YGGINTERFACE_H_ -/* #ifndef YGGINTERFACE_OUTSIDE_MAIN */ -/* #define RAPIDJSON_FORCE_IMPORT_ARRAY */ -/* #endif // YGGINTERFACE_OUTSIDE_MAIN */ #include "../tools.h" #include "../datatypes/datatypes.h" #include "../communication/communication.h" diff --git a/yggdrasil/languages/C/YggLibrary.h b/yggdrasil/languages/C/YggLibrary.h deleted file mode 100755 index 4b40f48e4..000000000 --- a/yggdrasil/languages/C/YggLibrary.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef YGGLIBRARY_H_ -#define YGGLIBRARY_H_ - -#define YGGINTERFACE_OUTSIDE_MAIN -#include "YggInterface.h" - -#endif // YGGLIBRARY_H_ diff --git a/yggdrasil/languages/CPP/YggLibrary.hpp b/yggdrasil/languages/CPP/YggLibrary.hpp deleted file mode 100755 index f10c2b0be..000000000 --- a/yggdrasil/languages/CPP/YggLibrary.hpp +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef YGGLIBRARY_HPP_ -#define YGGLIBRARY_HPP_ - -#define YGGINTERFACE_OUTSIDE_MAIN -#include "YggInterface.hpp" - -#endif // YGGLIBRARY_HPP_ From 89e7258b6ab824e5db2f561b6d8a8d3df17e7fe9 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Wed, 27 Sep 2023 18:05:49 -0400 Subject: [PATCH 39/47] Don't install r-devtools for windows using conda (this causes errors in the OSR compilation likely due to a conflicting git installation) Display PATH variable in windows command prompt --- .github/workflows/test-install.yml | 20 +++++++++++++++----- utils/requirements/requirements.yaml | 7 +++---- utils/test-install-base.yml | 1 + 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index ed486d627..f3d5bd2a7 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -440,7 +440,9 @@ jobs: ' - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: 'cmake -h + run: 'echo %PATH% + + cmake -h where.exe python @@ -795,7 +797,9 @@ jobs: ' - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: 'cmake -h + run: 'echo %PATH% + + cmake -h where.exe python @@ -1142,7 +1146,9 @@ jobs: ' - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: 'cmake -h + run: 'echo %PATH% + + cmake -h where.exe python @@ -1472,7 +1478,9 @@ jobs: ' - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: 'cmake -h + run: 'echo %PATH% + + cmake -h where.exe python @@ -1801,7 +1809,9 @@ jobs: ' - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: 'cmake -h + run: 'echo %PATH% + + cmake -h where.exe python diff --git a/utils/requirements/requirements.yaml b/utils/requirements/requirements.yaml index bb1fd1c5d..5e1d9e1fd 100644 --- a/utils/requirements/requirements.yaml +++ b/utils/requirements/requirements.yaml @@ -72,12 +72,8 @@ extras: method: conda os: unix - make: - # options: method: conda os: unix - # - name: m2w64-make - # method: conda - # os: win - "{{ compiler('c') }}": method: conda_recipe - "{{ compiler('cxx') }}": @@ -141,7 +137,10 @@ extras: options: - method: conda host: True + os: unix - method: cran + - method: skip + os: win - harfbuzz: options: - name: libharfbuzz-dev diff --git a/utils/test-install-base.yml b/utils/test-install-base.yml index a1dd53f2e..c548b8e02 100644 --- a/utils/test-install-base.yml +++ b/utils/test-install-base.yml @@ -271,6 +271,7 @@ jobs: if: runner.os == 'Windows' shell: cmd /C CALL {0} run: | + echo %PATH% cmake -h where.exe python pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py From 1ab588bf04e08849b0b6d962ccd763b38078f78a Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Thu, 28 Sep 2023 11:55:59 -0400 Subject: [PATCH 40/47] Re-generate requirements files Clean up GHA workflow file --- .github/workflows/test-install.yml | 60 +++++-------------- recipe/meta.yaml | 4 +- utils/requirements/requirements.json | 7 ++- utils/requirements/requirements_condaonly.txt | 2 +- utils/test-install-base.yml | 7 +-- 5 files changed, 26 insertions(+), 54 deletions(-) diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index f3d5bd2a7..bd5b5097a 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -273,8 +273,8 @@ jobs: ' shell: bash -l {0} - - if: runner.os == 'Windows' && env.INSTALLC == 1 && matrix.install-method == - 'pip' + - if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC + == 1 name: (WINDOWS,PIP) Set up MSVC Compiler uses: ilammy/msvc-dev-cmd@v1 with: @@ -431,13 +431,7 @@ jobs: - name: Verify installation run: python utils/setup_test_env.py verify - name: Compile libraries - run: 'git rev-parse --short=10 HEAD - - git diff-index --quiet HEAD || echo "plus uncommitted changes" - - yggcompile - - ' + run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt run: 'echo %PATH% @@ -630,8 +624,8 @@ jobs: ' shell: bash -l {0} - - if: runner.os == 'Windows' && env.INSTALLC == 1 && matrix.install-method == - 'pip' + - if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC + == 1 name: (WINDOWS,PIP) Set up MSVC Compiler uses: ilammy/msvc-dev-cmd@v1 with: @@ -788,13 +782,7 @@ jobs: - name: Verify installation run: python utils/setup_test_env.py verify - name: Compile libraries - run: 'git rev-parse --short=10 HEAD - - git diff-index --quiet HEAD || echo "plus uncommitted changes" - - yggcompile - - ' + run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt run: 'echo %PATH% @@ -979,8 +967,8 @@ jobs: ' shell: bash -l {0} - - if: runner.os == 'Windows' && env.INSTALLC == 1 && matrix.install-method == - 'pip' + - if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC + == 1 name: (WINDOWS,PIP) Set up MSVC Compiler uses: ilammy/msvc-dev-cmd@v1 with: @@ -1137,13 +1125,7 @@ jobs: - name: Verify installation run: python utils/setup_test_env.py verify - name: Compile libraries - run: 'git rev-parse --short=10 HEAD - - git diff-index --quiet HEAD || echo "plus uncommitted changes" - - yggcompile - - ' + run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt run: 'echo %PATH% @@ -1311,8 +1293,8 @@ jobs: ' shell: bash -l {0} - - if: runner.os == 'Windows' && env.INSTALLC == 1 && matrix.install-method == - 'pip' + - if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC + == 1 name: (WINDOWS,PIP) Set up MSVC Compiler uses: ilammy/msvc-dev-cmd@v1 with: @@ -1469,13 +1451,7 @@ jobs: - name: Verify installation run: python utils/setup_test_env.py verify - name: Compile libraries - run: 'git rev-parse --short=10 HEAD - - git diff-index --quiet HEAD || echo "plus uncommitted changes" - - yggcompile - - ' + run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt run: 'echo %PATH% @@ -1642,8 +1618,8 @@ jobs: ' shell: bash -l {0} - - if: runner.os == 'Windows' && env.INSTALLC == 1 && matrix.install-method == - 'pip' + - if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC + == 1 name: (WINDOWS,PIP) Set up MSVC Compiler uses: ilammy/msvc-dev-cmd@v1 with: @@ -1800,13 +1776,7 @@ jobs: - name: Verify installation run: python utils/setup_test_env.py verify - name: Compile libraries - run: 'git rev-parse --short=10 HEAD - - git diff-index --quiet HEAD || echo "plus uncommitted changes" - - yggcompile - - ' + run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt run: 'echo %PATH% diff --git a/recipe/meta.yaml b/recipe/meta.yaml index d41f2b1c3..6ace0673d 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -122,7 +122,7 @@ outputs: - python - r-base - r-bit64 - - r-devtools + - r-devtools # [not win] - r-r6 - r-reticulate - r-units @@ -131,7 +131,7 @@ outputs: - {{ pin_subpackage('yggdrasil', exact=True) }} - r-base - r-bit64 - - r-devtools + - r-devtools # [not win] - r-r6 - r-reticulate - r-units diff --git a/utils/requirements/requirements.json b/utils/requirements/requirements.json index 353063df6..e1d14cb81 100644 --- a/utils/requirements/requirements.json +++ b/utils/requirements/requirements.json @@ -223,10 +223,15 @@ "options": [ { "method": "conda", - "host": true + "host": true, + "os": "unix" }, { "method": "cran" + }, + { + "method": "skip", + "os": "win" } ] } diff --git a/utils/requirements/requirements_condaonly.txt b/utils/requirements/requirements_condaonly.txt index 1fd666069..8084fb3fb 100644 --- a/utils/requirements/requirements_condaonly.txt +++ b/utils/requirements/requirements_condaonly.txt @@ -15,7 +15,7 @@ msmpi; platform_system == 'Windows' # [conda,mpi] openmpi; platform_system == 'Darwin' # [conda,mpi] r-base # [conda,r] r-bit64 # [conda,r] -r-devtools # [conda,r] +r-devtools; platform_system != 'Windows' # [conda,r] r-r6 # [conda,r] r-reticulate # [conda,r] r-units # [conda,r] diff --git a/utils/test-install-base.yml b/utils/test-install-base.yml index c548b8e02..64e50e2e8 100644 --- a/utils/test-install-base.yml +++ b/utils/test-install-base.yml @@ -105,7 +105,7 @@ jobs: # ======================================================== - name: (WINDOWS,PIP) Set up MSVC Compiler uses: ilammy/msvc-dev-cmd@v1 - if: runner.os == 'Windows' && env.INSTALLC == 1 && matrix.install-method == 'pip' + if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC == 1 with: toolset: 14.0 - name: (WINDOWS,PIP) Set up MSMPI @@ -262,10 +262,7 @@ jobs: - name: Verify installation run: python utils/setup_test_env.py verify - name: Compile libraries - run: | - git rev-parse --short=10 HEAD - git diff-index --quiet HEAD || echo "plus uncommitted changes" - yggcompile + run: yggcompile - name: Run cmake test in command prompt timeout-minutes: 180 if: runner.os == 'Windows' From 2905c31a8baf26847e59d8ef318921cc2ef7bcc0 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Mon, 9 Oct 2023 12:57:56 -0500 Subject: [PATCH 41/47] Try activating conda env explicitly for cmake test --- .github/workflows/test-install.yml | 20 ++++++++++++++++++++ utils/test-install-base.yml | 2 ++ 2 files changed, 22 insertions(+) diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index bd5b5097a..ba31b3d40 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -438,6 +438,10 @@ jobs: cmake -h + conda info + + conda activate test + where.exe python pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py @@ -789,6 +793,10 @@ jobs: cmake -h + conda info + + conda activate test + where.exe python pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py @@ -1132,6 +1140,10 @@ jobs: cmake -h + conda info + + conda activate test + where.exe python pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py @@ -1458,6 +1470,10 @@ jobs: cmake -h + conda info + + conda activate test + where.exe python pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py @@ -1783,6 +1799,10 @@ jobs: cmake -h + conda info + + conda activate test + where.exe python pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py diff --git a/utils/test-install-base.yml b/utils/test-install-base.yml index 64e50e2e8..b5de5eeef 100644 --- a/utils/test-install-base.yml +++ b/utils/test-install-base.yml @@ -270,6 +270,8 @@ jobs: run: | echo %PATH% cmake -h + conda info + conda activate test where.exe python pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py From d7ba45139e9a8760e9b94d0e75077881c9867dcc Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Mon, 9 Oct 2023 15:47:32 -0500 Subject: [PATCH 42/47] Refactor cmake test commands --- .github/workflows/test-install.yml | 50 +++++++++++++++--------------- utils/test-install-base.yml | 8 ++--- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index ba31b3d40..a59280a0c 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -434,15 +434,15 @@ jobs: run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: 'echo %PATH% + run: '# echo %PATH% - cmake -h - - conda info + # cmake -h conda activate test - where.exe python + conda info + + # where.exe python pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py @@ -789,15 +789,15 @@ jobs: run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: 'echo %PATH% - - cmake -h + run: '# echo %PATH% - conda info + # cmake -h conda activate test - where.exe python + conda info + + # where.exe python pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py @@ -1136,15 +1136,15 @@ jobs: run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: 'echo %PATH% + run: '# echo %PATH% - cmake -h - - conda info + # cmake -h conda activate test - where.exe python + conda info + + # where.exe python pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py @@ -1466,15 +1466,15 @@ jobs: run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: 'echo %PATH% + run: '# echo %PATH% - cmake -h - - conda info + # cmake -h conda activate test - where.exe python + conda info + + # where.exe python pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py @@ -1795,15 +1795,15 @@ jobs: run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: 'echo %PATH% - - cmake -h + run: '# echo %PATH% - conda info + # cmake -h conda activate test - where.exe python + conda info + + # where.exe python pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py diff --git a/utils/test-install-base.yml b/utils/test-install-base.yml index b5de5eeef..b694dba03 100644 --- a/utils/test-install-base.yml +++ b/utils/test-install-base.yml @@ -268,11 +268,11 @@ jobs: if: runner.os == 'Windows' shell: cmd /C CALL {0} run: | - echo %PATH% - cmake -h - conda info + # echo %PATH% + # cmake -h conda activate test - where.exe python + conda info + # where.exe python pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py - name: Run tests (1st) From 06e1c7ae5c1d0b6e2e09d96d4607fe69554b3a77 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Mon, 9 Oct 2023 18:31:53 -0400 Subject: [PATCH 43/47] Refactor cmake on command prompt --- .github/workflows/test-install.yml | 75 ++++-------------------------- utils/test-install-base.yml | 15 +++--- 2 files changed, 17 insertions(+), 73 deletions(-) diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index a59280a0c..69cc12a52 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -434,19 +434,8 @@ jobs: run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: '# echo %PATH% - - # cmake -h - - conda activate test - - conda info - - # where.exe python - - pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py - - ' + run: conda activate test && pytest --import-mode=importlib --ci --cov-append + --nocapture tests/drivers/test_CMakeModelDriver.py shell: cmd /C CALL {0} timeout-minutes: 180 - continue-on-error: true @@ -789,19 +778,8 @@ jobs: run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: '# echo %PATH% - - # cmake -h - - conda activate test - - conda info - - # where.exe python - - pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py - - ' + run: conda activate test && pytest --import-mode=importlib --ci --cov-append + --nocapture tests/drivers/test_CMakeModelDriver.py shell: cmd /C CALL {0} timeout-minutes: 180 - continue-on-error: true @@ -1136,19 +1114,8 @@ jobs: run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: '# echo %PATH% - - # cmake -h - - conda activate test - - conda info - - # where.exe python - - pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py - - ' + run: conda activate test && pytest --import-mode=importlib --ci --cov-append + --nocapture tests/drivers/test_CMakeModelDriver.py shell: cmd /C CALL {0} timeout-minutes: 180 - continue-on-error: true @@ -1466,19 +1433,8 @@ jobs: run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: '# echo %PATH% - - # cmake -h - - conda activate test - - conda info - - # where.exe python - - pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py - - ' + run: conda activate test && pytest --import-mode=importlib --ci --cov-append + --nocapture tests/drivers/test_CMakeModelDriver.py shell: cmd /C CALL {0} timeout-minutes: 180 - continue-on-error: true @@ -1795,19 +1751,8 @@ jobs: run: yggcompile - if: runner.os == 'Windows' name: Run cmake test in command prompt - run: '# echo %PATH% - - # cmake -h - - conda activate test - - conda info - - # where.exe python - - pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py - - ' + run: conda activate test && pytest --import-mode=importlib --ci --cov-append + --nocapture tests/drivers/test_CMakeModelDriver.py shell: cmd /C CALL {0} timeout-minutes: 180 - continue-on-error: true diff --git a/utils/test-install-base.yml b/utils/test-install-base.yml index b694dba03..b5b31aaed 100644 --- a/utils/test-install-base.yml +++ b/utils/test-install-base.yml @@ -267,14 +267,13 @@ jobs: timeout-minutes: 180 if: runner.os == 'Windows' shell: cmd /C CALL {0} - run: | - # echo %PATH% - # cmake -h - conda activate test - conda info - # where.exe python - pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py - + run: >- + conda activate test && pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + # echo %PATH% + # cmake -h + # conda activate test + # conda info + # where.exe python - name: Run tests (1st) timeout-minutes: 180 id: test1 From ae6b4953cd27640509343f7b333a68355e71d9f6 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Mon, 9 Oct 2023 20:40:42 -0400 Subject: [PATCH 44/47] Only call conda activate for conda/mamba environments --- .github/workflows/test-install.yml | 55 ++++++++++++++++++++++++------ utils/test-install-base.yml | 15 ++++---- 2 files changed, 53 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index 69cc12a52..683950200 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -432,12 +432,19 @@ jobs: run: python utils/setup_test_env.py verify - name: Compile libraries run: yggcompile - - if: runner.os == 'Windows' - name: Run cmake test in command prompt + - if: runner.os == 'Windows' && (matrix.install-method == 'conda' || matrix.install-method + == 'mamba') + name: Run cmake test in command prompt (CONDA) run: conda activate test && pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py shell: cmd /C CALL {0} timeout-minutes: 180 + - if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method + != 'mamba') + name: Run cmake test in command prompt (PIP) + run: pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + shell: cmd /C CALL {0} + timeout-minutes: 180 - continue-on-error: true id: test1 name: Run tests (1st) @@ -776,12 +783,19 @@ jobs: run: python utils/setup_test_env.py verify - name: Compile libraries run: yggcompile - - if: runner.os == 'Windows' - name: Run cmake test in command prompt + - if: runner.os == 'Windows' && (matrix.install-method == 'conda' || matrix.install-method + == 'mamba') + name: Run cmake test in command prompt (CONDA) run: conda activate test && pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py shell: cmd /C CALL {0} timeout-minutes: 180 + - if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method + != 'mamba') + name: Run cmake test in command prompt (PIP) + run: pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + shell: cmd /C CALL {0} + timeout-minutes: 180 - continue-on-error: true id: test1 name: Run tests (1st) @@ -1112,12 +1126,19 @@ jobs: run: python utils/setup_test_env.py verify - name: Compile libraries run: yggcompile - - if: runner.os == 'Windows' - name: Run cmake test in command prompt + - if: runner.os == 'Windows' && (matrix.install-method == 'conda' || matrix.install-method + == 'mamba') + name: Run cmake test in command prompt (CONDA) run: conda activate test && pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py shell: cmd /C CALL {0} timeout-minutes: 180 + - if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method + != 'mamba') + name: Run cmake test in command prompt (PIP) + run: pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + shell: cmd /C CALL {0} + timeout-minutes: 180 - continue-on-error: true id: test1 name: Run tests (1st) @@ -1431,12 +1452,19 @@ jobs: run: python utils/setup_test_env.py verify - name: Compile libraries run: yggcompile - - if: runner.os == 'Windows' - name: Run cmake test in command prompt + - if: runner.os == 'Windows' && (matrix.install-method == 'conda' || matrix.install-method + == 'mamba') + name: Run cmake test in command prompt (CONDA) run: conda activate test && pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py shell: cmd /C CALL {0} timeout-minutes: 180 + - if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method + != 'mamba') + name: Run cmake test in command prompt (PIP) + run: pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + shell: cmd /C CALL {0} + timeout-minutes: 180 - continue-on-error: true id: test1 name: Run tests (1st) @@ -1749,12 +1777,19 @@ jobs: run: python utils/setup_test_env.py verify - name: Compile libraries run: yggcompile - - if: runner.os == 'Windows' - name: Run cmake test in command prompt + - if: runner.os == 'Windows' && (matrix.install-method == 'conda' || matrix.install-method + == 'mamba') + name: Run cmake test in command prompt (CONDA) run: conda activate test && pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py shell: cmd /C CALL {0} timeout-minutes: 180 + - if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method + != 'mamba') + name: Run cmake test in command prompt (PIP) + run: pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py + shell: cmd /C CALL {0} + timeout-minutes: 180 - continue-on-error: true id: test1 name: Run tests (1st) diff --git a/utils/test-install-base.yml b/utils/test-install-base.yml index b5b31aaed..c9e621704 100644 --- a/utils/test-install-base.yml +++ b/utils/test-install-base.yml @@ -263,17 +263,18 @@ jobs: run: python utils/setup_test_env.py verify - name: Compile libraries run: yggcompile - - name: Run cmake test in command prompt + - name: Run cmake test in command prompt (CONDA) timeout-minutes: 180 - if: runner.os == 'Windows' + if: runner.os == 'Windows' && (matrix.install-method == 'conda' || matrix.install-method == 'mamba') shell: cmd /C CALL {0} run: >- conda activate test && pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py - # echo %PATH% - # cmake -h - # conda activate test - # conda info - # where.exe python + - name: Run cmake test in command prompt (PIP) + timeout-minutes: 180 + if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method != 'mamba') + shell: cmd /C CALL {0} + run: >- + pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py - name: Run tests (1st) timeout-minutes: 180 id: test1 From 4daf6f266e651f5a1284c40ec6d07601507b9219 Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Tue, 10 Oct 2023 12:07:39 -0400 Subject: [PATCH 45/47] Fix workflow syntax --- .github/workflows/test-install.yml | 10 +++++----- utils/test-install-base.yml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index 683950200..9cfa56c74 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -440,7 +440,7 @@ jobs: shell: cmd /C CALL {0} timeout-minutes: 180 - if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method - != 'mamba') + != 'mamba' name: Run cmake test in command prompt (PIP) run: pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py shell: cmd /C CALL {0} @@ -791,7 +791,7 @@ jobs: shell: cmd /C CALL {0} timeout-minutes: 180 - if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method - != 'mamba') + != 'mamba' name: Run cmake test in command prompt (PIP) run: pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py shell: cmd /C CALL {0} @@ -1134,7 +1134,7 @@ jobs: shell: cmd /C CALL {0} timeout-minutes: 180 - if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method - != 'mamba') + != 'mamba' name: Run cmake test in command prompt (PIP) run: pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py shell: cmd /C CALL {0} @@ -1460,7 +1460,7 @@ jobs: shell: cmd /C CALL {0} timeout-minutes: 180 - if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method - != 'mamba') + != 'mamba' name: Run cmake test in command prompt (PIP) run: pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py shell: cmd /C CALL {0} @@ -1785,7 +1785,7 @@ jobs: shell: cmd /C CALL {0} timeout-minutes: 180 - if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method - != 'mamba') + != 'mamba' name: Run cmake test in command prompt (PIP) run: pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py shell: cmd /C CALL {0} diff --git a/utils/test-install-base.yml b/utils/test-install-base.yml index c9e621704..7007bf04e 100644 --- a/utils/test-install-base.yml +++ b/utils/test-install-base.yml @@ -271,7 +271,7 @@ jobs: conda activate test && pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py - name: Run cmake test in command prompt (PIP) timeout-minutes: 180 - if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method != 'mamba') + if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method != 'mamba' shell: cmd /C CALL {0} run: >- pytest --import-mode=importlib --ci --cov-append --nocapture tests/drivers/test_CMakeModelDriver.py From 38a6602221f8cea6231fdb8c2adb8806a642a69b Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Wed, 11 Oct 2023 12:42:38 -0400 Subject: [PATCH 46/47] Don't cover line only called during configuration on unix machine without a shared version of the Python library --- yggdrasil/drivers/CModelDriver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yggdrasil/drivers/CModelDriver.py b/yggdrasil/drivers/CModelDriver.py index 38a5aaeca..37946cc98 100755 --- a/yggdrasil/drivers/CModelDriver.py +++ b/yggdrasil/drivers/CModelDriver.py @@ -559,7 +559,7 @@ class MSVCArchiver(ArchiverBase): for _python_libtype in libtype_order: if (_python_lib is not None) and os.path.isfile(_python_lib): break - _python_lib = tools.get_python_c_library( + _python_lib = tools.get_python_c_library( # pragma: no cover allow_failure=True, libtype=_python_libtype) except BaseException as e: # pragma: debug warnings.warn("ERROR LOCATING PYTHON LIBRARY: %s" % e) From e4a55400b1bf2237dc23051407858d810cf9a3fd Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Wed, 11 Oct 2023 12:44:24 -0400 Subject: [PATCH 47/47] Update history and version in conda recipe --- HISTORY.rst | 2 +- recipe/meta.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index b17db8011..1ae31d626 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,7 +2,7 @@ History ======= -1.10.2 (2023-09-22) Minor bug fixes and dependency updates +1.10.2 (2023-10-12) Minor bug fixes and dependency updates ------------------- * Updated rapidjson version to include normalization of units in human readable strings diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 6ace0673d..f9aba5b09 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,5 +1,5 @@ {% set name = "yggdrasil" %} -{% set version = "1.10.1" %} +{% set version = "1.10.2" %} {% set PY_VER_MAJOR = PY_VER.split('.')[0] %} {% set PY_VER_MINOR = PY_VER.split('.')[1] %}