Skip to content

Commit d6841c2

Browse files
Shushant Singhprabhakk-mw
authored andcommitted
Introduces support for python 3.12, 3.13 and deprecates support for python 3.8 and 3.9
fixes #62
1 parent 6f42e3f commit d6841c2

File tree

9 files changed

+21
-37
lines changed

9 files changed

+21
-37
lines changed

.github/actions/generate-code-coverage/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ inputs:
1212
runs:
1313
using: "composite"
1414
steps:
15-
- name: Set up Python 3.8
15+
- name: Set up Python 3.10
1616
uses: actions/setup-python@v5
1717
with:
18-
python-version: '3.8'
18+
python-version: '3.10'
1919

2020
- name: Use Node.js 24
2121
uses: actions/setup-node@v6

.github/workflows/release-to-pypi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ jobs:
5151
with:
5252
node-version: 24
5353

54-
- name: Set up Python 3.8
54+
- name: Set up Python 3.10
5555
uses: actions/setup-python@v5
5656
with:
57-
python-version: '3.8'
57+
python-version: '3.10'
5858

5959
- name: Install Python build dependencies
6060
run: |

.github/workflows/run-integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
matrix:
2525
os: [ubuntu-latest, windows-latest]
2626
matlab-release: [R2020b, latest]
27-
python-version: ['3.8', '3.11']
27+
python-version: ['3.10', '3.13']
2828
node-version: ['24']
2929

3030
runs-on: ${{ matrix.os }}

.github/workflows/run-unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474

7575
matrix:
7676
os: [ubuntu-latest, windows-latest]
77-
python-version: ['3.10', '3.11']
77+
python-version: ['3.10', '3.11', '3.12', '3.13']
7878
node-version: ['24']
7979

8080
runs-on: ${{ matrix.os }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ MATLAB Proxy is under active development. For support or to report issues, see [
5959
$ sudo apt install fluxbox
6060
```
6161

62-
* Python versions: **3.8** | **3.9** | **3.10** | **3.11**
62+
* Python versions: 3.10 | 3.11 | 3.12 | 3.13
6363
* [Browser Requirements](https://www.mathworks.com/support/requirements/browser-requirements.html)
6464
* Supported Operating Systems:
6565
* Linux®

matlab_proxy/util/mwi/download.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 The MathWorks, Inc.
1+
# Copyright 2024-2025 The MathWorks, Inc.
22

33
# This file contains functions required to enable downloads from the file browser
44
from matlab_proxy.util.mwi import logger as mwi_logger
@@ -131,15 +131,6 @@ def _get_download_payload_path(req):
131131
"/download" if _is_null_base_url(base_url) else f"{base_url}/download"
132132
)
133133

134-
if system.is_windows():
135-
# On Windows, the URL is of the form : /downloadC:\some\path\to\file.txt
136-
return str(
137-
Path((req.rel_url.path).replace("/download", "/download/")).relative_to(
138-
f"{compare_str}"
139-
)
140-
)
141-
else:
142-
# On Posix, the URL is of the form : /download/some/path/to/file.txt
143-
return "/" + str(Path((req.rel_url.path)).relative_to(f"{compare_str}"))
134+
return str(req.rel_url.path).replace(compare_str, "", 1)
144135

145136
return None

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ build-backend = "hatchling.build"
66

77
[project]
88
name = "matlab-proxy"
9-
version = "0.28.3"
9+
version = "0.28.4"
1010
description = "Python® package enables you to launch MATLAB® and access it from a web browser."
1111
readme = "README.md"
1212
license = "LicenseRef-MATHWORKS-CLOUD-REFERENCE-ARCHITECTURE-LICENSE"
1313
license-files = ["LICENSE.md"]
14-
requires-python = ">=3.8"
14+
requires-python = ">=3.10, <3.14"
1515
authors = [
1616
{ name = "The MathWorks Inc.", email = "[email protected]" },
1717
]
@@ -27,10 +27,10 @@ classifiers = [
2727
"Intended Audience :: Developers",
2828
"Natural Language :: English",
2929
"Programming Language :: Python",
30-
"Programming Language :: Python :: 3.8",
31-
"Programming Language :: Python :: 3.9",
3230
"Programming Language :: Python :: 3.10",
3331
"Programming Language :: Python :: 3.11",
32+
"Programming Language :: Python :: 3.12",
33+
"Programming Language :: Python :: 3.13",
3434
]
3535

3636
dependencies = [

tests/integration/integration_tests_with_license/test_http_end_points.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def _download_test_file(matlab_proxy_app_fixture, test_file):
155155
uri,
156156
connection_scheme,
157157
headers,
158-
http_endpoint="/download/" + test_file,
158+
http_endpoint="/download" + test_file,
159159
outputFormat=Format.TEXT,
160160
)
161161
return res

tests/unit/util/mwi/test_download.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 The MathWorks, Inc.
1+
# Copyright 2024-2025 The MathWorks, Inc.
22
import pytest
33

44
from matlab_proxy.util.mwi.download import (
@@ -20,12 +20,6 @@ def mock_request_fixture(mocker):
2020
return mock_req
2121

2222

23-
def _get_expected_output_based_on_os_type(paths: list) -> str:
24-
import matlab_proxy.util.system as system
25-
26-
return "\\".join(paths) if system.is_windows() else "/".join(paths)
27-
28-
2923
# Test for is_download_request function
3024
@pytest.mark.parametrize(
3125
"test_base_url, path, expected",
@@ -70,26 +64,25 @@ def test_is_download_request(mock_request_fixture, test_base_url, path, expected
7064
False,
7165
"",
7266
"/download/some/path/to/file.txt",
73-
_get_expected_output_based_on_os_type(["/some", "path", "to", "file.txt"]),
67+
"/some/path/to/file.txt",
7468
),
7569
(
7670
False,
7771
"/base",
7872
"/base/download/some/path/to/file.txt",
79-
_get_expected_output_based_on_os_type(["/some", "path", "to", "file.txt"]),
73+
"/some/path/to/file.txt",
8074
),
8175
],
8276
ids=[
83-
"Windows with null base url",
84-
"Windows with non-null base url",
85-
"Linux with null base url",
86-
"Linux with non-null base url",
77+
"Windows path with null base url",
78+
"Windows path with non-null base url",
79+
"Linux path with null base url",
80+
"Linux path with non-null base url",
8781
],
8882
)
8983
def test_get_download_payload_path(
9084
mock_request_fixture, mocker, is_windows, test_base_url, path, expected
9185
):
92-
mocker.patch("matlab_proxy.util.system.is_windows", return_value=is_windows)
9386
mock_request_fixture.app["settings"]["base_url"] = test_base_url
9487
mock_request_fixture.rel_url.path = path
9588
assert _get_download_payload_path(mock_request_fixture) == expected

0 commit comments

Comments
 (0)