diff --git a/.coin-or/projDesc.xml b/.coin-or/projDesc.xml index 8a5a9e0a7df..b656b18fdeb 100644 --- a/.coin-or/projDesc.xml +++ b/.coin-or/projDesc.xml @@ -287,7 +287,7 @@ Carl D. Laird, Chair, Pyomo Management Committee, claird at andrew dot cmu dot e Any - Python 3.8, 3.9, 3.10, 3.11, 3.12 + Python 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 diff --git a/.github/workflows/release_wheel_creation.yml b/.github/workflows/release_wheel_creation.yml index d439dafaf0a..ecaf6afbd59 100644 --- a/.github/workflows/release_wheel_creation.yml +++ b/.github/workflows/release_wheel_creation.yml @@ -24,7 +24,7 @@ jobs: matrix: os: [ubuntu-22.04, windows-latest, macos-latest] arch: [all] - wheel-version: ['cp38*', 'cp39*', 'cp310*', 'cp311*', 'cp312*'] + wheel-version: ['cp38*', 'cp39*', 'cp310*', 'cp311*', 'cp312*', 'cp313*'] include: - wheel-version: 'cp38*' @@ -42,12 +42,17 @@ jobs: - wheel-version: 'cp312*' TARGET: 'py312' GLOBAL_OPTIONS: "--without-cython --with-distributable-extensions" + - wheel-version: 'cp313*' + TARGET: 'py313' + GLOBAL_OPTIONS: "--without-cython --with-distributable-extensions" exclude: - wheel-version: 'cp311*' os: windows-latest - wheel-version: 'cp312*' os: windows-latest + - wheel-version: 'cp313*' + os: windows-latest steps: - uses: actions/checkout@v4 @@ -77,7 +82,7 @@ jobs: matrix: os: [ubuntu-22.04] arch: [all] - wheel-version: ['cp38*', 'cp39*', 'cp310*', 'cp311*', 'cp312*'] + wheel-version: ['cp38*', 'cp39*', 'cp310*', 'cp311*', 'cp312*', 'cp313*'] include: - wheel-version: 'cp38*' @@ -95,6 +100,9 @@ jobs: - wheel-version: 'cp312*' TARGET: 'py312' GLOBAL_OPTIONS: "--without-cython --with-distributable-extensions" + - wheel-version: 'cp313*' + TARGET: 'py313' + GLOBAL_OPTIONS: "--without-cython --with-distributable-extensions" steps: - uses: actions/checkout@v4 - name: Set up QEMU diff --git a/.github/workflows/test_branches.yml b/.github/workflows/test_branches.yml index d6c3c5e37db..4b25fd858e7 100644 --- a/.github/workflows/test_branches.yml +++ b/.github/workflows/test_branches.yml @@ -71,7 +71,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python: ['3.12'] + python: ['3.13'] other: [""] category: [""] @@ -83,7 +83,7 @@ jobs: include: - os: ubuntu-latest - python: '3.12' + python: '3.13' TARGET: linux PYENV: pip @@ -116,7 +116,7 @@ jobs: PACKAGES: openmpi mpi4py - os: ubuntu-latest - python: '3.10' + python: '3.12' other: /cython setup_options: --with-cython skip_doctest: 1 @@ -344,6 +344,10 @@ jobs: if test "${{matrix.TARGET}}" == linux; then EXCLUDE="casadi numdifftools $EXCLUDE" fi + if [[ "${{matrix.TARGET}}" == win && "${{matrix.python}}" == "3.13" ]]; then + # As of Nov 7, 2024, qtconsole is not compatible with python 3.13 on win + EXCLUDE="qtconsole $EXCLUDE" + fi EXCLUDE=`echo "$EXCLUDE" | xargs` if test -n "$EXCLUDE"; then for WORD in $EXCLUDE; do diff --git a/.github/workflows/test_pr_and_main.yml b/.github/workflows/test_pr_and_main.yml index db75f2e795a..19174ea42c8 100644 --- a/.github/workflows/test_pr_and_main.yml +++ b/.github/workflows/test_pr_and_main.yml @@ -68,7 +68,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python: [ 3.8, 3.9, '3.10', '3.11', '3.12' ] + python: [ 3.8, 3.9, '3.10', '3.11', '3.12', '3.13' ] other: [""] category: [""] @@ -110,7 +110,7 @@ jobs: PACKAGES: openmpi mpi4py - os: ubuntu-latest - python: '3.10' + python: '3.12' other: /cython setup_options: --with-cython skip_doctest: 1 @@ -376,6 +376,10 @@ jobs: if test "${{matrix.TARGET}}" == linux; then EXCLUDE="casadi numdifftools $EXCLUDE" fi + if [[ "${{matrix.TARGET}}" == win && "${{matrix.python}}" == "3.13" ]]; then + # As of Nov 7, 2024, qtconsole is not compatible with python 3.13 on win + EXCLUDE="qtconsole $EXCLUDE" + fi EXCLUDE=`echo "$EXCLUDE" | xargs` if test -n "$EXCLUDE"; then for WORD in $EXCLUDE; do diff --git a/README.md b/README.md index 83934153361..29b900261e5 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ Pyomo is available under the BSD License - see the Pyomo is currently tested with the following Python implementations: -* CPython: 3.8, 3.9, 3.10, 3.11, 3.12 +* CPython: 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 * PyPy: 3.9 _Testing and support policy_: diff --git a/doc/OnlineDocs/getting_started/installation.rst b/doc/OnlineDocs/getting_started/installation.rst index 83cd08e7a4a..e36d83d4f8a 100644 --- a/doc/OnlineDocs/getting_started/installation.rst +++ b/doc/OnlineDocs/getting_started/installation.rst @@ -3,7 +3,7 @@ Installation Pyomo currently supports the following versions of Python: -* CPython: 3.8, 3.9, 3.10, 3.11, 3.12 +* CPython: 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 * PyPy: 3 At the time of the first Pyomo release after the end-of-life of a minor Python diff --git a/pyomo/contrib/pynumero/sparse/mpi_block_vector.py b/pyomo/contrib/pynumero/sparse/mpi_block_vector.py index f976ee2853d..85acee1051d 100644 --- a/pyomo/contrib/pynumero/sparse/mpi_block_vector.py +++ b/pyomo/contrib/pynumero/sparse/mpi_block_vector.py @@ -305,14 +305,14 @@ def has_none(self): @property def owned_blocks(self): """ - Returns list with inidices of blocks owned by this processor. + Returns list with indices of blocks owned by this processor. """ return self._owned_blocks @property def shared_blocks(self): """ - Returns list with inidices of blocks shared by all processors + Returns list with indices of blocks shared by all processors """ return np.array([i for i in range(self.nblocks) if self._rank_owner[i] < 0]) @@ -1377,6 +1377,9 @@ def cumsum(self, axis=None, dtype=None, out=None): raise RuntimeError('Operation not supported by MPIBlockVector') def tolist(self): + """ + Disable `np.ndarray.tolist` as it is not supported. + """ raise RuntimeError('Operation not supported by MPIBlockVector') def flatten(self, order='C'): diff --git a/pyomo/contrib/viewer/tests/test_qt.py b/pyomo/contrib/viewer/tests/test_qt.py index b7250729cd9..9d18cc388df 100644 --- a/pyomo/contrib/viewer/tests/test_qt.py +++ b/pyomo/contrib/viewer/tests/test_qt.py @@ -44,6 +44,7 @@ import pyomo.contrib.viewer.qt as myqt import pyomo.contrib.viewer.pyomo_viewer as pv from pyomo.contrib.viewer.qt import available +from pyomo.core.base.units_container import pint_available if available: import contextvars @@ -57,6 +58,18 @@ def qtbot(): """Overwrite qtbot - remove test failure""" return + pytestmark = unittest.pytest.mark.skip("Qt components are not available.") + +if not pint_available: + pytestmark = unittest.pytest.mark.skip( + "contrib.viewer requires pint, which is not available." + ) + +if not pv.qtconsole_available: + pytestmark = unittest.pytest.mark.skip( + "contrib.viewer requires qtconsole, which is not available." + ) + def get_model(): # Borrowed this test model from the trust region tests @@ -100,7 +113,6 @@ def blackbox(a, b): return m -@unittest.skipIf(not available, "Qt packages are not available.") def test_get_mainwindow(qtbot): m = get_model() mw = get_mainwindow(model=m, testing=True) @@ -111,13 +123,11 @@ def test_get_mainwindow(qtbot): assert isinstance(mw.parameters, ModelBrowser) -@unittest.skipIf(not available, "Qt packages are not available.") def test_close_mainwindow(qtbot): mw = get_mainwindow(model=None, testing=True) mw.exit_action() -@unittest.skipIf(not available, "Qt packages are not available.") def test_show_model_select_no_models(qtbot): mw = get_mainwindow(model=None, testing=True) ms = mw.show_model_select() @@ -125,7 +135,6 @@ def test_show_model_select_no_models(qtbot): ms.select_model() -@unittest.skipIf(not available, "Qt packages are not available.") def test_model_information(qtbot): m = get_model() mw = get_mainwindow(model=m, testing=True) @@ -146,7 +155,6 @@ def test_model_information(qtbot): assert isinstance(mw.parameters, ModelBrowser) -@unittest.skipIf(not available, "Qt packages are not available.") def test_tree_expand_collapse(qtbot): m = get_model() mw = get_mainwindow(model=m, testing=True) @@ -154,7 +162,6 @@ def test_tree_expand_collapse(qtbot): mw.variables.treeView.collapseAll() -@unittest.skipIf(not available, "Qt packages are not available.") def test_residual_table(qtbot): m = get_model() mw = get_mainwindow(model=m, testing=True) @@ -181,7 +188,6 @@ def test_residual_table(qtbot): assert dm.data(dm.index(0, 0)) == "c5" -@unittest.skipIf(not available, "Qt packages are not available.") def test_var_tree(qtbot): m = get_model() mw = get_mainwindow(model=m, testing=True) @@ -215,7 +221,6 @@ def test_var_tree(qtbot): mw.variables.treeView.closePersistentEditor(z1_val_index) -@unittest.skipIf(not available, "Qt packages are not available.") def test_bad_view(qtbot): m = get_model() mw = get_mainwindow(model=m, testing=True) @@ -229,7 +234,6 @@ def test_bad_view(qtbot): assert err == "ValueError" -@unittest.skipIf(not available, "Qt packages are not available.") def test_qtconsole_app(qtbot): app = pv.QtApp() # empty list to prevent picking up args from pytest diff --git a/setup.py b/setup.py index 65ed69632fd..a2c7a2e00a2 100644 --- a/setup.py +++ b/setup.py @@ -239,6 +239,7 @@ def __ne__(self, other): 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Scientific/Engineering :: Mathematics',