Skip to content

Commit

Permalink
Prefer octave-cli if available (#236)
Browse files Browse the repository at this point in the history
* Prefer octave-cli if available

* try system octave

* use sudo
  • Loading branch information
blink1073 authored Apr 15, 2024
1 parent 31238ac commit b2fa16c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, '3.10']
python-version: [3.8, 3.9, '3.10', '3.11']

steps:
- uses: actions/checkout@v2
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Setup conda ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
miniforge-variant: Mambaforge
python-version: ${{ matrix.python-version }}
- name: Install octave
run: |
sudo apt-get install -y octave
- name: Install dependencies
run: |
conda install -y octave
make install
make docker-build
- name: Run test
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ To install using conda::
conda install octave_kernel
conda install texinfo # For the inline documentation (shift-tab) to appear.

We require the ``octave`` executable to run the kernel.
We require the ``octave-cli`` or ``octave`` executable to run the kernel.
Add that executable's directory to the ``PATH`` environment variable or create the
environment variable ``OCTAVE_EXECUTABLE`` to point to the executable itself.
Note that on Octave 5 on Windows, the executable is in ``"Octave-5.x.x.x\mingw64\bin"``.
Note that on Octave 5+ on Windows, the executable is in ``"Octave-x.x.x.x\mingw64\bin"``.

We automatically install a Jupyter kernelspec when installing the
python package. This location can be found using ``jupyter kernelspec list``.
Expand Down
6 changes: 4 additions & 2 deletions octave_kernel/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,11 @@ def _get_executable(self):
if 'octave' not in executable:
raise OSError('OCTAVE_EXECUTABLE does not point to an octave file, please see README')
else:
executable = which('octave')
executable = which('octave-cli')
if not executable:
raise OSError('octave not found, please see README')
executable = which('octave')
if not executable:
raise OSError('octave not found, please see README')
return executable.replace(os.path.sep, '/')

def _cleanup(self):
Expand Down

0 comments on commit b2fa16c

Please sign in to comment.