Skip to content

Commit a5a5181

Browse files
Tanmay DasPrabhakar Kumar
Tanmay Das
authored and
Prabhakar Kumar
committed
Update workflow strategy matrix, action versions & black formatting.
1 parent d73266f commit a5a5181

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

.github/workflows/release.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Copyright 2020-2021 The MathWorks, Inc
1+
# Copyright (c) 2020-2023 The MathWorks, Inc
2+
3+
# Workflow to release MATLAB Jupyter Integration to PyPi
24
name: Release to PyPI
35

46
on:
@@ -11,12 +13,12 @@ jobs:
1113

1214
steps:
1315
- name: Checkout
14-
uses: actions/checkout@v2
16+
uses: actions/checkout@v3
1517
with:
1618
ref: ${{github.sha}}
1719

1820
- name: Set up Python 3.7
19-
uses: actions/setup-python@v2
21+
uses: actions/setup-python@v4
2022
with:
2123
python-version: 3.7
2224

@@ -39,12 +41,12 @@ jobs:
3941

4042
steps:
4143
- name: Checkout
42-
uses: actions/checkout@v2
44+
uses: actions/checkout@v3
4345
with:
4446
ref: ${{github.sha}}
4547

4648
- name: Set up Python 3.7
47-
uses: actions/setup-python@v2
49+
uses: actions/setup-python@v4
4850
with:
4951
python-version: 3.7
5052

.github/workflows/run-tests.yml

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
name: MATLAB Jupyter Integration
1+
# Copyright (c) 2020-2023 The MathWorks, Inc
2+
3+
# Workflow that contains jobs to test MATLAB Jupyter Integration
4+
name: Testing MATLAB Jupyter Integration
25

36
on:
47
push:
@@ -9,15 +12,16 @@ jobs:
912
python_tests:
1013
runs-on: ubuntu-latest
1114
strategy:
15+
fail-fast: false
1216
matrix:
13-
python-version: [3.7, 3.8, 3.9, 3.10]
17+
python-version: ['3.7', '3.8', '3.9', '3.10']
1418

1519
steps:
1620
- name: Checkout
17-
uses: actions/checkout@v2
21+
uses: actions/checkout@v3
1822

1923
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v2
24+
uses: actions/setup-python@v4
2125
with:
2226
python-version: ${{ matrix.python-version }}
2327

@@ -42,10 +46,10 @@ jobs:
4246
runs-on: ubuntu-latest
4347
steps:
4448
- name: Checkout
45-
uses: actions/checkout@v2
49+
uses: actions/checkout@v3
4650

4751
- name: Set up Python 3.7
48-
uses: actions/setup-python@v2
52+
uses: actions/setup-python@v4
4953
with:
5054
python-version: 3.7
5155

src/jupyter_matlab_kernel/mwi_comm_helpers.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def _send_feval_request_to_matlab(url, headers, fname, nargout, *args):
162162
def _send_eval_request_to_matlab(url, headers, mcode):
163163
# Add the MATLAB code shipped with kernel to the Path
164164
path = str(pathlib.Path(__file__).parent / "matlab")
165-
mcode = "addpath(\"" + path + "\")" + ";" + mcode
165+
mcode = 'addpath("' + path + '")' + ";" + mcode
166166

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

0 commit comments

Comments
 (0)