Skip to content

Commit 6f64094

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents b4b1502 + 6b3d1cb commit 6f64094

File tree

161 files changed

+6154
-2147
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+6154
-2147
lines changed

.github/workflows/release_wheel_creation.yml

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,8 @@ jobs:
5959

6060
steps:
6161
- uses: actions/checkout@v4
62-
- name: Create pyproject.toml
63-
run: |
64-
# Per the cibuildwheel documentation, you can technically use
65-
# CIBW_BEFORE_BUILD to do these steps; however, as of the newest
66-
# version (2.21.3) this feature does not work. This is a hack
67-
# to make cibuildwheel recognize our pre-build requirements
68-
echo -e '[build-system]\n\nrequires = [ "setuptools", "wheel", "cython", "pybind11" ]' > $GITHUB_WORKSPACE/pyproject.toml
69-
cat $GITHUB_WORKSPACE/pyproject.toml
70-
ls -la $GITHUB_WORKSPACE
7162
- name: Build wheels
72-
uses: pypa/cibuildwheel@v2.21.3
63+
uses: pypa/cibuildwheel@main
7364
with:
7465
output-dir: dist
7566
env:
@@ -118,17 +109,8 @@ jobs:
118109
uses: docker/setup-qemu-action@v3
119110
with:
120111
platforms: all
121-
- name: Create pyproject.toml
122-
run: |
123-
# Per the cibuildwheel documentation, you can technically use
124-
# CIBW_BEFORE_BUILD to do these steps; however, as of the newest
125-
# version (2.21.3) this feature does not work. This is a hack
126-
# to make cibuildwheel recognize our pre-build requirements
127-
echo -e '[build-system]\n\nrequires = [ "setuptools", "wheel", "cython", "pybind11" ]' > $GITHUB_WORKSPACE/pyproject.toml
128-
cat $GITHUB_WORKSPACE/pyproject.toml
129-
ls -la $GITHUB_WORKSPACE
130112
- name: Build wheels
131-
uses: pypa/cibuildwheel@v2.21.3
113+
uses: pypa/cibuildwheel@main
132114
with:
133115
output-dir: dist
134116
env:
@@ -158,10 +140,11 @@ jobs:
158140
- name: Install dependencies
159141
run: |
160142
python -m pip install --upgrade pip
161-
pip install twine wheel setuptools pybind11
143+
pip install build twine wheel setuptools pybind11
162144
- name: Build pure python wheel
163145
run: |
164-
python setup.py --without-cython sdist --format=gztar bdist_wheel
146+
export PYOMO_SETUP_ARGS=--without-cython
147+
python -m build --wheel --outdir dist --config-setting="--build-option=--without-cython"
165148
- name: Upload artifact
166149
uses: actions/upload-artifact@v4
167150
with:
@@ -189,10 +172,11 @@ jobs:
189172
- name: Install dependencies
190173
run: |
191174
python -m pip install --upgrade pip
192-
pip install twine wheel setuptools pybind11
175+
pip install build twine wheel 'setuptools>=65' pybind11
193176
- name: Build generic tarball
194177
run: |
195-
python setup.py --without-cython sdist --format=gztar
178+
export PYOMO_SETUP_ARGS=--without-cython
179+
python -m build --sdist --outdir dist --config-setting="--build-option=--without-cython"
196180
- name: Upload artifact
197181
uses: actions/upload-artifact@v4
198182
with:

.github/workflows/test_branches.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ jobs:
348348
if test "${{matrix.TARGET}}" == linux; then
349349
EXCLUDE="casadi numdifftools $EXCLUDE"
350350
fi
351-
if [[ "${{matrix.TARGET}}" == win && "${{matrix.python}}" == "3.13" ]]; then
351+
if [[ "${{matrix.TARGET}}" == win && "${{matrix.python}}" == 3.13* ]]; then
352352
# As of Nov 7, 2024, qtconsole is not compatible with python 3.13 on win
353353
EXCLUDE="qtconsole $EXCLUDE"
354354
fi
@@ -373,7 +373,7 @@ jobs:
373373
fi
374374
# Note: this will fail the build if any installation fails (or
375375
# possibly if it outputs messages to stderr)
376-
conda install --update-deps -q -y $CONDA_DEPENDENCIES
376+
conda install --update-deps -q -y python="${{matrix.python}}" $CONDA_DEPENDENCIES
377377
if test -z "${{matrix.slim}}"; then
378378
# xpress.init() (xpress 9.5.1 from conda) hangs indefinitely
379379
# on GHA/Windows under Python 3.10 and 3.11. Exclude that
@@ -534,9 +534,8 @@ jobs:
534534
echo "DYLD_LIBRARY_PATH=${env:DYLD_LIBRARY_PATH}:$GAMS_DIR" `
535535
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
536536
$INSTALLER = "${env:DOWNLOAD_DIR}/gams_install.exe"
537-
# We are pinning to 29.1.0 because a license is required for
538-
# versions after this in order to run in demo mode.
539-
$URL = "https://d37drm4t2jghv5.cloudfront.net/distributions/29.1.0"
537+
# Demo licenses are included for 5mo from the newest release
538+
$URL = "https://d37drm4t2jghv5.cloudfront.net/distributions/50.1.0"
540539
if ( "${{matrix.TARGET}}" -eq "win" ) {
541540
$URL = "$URL/windows/windows_x64_64.exe"
542541
} elseif ( "${{matrix.TARGET}}" -eq "osx" ) {
@@ -654,14 +653,15 @@ jobs:
654653
655654
- name: Install Pyomo
656655
run: |
656+
export PYOMO_SETUP_ARGS=${{ matrix.setup_options }}
657657
echo ""
658658
echo "Clone Pyomo-model-libraries..."
659659
URL=https://github.com/Pyomo/pyomo-model-libraries.git
660660
git clone -b ${SRC_REF##*/} $URL || git clone -b main $URL
661661
echo ""
662662
echo "Install Pyomo..."
663663
echo ""
664-
$PYTHON_EXE setup.py develop ${{matrix.setup_options}}
664+
$PYTHON_EXE -m pip install -e .
665665
echo ""
666666
echo "Set custom PYOMO_CONFIG_DIR"
667667
echo ""
@@ -790,7 +790,7 @@ jobs:
790790
echo ""
791791
echo "Install Pyomo..."
792792
echo ""
793-
python setup.py develop
793+
python -m pip install -e .
794794
echo ""
795795
echo "Set custom PYOMO_CONFIG_DIR"
796796
echo ""
@@ -868,13 +868,14 @@ jobs:
868868
869869
- name: Install Pyomo
870870
run: |
871+
export PYOMO_SETUP_ARGS=${{ matrix.setup_options }}
871872
echo ""
872873
echo "Clone Pyomo-model-libraries..."
873874
git clone https://github.com/Pyomo/pyomo-model-libraries.git
874875
echo ""
875876
echo "Install Pyomo..."
876877
echo ""
877-
$PYTHON_EXE setup.py develop ${{matrix.setup_options}}
878+
$PYTHON_EXE -m pip install -e .
878879
echo ""
879880
echo "Set custom PYOMO_CONFIG_DIR"
880881
echo ""

.github/workflows/test_pr_and_main.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ jobs:
400400
if test "${{matrix.TARGET}}" == linux; then
401401
EXCLUDE="casadi numdifftools $EXCLUDE"
402402
fi
403-
if [[ "${{matrix.TARGET}}" == win && "${{matrix.python}}" == "3.13" ]]; then
403+
if [[ "${{matrix.TARGET}}" == win && "${{matrix.python}}" == 3.13* ]]; then
404404
# As of Nov 7, 2024, qtconsole is not compatible with python 3.13 on win
405405
EXCLUDE="qtconsole $EXCLUDE"
406406
fi
@@ -425,7 +425,7 @@ jobs:
425425
fi
426426
# Note: this will fail the build if any installation fails (or
427427
# possibly if it outputs messages to stderr)
428-
conda install --update-deps -q -y $CONDA_DEPENDENCIES
428+
conda install --update-deps -q -y python="${{matrix.python}}" $CONDA_DEPENDENCIES
429429
if test -z "${{matrix.slim}}"; then
430430
# xpress.init() (xpress 9.5.1 from conda) hangs indefinitely
431431
# on GHA/Windows under Python 3.10 and 3.11. Exclude that
@@ -586,9 +586,8 @@ jobs:
586586
echo "DYLD_LIBRARY_PATH=${env:DYLD_LIBRARY_PATH}:$GAMS_DIR" `
587587
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
588588
$INSTALLER = "${env:DOWNLOAD_DIR}/gams_install.exe"
589-
# We are pinning to 29.1.0 because a license is required for
590-
# versions after this in order to run in demo mode.
591-
$URL = "https://d37drm4t2jghv5.cloudfront.net/distributions/29.1.0"
589+
# Demo licenses are included for 5mo from the newest release
590+
$URL = "https://d37drm4t2jghv5.cloudfront.net/distributions/50.1.0"
592591
if ( "${{matrix.TARGET}}" -eq "win" ) {
593592
$URL = "$URL/windows/windows_x64_64.exe"
594593
} elseif ( "${{matrix.TARGET}}" -eq "osx" ) {
@@ -706,14 +705,15 @@ jobs:
706705
707706
- name: Install Pyomo
708707
run: |
708+
export PYOMO_SETUP_ARGS=${{ matrix.setup_options }}
709709
echo ""
710710
echo "Clone Pyomo-model-libraries..."
711711
URL=https://github.com/Pyomo/pyomo-model-libraries.git
712712
git clone -b ${SRC_REF##*/} $URL || git clone -b main $URL
713713
echo ""
714714
echo "Install Pyomo..."
715715
echo ""
716-
$PYTHON_EXE setup.py develop ${{matrix.setup_options}}
716+
$PYTHON_EXE -m pip install -e .
717717
echo ""
718718
echo "Set custom PYOMO_CONFIG_DIR"
719719
echo ""
@@ -843,7 +843,7 @@ jobs:
843843
echo ""
844844
echo "Install Pyomo..."
845845
echo ""
846-
python setup.py develop
846+
python -m pip install -e .
847847
echo ""
848848
echo "Set custom PYOMO_CONFIG_DIR"
849849
echo ""
@@ -921,13 +921,14 @@ jobs:
921921
922922
- name: Install Pyomo
923923
run: |
924+
export PYOMO_SETUP_ARGS=${{ matrix.setup_options }}
924925
echo ""
925926
echo "Clone Pyomo-model-libraries..."
926927
git clone https://github.com/Pyomo/pyomo-model-libraries.git
927928
echo ""
928929
echo "Install Pyomo..."
929930
echo ""
930-
$PYTHON_EXE setup.py develop ${{matrix.setup_options}}
931+
$PYTHON_EXE -m pip install -e .
931932
echo ""
932933
echo "Set custom PYOMO_CONFIG_DIR"
933934
echo ""

.github/workflows/typos.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,6 @@ EOF = "EOF"
7171
lst = "lst"
7272
# Abbreviation of gamma (used in stochpdegas1_automatic.py)
7373
gam = "gam"
74+
# Regex search term from contrib/solver/solvers/ipopt
75+
ond = "ond"
7476
# AS NEEDED: Add More Words Below

.jenkins.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#
2929
# DISABLE_COVERAGE: if nonempty, then coverage analysis is disabled
3030
#
31-
# PYOMO_SETUP_ARGS: passed to the 'python setup.py develop' command
31+
# PYOMO_SETUP_ARGS: passed to the 'pip install' command
3232
# (e.g., to specify --with-cython)
3333
#
3434
# PYOMO_DOWNLOAD_ARGS: passed to the 'pyomo download-extensions' command
@@ -94,7 +94,7 @@ if test -z "$MODE" -o "$MODE" == setup; then
9494
echo "PyUtilib not found; skipping"
9595
fi
9696
pushd "$WORKSPACE/pyomo" || exit 1
97-
python setup.py develop $PYOMO_SETUP_ARGS || exit 1
97+
pip install -e . || exit 1
9898
popd
9999
#
100100
# DO NOT install pyomo-model-libraries

doc/OnlineDocs/_templates/recursive-base.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
# import everything from the module containing this class so that
88
# doctests for the class docstrings see the correct environment
99
from {{ module }} import *
10+
try:
11+
from {{ module }} import _autosummary_doctest_setup
12+
_autosummary_doctest_setup()
13+
except ImportError:
14+
pass
1015

1116
.. currentmodule:: {{ module }}
1217

doc/OnlineDocs/_templates/recursive-class.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
# import everything from the module containing this class so that
88
# doctests for the class docstrings see the correct environment
99
from {{ module }} import *
10+
try:
11+
from {{ module }} import _autosummary_doctest_setup
12+
_autosummary_doctest_setup()
13+
except ImportError:
14+
pass
1015

1116
.. currentmodule:: {{ module }}
1217

doc/OnlineDocs/_templates/recursive-enum.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
# import everything from the module containing this class so that
88
# doctests for the class docstrings see the correct environment
99
from {{ module }} import *
10+
try:
11+
from {{ module }} import _autosummary_doctest_setup
12+
_autosummary_doctest_setup()
13+
except ImportError:
14+
pass
1015

1116
.. currentmodule:: {{ module }}
1217

doc/OnlineDocs/_templates/recursive-module.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ Library Reference
55
{{ name | escape | underline}}
66
{% endif %}
77

8+
.. testsetup:: *
9+
10+
# import everything from the module containing this class so that
11+
# doctests for the class docstrings see the correct environment
12+
from {{ module }} import *
13+
try:
14+
from {{ module }} import _autosummary_doctest_setup
15+
_autosummary_doctest_setup()
16+
except ImportError:
17+
pass
18+
19+
.. currentmodule:: {{ module }}
20+
821
.. automodule:: {{ fullname }}
922
:undoc-members:
1023

doc/OnlineDocs/errors.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ Common Warnings/Errors
88
for backwards compatibility, DO NOT recycle old ID (no longer used)
99
numbers.
1010
11-
.. doctest::
12-
:hide:
11+
.. testsetup::
1312

14-
>>> import pyomo.environ as pyo
13+
import pyomo.environ as pyo
14+
# Ensure that all logged messages are sent to stdout
15+
# (so they show up in the doctest output and can be tested)
16+
import pyomo.common.log as _log
17+
_log.pyomo_handler.__class__ = _log.StdoutHandler
1518

1619
.. py:currentmodule:: pyomo.environ
1720

0 commit comments

Comments
 (0)