From 64b1ddb3c7200ed9a2ad17514662f2acf29612d2 Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Fri, 12 Sep 2025 14:34:42 -0700 Subject: [PATCH 1/3] workaround nargout bug in Octave --- inst/@pyobject/subsref.m | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/inst/@pyobject/subsref.m b/inst/@pyobject/subsref.m index 13b6a9b..bd9b0ae 100644 --- a/inst/@pyobject/subsref.m +++ b/inst/@pyobject/subsref.m @@ -118,6 +118,17 @@ function varargout = subsref (x, idx) elseif (nargout == 1) varargout{1} = r; elseif (nargout >= 2) + % Octave bug https://savannah.gnu.org/bugs/?67506 means x{"string"} + % erroneously sets nargout = length("string"). Try to workaround... + if (t.type == "{}" && compare_versions (ver ("Octave").Version, "9.0.0", ">=")) + % TODO: hopefully fixed for 11 + % && compare_versions (ver ("Octave").Version, "11.0.0", "<") + if (isa (t.subs{1}, 'char') && nargout == length (t.subs{1})) + % in this special special case, we assume one argument (won't always be right!) + varargout{1} = r; + return + end + end assert (length (r) == nargout, ... "pyobject/subsref: number of outputs must match") [varargout{1:nargout}] = subsref (r, struct ("type", "{}", "subs", {{1:nargout}})); -- GitLab From 619214d5d82018e768da773d0c304dd5a901318a Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Fri, 12 Sep 2025 14:36:55 -0700 Subject: [PATCH 2/3] Adjust tests Fixes Issue #136. Fixes Issue #137. --- .gitlab-ci.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4fb4038..5920fa0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -140,9 +140,13 @@ python3.13: PYTHON_VERSION_FULL: "3.13.7" extends: .test:pyenv -# Expected to fail, Issue #136 -python3.11-octave9.4.0: - extends: python3.11 +python3.13-octave10.2.0: + extends: python3.13 + image: gnuoctave/octave:10.2.0 + allow_failure: true + +python3.12-octave9.4.0: + extends: python3.12 image: gnuoctave/octave:9.4.0 allow_failure: true @@ -282,7 +286,9 @@ macos_tests: - brew --version - brew install gnu-sed - brew info octave - - brew install octave@8.4.0 + # note as of 2025-09 octave@8.4.0 pinning doesn't work + # so we're sort of at the wim of HomeBrew what Octave we get + - brew install octave script: - gcc --version - clang --version -- GitLab From f7d4bcae0d0d5da63266cf45cd08028b7b184fe3 Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Sat, 13 Sep 2025 01:12:19 -0700 Subject: [PATCH 3/3] CI: use latest doctest --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5920fa0..cf06950 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,7 @@ variables: &variables CXXFLAGS: "-g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wall -Wdate-time -Wextra -Wformat=2" DEBIAN_FRONTEND: "noninteractive" DOCTEST_GIT_REPOSITORY: "https://github.com/gnu-octave/octave-doctest.git" - DOCTEST_GIT_TAG: "v0.8.0" + DOCTEST_GIT_TAG: "v0.8.1" DOCTEST_ROOT: "/tmp/doctest" LIBSSL_DEV: "libssl-dev" PYENV_GIT_REPOSITORY: "https://github.com/pyenv/pyenv.git" -- GitLab