diff --git a/.github/workflows/qualify_23b.yml b/.github/workflows/qualify_24a.yml similarity index 85% rename from .github/workflows/qualify_23b.yml rename to .github/workflows/qualify_24a.yml index daa00d8..1f4d2f1 100644 --- a/.github/workflows/qualify_23b.yml +++ b/.github/workflows/qualify_24a.yml @@ -1,15 +1,15 @@ # Run tInstall on Ubuntu against python versions 3.11, 3.10 and 3.9 -name: Test R2023b +name: Test R2024a on: push: branches: - - R2023b + - R2024a pull_request: branches: - - R2023b + - R2024a # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -32,9 +32,9 @@ jobs: python-version: ${{ matrix.python }} - name: Set up MATLAB - uses: matlab-actions/setup-matlab@v1 + uses: matlab-actions/setup-matlab@v2 with: - release: R2023b + release: R2024a - uses: actions/checkout@v3 diff --git a/README.md b/README.md index db33104..198cb1f 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ The MATLAB® Engine API for Python® provides a package to integrate MATLA MATLAB Engine API for Python can be installed directly from the Python Package Index. ```bash -$ python -m pip install matlabengine==24.1.1 +$ python -m pip install matlabengine==24.1.4 ``` @@ -46,7 +46,7 @@ setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/bin/glnxa64 MATLAB Engine API for Python can be installed directly from the Python Package Index. ```bash -$ python -m pip install matlabengine==24.1.1 +$ python -m pip install matlabengine==24.1.4 ``` ### macOS @@ -70,7 +70,7 @@ setenv DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH}:/bin/maci64 MATLAB Engine API for Python can be installed directly from the Python Package Index. ```bash -$ python -m pip install matlabengine==24.1.1 +$ python -m pip install matlabengine==24.1.4 ``` --- diff --git a/setup.py b/setup.py index 1e6f24a..a4df27c 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ class _MatlabFinder(build_py): MATLAB_REL = 'R2024a' # MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) - MATLAB_VER = '24.1.1' + MATLAB_VER = '24.1.4' # MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) SUPPORTED_PYTHON_VERSIONS = set(['3.9', '3.10', '3.11']) @@ -416,7 +416,7 @@ def run(self): setup( name="matlabengine", # MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) - version="24.1.1", + version="24.1.4", description='A module to call MATLAB from Python', author='MathWorks', license="LICENSE.txt, located in this repository", diff --git a/src/matlab/engine/__init__.py b/src/matlab/engine/__init__.py index c3c9710..244205e 100644 --- a/src/matlab/engine/__init__.py +++ b/src/matlab/engine/__init__.py @@ -1,4 +1,4 @@ -#Copyright 2014-2022 MathWorks, Inc. +#Copyright 2014-2023 MathWorks, Inc. """ The MATLAB Engine enables you to call any MATLAB statement either synchronously @@ -44,7 +44,10 @@ firstExceptionMessage = '' secondExceptionMessage = '' try: - pythonengine = importlib.import_module("matlabengineforpython"+_PYTHONVERSION) + if _PYTHONVERSION != '3_9' and _PYTHONVERSION != '3_10': + pythonengine = importlib.import_module("matlabengineforpython_abi3") + else: + pythonengine = importlib.import_module("matlabengineforpython" + _PYTHONVERSION) except Exception as firstE: firstExceptionMessage = str(firstE) @@ -65,7 +68,10 @@ else: os.environ[_envs[_arch]] = _bin_dir os.add_dll_directory(_bin_dir) - pythonengine = importlib.import_module("matlabengineforpython"+_PYTHONVERSION) + if _PYTHONVERSION != '3_9' or _PYTHONVERSION != '3_10': + pythonengine = importlib.import_module("matlabengineforpython_abi3") + else: + pythonengine = importlib.import_module("matlabengineforpython" + _PYTHONVERSION) except Exception as secondE: str1 = 'Please reinstall MATLAB Engine for Python or contact ' str2 = 'MathWorks Technical Support for assistance:\nFirst issue: {}\nSecond issue: {}'.format( @@ -106,9 +112,8 @@ def start_matlab(option="-nodesktop", **kwargs): Parameters option - MATLAB startup option. - async, background: bool - start MATLAB asynchronously or not. This parameter - is optional and false by default. "async" is a synonym for "background" - that will be removed in a future release. + background: bool - start MATLAB asynchronously or not. This parameter + is optional and false by default. Returns MatlabEngine - if aync or background is false. This object can be used to evaluate diff --git a/src/matlab/engine/fevalfuture.py b/src/matlab/engine/fevalfuture.py index ede123a..33a4501 100644 --- a/src/matlab/engine/fevalfuture.py +++ b/src/matlab/engine/fevalfuture.py @@ -19,12 +19,6 @@ import time import weakref -try: - long -except NameError: - long = int - - class FevalFuture(BaseFuture): """ A FevalFuture object is used to hold the future result of a MATLAB diff --git a/src/matlab/engine/futureresult.py b/src/matlab/engine/futureresult.py index 3bcdf9d..591d4b1 100644 --- a/src/matlab/engine/futureresult.py +++ b/src/matlab/engine/futureresult.py @@ -16,11 +16,6 @@ from matlab.engine import MatlabFuture from matlab.engine import FevalFuture -try: - long -except NameError: - long = int - class FutureResult(): """ A FutureResult object is used to hold the future result of a function call. @@ -58,7 +53,7 @@ def result(self, timeout=None): RejectedExecutionError - an error occurs if the engine is terminated. """ if timeout is not None: - if not isinstance(timeout, (int, long, float)): + if not isinstance(timeout, (int, float)): raise TypeError(pythonengine.getMessage('TimeoutMustBeNumeric', type(timeout).__name__)) if timeout < 0: