Skip to content

Commit

Permalink
Update workflow strategy matrix, action versions & black formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanmay Das authored and Prabhakar Kumar committed Jan 27, 2023
1 parent d73266f commit a5a5181
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Copyright 2020-2021 The MathWorks, Inc
# Copyright (c) 2020-2023 The MathWorks, Inc

# Workflow to release MATLAB Jupyter Integration to PyPi
name: Release to PyPI

on:
Expand All @@ -11,12 +13,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{github.sha}}

- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.7

Expand All @@ -39,12 +41,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{github.sha}}

- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.7

Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: MATLAB Jupyter Integration
# Copyright (c) 2020-2023 The MathWorks, Inc

# Workflow that contains jobs to test MATLAB Jupyter Integration
name: Testing MATLAB Jupyter Integration

on:
push:
Expand All @@ -9,15 +12,16 @@ jobs:
python_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, 3.10]
python-version: ['3.7', '3.8', '3.9', '3.10']

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -42,10 +46,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.7

Expand Down
8 changes: 6 additions & 2 deletions src/jupyter_matlab_kernel/mwi_comm_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def _send_feval_request_to_matlab(url, headers, fname, nargout, *args):
def _send_eval_request_to_matlab(url, headers, mcode):
# Add the MATLAB code shipped with kernel to the Path
path = str(pathlib.Path(__file__).parent / "matlab")
mcode = "addpath(\"" + path + "\")" + ";" + mcode
mcode = 'addpath("' + path + '")' + ";" + mcode

req_body = get_data_to_eval_mcode(mcode)
resp = requests.post(
Expand Down Expand Up @@ -241,7 +241,11 @@ def _send_jupyter_request_to_matlab(url, headers, request_type, inputs):
# code. Also, we need to escape the backslash (\) character so that the
# string which needs to be evaluated isn't broken down by MATLAB due to
# formatting
args = f"'{request_type}', '{execution_request_type}', '" + json.dumps(user_mcode.replace("'", "''")) + f"'"
args = (
f"'{request_type}', '{execution_request_type}', '"
+ json.dumps(user_mcode.replace("'", "''"))
+ f"'"
)
if request_type == "complete":
cursor_pos = inputs[3]
args = args + "," + str(cursor_pos)
Expand Down

0 comments on commit a5a5181

Please sign in to comment.