Skip to content

Commit

Permalink
24.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
alanfmw committed Sep 16, 2024
1 parent a8ac30a commit 413ef89
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 20 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ The MATLAB® Engine API for Python® provides a package to integrate MATLA
## Requirements
### Required MathWorks Products
<!-- MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) -->
* MATLAB release R2024a
* MATLAB release R2024b

### Required 3rd Party Products
<!-- MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) -->
* Python 3.9, 3.10, or 3.11
* Python 3.9, 3.10, 3.11, or 3.12
* Supported Python versions by MATLAB release can be found [here](https://www.mathworks.com/support/requirements/python-compatibility.html).

---
Expand All @@ -21,15 +21,15 @@ The MATLAB&reg; Engine API for Python&reg; provides a package to integrate MATLA
MATLAB Engine API for Python can be installed directly from the Python Package Index.
<!-- MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) -->
```bash
$ python -m pip install matlabengine==24.1.2
$ python -m pip install matlabengine==24.2.1
```



### Linux&reg;
Prior to installation, check the default install location of MATLAB by calling ```matlabroot``` in a MATLAB Command Window. By default, Linux installs MATLAB at:<br>
<!-- MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) -->
```/usr/local/MATLAB/R2024a```
```/usr/local/MATLAB/R2024b```

When MATLAB is not installed in the default location, the bin/*architecture* directory within the MATLAB root directory must be added to the environment variable LD_LIBRARY_PATH. The path can be added to the environment variable within the shell startup configuration file (for example, .bashrc for bash shell or .tcshrc for tcsh).

Expand All @@ -46,14 +46,14 @@ setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:<matlabroot>/bin/glnxa64
MATLAB Engine API for Python can be installed directly from the Python Package Index.
<!-- MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) -->
```bash
$ python -m pip install matlabengine==24.1.2
$ python -m pip install matlabengine==24.2.1
```

### macOS
Prior to installation, check the default install location of MATLAB by calling ```matlabroot``` in a MATLAB Command Window. By default, macOS installs MATLAB at:<br>

<!-- MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) -->
```/Applications/MATLAB_R2024a.app```
```/Applications/MATLAB_R2024b.app```

When MATLAB is not installed in the default location, the bin/*architecture* directory within the MATLAB root directory must be added to the environment variable DYLD_LIBRARY_PATH. The path can be added to the environment variable within the shell startup configuration file (for example, .bashrc for bash shell or .tcshrc for tcsh).

Expand All @@ -70,7 +70,7 @@ setenv DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH}:<matlabroot>/bin/maci64
MATLAB Engine API for Python can be installed directly from the Python Package Index.
<!-- MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string) -->
```bash
$ python -m pip install matlabengine==24.1.2
$ python -m pip install matlabengine==24.2.1
```

---
Expand Down
16 changes: 9 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ class _MatlabFinder(build_py):
}

# MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string)
MATLAB_REL = 'R2024a'
MATLAB_REL = 'R2024b'

# MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string)
MATLAB_VER = '24.1.2'
MATLAB_VER = '24.2.1'

# MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string)
SUPPORTED_PYTHON_VERSIONS = set(['3.9', '3.10', '3.11'])
SUPPORTED_PYTHON_VERSIONS = set(['3.9', '3.10', '3.11', '3.12'])

# MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string)
VER_TO_REL = {
Expand All @@ -38,7 +38,8 @@ class _MatlabFinder(build_py):
"9.13": "R2022b",
"9.14": "R2023a",
"23.2": "R2023b",
"24.1": "R2024a"
"24.1": "R2024a",
"24.2": "R2024b"
}

DEFAULT_INSTALLS = {
Expand Down Expand Up @@ -416,7 +417,7 @@ def run(self):
setup(
name="matlabengine",
# MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string)
version="24.1.2",
version="24.2.1",
description='A module to call MATLAB from Python',
author='MathWorks',
license="LICENSE.txt, located in this repository",
Expand All @@ -443,8 +444,9 @@ def run(self):
# MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string)
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11"
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12"
],
# MUST_BE_UPDATED_EACH_RELEASE (Search repo for this string)
python_requires=">=3.9, <3.12"
python_requires=">=3.9, <3.13"
)
4 changes: 2 additions & 2 deletions src/matlab/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 MathWorks, Inc.
# Copyright 2024 MathWorks, Inc.

import os
import platform
Expand Down Expand Up @@ -37,7 +37,7 @@ def add_dirs_to_path(bin_dir, engine_dir, extern_dir):

arch_file = os.path.join(package_folder, 'engine', '_arch.txt')
if not os.path.isfile(arch_file):
raise RuntimeError("The MATLAB Engine for Python install is corrupted, please try to re-install.")
raise RuntimeError("The MATLAB Engine for Python install is corrupted. Please try to re-install.")

with open(arch_file, 'r') as root:
[arch, bin_folder, engine_folder, extern_bin] = [line.strip() for line in root.readlines()]
Expand Down
18 changes: 15 additions & 3 deletions src/matlab/engine/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Copyright 2014-2023 MathWorks, Inc.
#Copyright 2014-2024 MathWorks, Inc.

"""
The MATLAB Engine enables you to call any MATLAB statement either synchronously
Expand All @@ -25,18 +25,30 @@
import atexit
import weakref
import threading
import warnings

# UPDATE_IF_PYTHON_VERSION_ADDED_OR_REMOVED : search for this string in codebase
# when support for a Python version must be added or removed
_supported_versions = ['3_9', '3_10', '3_11']

_supported_versions = ['3_9', '3_10', '3_11', '3_12']
_ver = sys.version_info
_version = '{0}_{1}'.format(_ver[0], _ver[1])
_newer_than_supported = _ver[1] > 12

_PYTHONVERSION = None

if _version in _supported_versions:
_PYTHONVERSION = _version
elif _newer_than_supported:
warnings.warn('MATLAB Engine for Python supports Python version'
' 3.9, 3.10, 3.11, and 3.12, but your version of Python '
'is %s' % _version)
_PYTHONVERSION = _version
else:
raise EnvironmentError("Python %s is not supported." % _version)
raise EnvironmentError('MATLAB Engine for Python supports Python version'
' 3.9, 3.10, 3.11, and 3.12, but your version of Python '
'is %s' % _version)


_module_folder = os.path.dirname(os.path.realpath(__file__))
_arch_filename = os.path.join(_module_folder, "_arch.txt")
Expand Down
2 changes: 1 addition & 1 deletion src/matlab/engine/enginehelper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Copyright 2017-2020 MathWorks, Inc.
#Copyright 2017-2022 MathWorks, Inc.
import warnings
from matlab.engine import pythonengine
import sys
Expand Down

0 comments on commit 413ef89

Please sign in to comment.