Skip to content

Commit bc2bdbd

Browse files
authored
Merge branch 'main' into capture_output_jupyter
2 parents 4889542 + 093efa2 commit bc2bdbd

File tree

31 files changed

+503
-224
lines changed

31 files changed

+503
-224
lines changed

codecov.yml .codecov.yml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ codecov:
55
# Potential to change when Python versions change
66
after_n_builds: 16
77
wait_for_ci: true
8+
require_ci_to_pass: false
89
coverage:
910
range:
1011
- 50.0

.github/workflows/test_branches.yml

+16-9
Original file line numberDiff line numberDiff line change
@@ -78,24 +78,26 @@ jobs:
7878
include:
7979
- os: ubuntu-latest
8080
python: 3.13
81+
test_docs: 1
8182
TARGET: linux
8283
PYENV: pip
8384

8485
- os: macos-latest
8586
python: 3.12
87+
test_docs: 1
8688
TARGET: osx
8789
PYENV: pip
8890

8991
- os: windows-latest
9092
python: 3.11
93+
test_docs: 1
9194
TARGET: win
9295
PYENV: conda
9396
PACKAGES: glpk pytest-qt filelock
9497

9598
- os: ubuntu-latest
9699
python: 3.11
97100
other: /conda
98-
skip_doctest: 1
99101
TARGET: linux
100102
PYENV: conda
101103
PACKAGES: pytest-qt
@@ -104,7 +106,6 @@ jobs:
104106
python: '3.10'
105107
other: /mpi
106108
mpi: 3
107-
skip_doctest: 1
108109
TARGET: linux
109110
PYENV: conda
110111
PACKAGES: openmpi mpi4py
@@ -113,15 +114,13 @@ jobs:
113114
python: 3.12
114115
other: /cython
115116
setup_options: --with-cython
116-
skip_doctest: 1
117117
TARGET: linux
118118
PYENV: pip
119119
PACKAGES: cython
120120

121121
- os: windows-latest
122122
python: 3.9
123123
other: /pip
124-
skip_doctest: 1
125124
TARGET: win
126125
PYENV: pip
127126

@@ -671,7 +670,7 @@ jobs:
671670
> ${SITE_PACKAGES}/run_coverage_at_startup.pth
672671
673672
- name: Download and install extensions
674-
if: ${{ ! matrix.slim }}
673+
if: ${{ ! matrix.slim && matrix.category != 'notests' }}
675674
run: |
676675
echo ""
677676
echo "Pyomo download-extensions"
@@ -695,7 +694,7 @@ jobs:
695694
pyomo help --writers || exit 1
696695
697696
- name: Run Pyomo tests
698-
if: matrix.mpi == 0
697+
if: ${{ matrix.mpi == 0 && matrix.category != 'notests' }}
699698
run: |
700699
export PATH=$PYOMO_PATH
701700
$PYTHON_EXE -m pytest -v \
@@ -704,7 +703,7 @@ jobs:
704703
`pwd`/examples `pwd`/doc --junitxml="TEST-pyomo.xml"
705704
706705
- name: Run Pyomo MPI tests
707-
if: matrix.mpi != 0
706+
if: ${{ matrix.mpi != 0 && matrix.category != 'notests' }}
708707
run: |
709708
# Manually invoke the DAT parser so that parse_table_datacmds.py
710709
# is fully generated by a single process before invoking MPI
@@ -716,8 +715,16 @@ jobs:
716715
-m "mpi" -W ignore::Warning \
717716
pyomo `pwd`/pyomo-model-libraries
718717
718+
- name: Build documentation
719+
if: matrix.build_docs != 0
720+
run: |
721+
sudo apt-get -y install graphviz latexmk texlive texlive-latex-extra \
722+
texlive-pictures
723+
make -C doc/OnlineDocs html
724+
make -C doc/OnlineDocs latexpdf
725+
719726
- name: Run documentation tests
720-
if: matrix.skip_doctest == 0
727+
if: matrix.test_docs != 0
721728
run: |
722729
make -C doc/OnlineDocs doctest -d
723730
@@ -929,5 +936,5 @@ jobs:
929936
files: coverage-other.xml
930937
token: ${{ secrets.PYOMO_CODECOV_TOKEN }}
931938
name: ${{ matrix.TARGET }}/other
932-
flags: ${{ matrix.TARGET }},other
939+
flags: ${{ matrix.TARGET }}_other
933940
fail_ci_if_error: true

.github/workflows/test_pr_and_main.yml

+25-13
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,24 @@ jobs:
7474

7575
include:
7676
- os: ubuntu-latest
77+
test_docs: 1
7778
TARGET: linux
7879
PYENV: pip
7980

8081
- os: macos-latest
82+
test_docs: 1
8183
TARGET: osx
8284
PYENV: pip
8385

8486
- os: windows-latest
87+
test_docs: 1
8588
TARGET: win
8689
PYENV: conda
8790
PACKAGES: glpk pytest-qt filelock
8891

8992
- os: ubuntu-latest
9093
python: 3.11
9194
other: /conda
92-
skip_doctest: 1
9395
TARGET: linux
9496
PYENV: conda
9597
PACKAGES: pytest-qt
@@ -98,7 +100,6 @@ jobs:
98100
python: '3.10'
99101
other: /mpi
100102
mpi: 3
101-
skip_doctest: 1
102103
TARGET: linux
103104
PYENV: conda
104105
PACKAGES: openmpi mpi4py
@@ -107,39 +108,34 @@ jobs:
107108
python: 3.12
108109
other: /cython
109110
setup_options: --with-cython
110-
skip_doctest: 1
111111
TARGET: linux
112112
PYENV: pip
113113
PACKAGES: cython
114114

115115
- os: windows-latest
116116
python: 3.9
117117
other: /pip
118-
skip_doctest: 1
119118
TARGET: win
120119
PYENV: pip
121120

122121
- os: ubuntu-latest
123122
python: 3.11
124123
other: /singletest
125124
category: "-m 'neos or importtest'"
126-
skip_doctest: 1
127125
TARGET: linux
128126
PYENV: pip
129127

130128
- os: ubuntu-latest
131129
python: 3.9
132130
other: /slim
133131
slim: 1
134-
skip_doctest: 1
135132
TARGET: linux
136133
PYENV: pip
137134

138135
- os: ubuntu-latest
139136
python: 3.12
140137
other: /numpy2
141138
slim: 1
142-
skip_doctest: 1
143139
TARGET: linux
144140
PYENV: pip
145141
PACKAGES: "gurobipy dill numpy>2.0 scipy networkx"
@@ -153,10 +149,18 @@ jobs:
153149

154150
- os: ubuntu-latest
155151
python: 'pypy-3.10'
156-
skip_doctest: 1
157152
TARGET: linux
158153
PYENV: pip
159154

155+
- os: ubuntu-latest
156+
python: 3.11
157+
other: /rtd
158+
category: notests
159+
build_docs: 1
160+
TARGET: linux
161+
PYENV: pip
162+
163+
160164
steps:
161165
- name: Checkout Pyomo source
162166
uses: actions/checkout@v4
@@ -703,7 +707,7 @@ jobs:
703707
> ${SITE_PACKAGES}/run_coverage_at_startup.pth
704708
705709
- name: Download and install extensions
706-
if: ${{ ! matrix.slim }}
710+
if: ${{ ! matrix.slim && matrix.category != 'notests' }}
707711
run: |
708712
echo ""
709713
echo "Pyomo download-extensions"
@@ -727,7 +731,7 @@ jobs:
727731
pyomo help --writers || exit 1
728732
729733
- name: Run Pyomo tests
730-
if: matrix.mpi == 0
734+
if: ${{ matrix.mpi == 0 && matrix.category != 'notests' }}
731735
run: |
732736
export PATH=$PYOMO_PATH
733737
$PYTHON_EXE -m pytest -v \
@@ -736,7 +740,7 @@ jobs:
736740
`pwd`/examples `pwd`/doc --junitxml="TEST-pyomo.xml"
737741
738742
- name: Run Pyomo MPI tests
739-
if: matrix.mpi != 0
743+
if: ${{ matrix.mpi != 0 && matrix.category != 'notests' }}
740744
run: |
741745
# Manually invoke the DAT parser so that parse_table_datacmds.py
742746
# is fully generated by a single process before invoking MPI
@@ -748,8 +752,16 @@ jobs:
748752
-m "mpi" -W ignore::Warning \
749753
pyomo `pwd`/pyomo-model-libraries
750754
755+
- name: Build documentation
756+
if: matrix.build_docs != 0
757+
run: |
758+
sudo apt-get -y install graphviz latexmk texlive texlive-latex-extra \
759+
texlive-pictures
760+
make -C doc/OnlineDocs html
761+
make -C doc/OnlineDocs latexpdf
762+
751763
- name: Run documentation tests
752-
if: matrix.skip_doctest == 0
764+
if: matrix.test_docs != 0
753765
run: |
754766
make -C doc/OnlineDocs doctest -d
755767
@@ -962,5 +974,5 @@ jobs:
962974
files: coverage-other.xml
963975
token: ${{ secrets.PYOMO_CODECOV_TOKEN }}
964976
name: ${{ matrix.TARGET }}/other
965-
flags: ${{ matrix.TARGET }},other
977+
flags: ${{ matrix.TARGET }}_other
966978
fail_ci_if_error: true

.jenkins.sh

+10-2
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,15 @@ if test -z "$MODE" -o "$MODE" == test; then
212212
PYOMO_SOURCE_SHA=$GIT_COMMIT
213213
fi
214214
if test -n "$CODECOV_TOKEN" -a -n "$PYOMO_SOURCE_SHA"; then
215-
CODECOV_JOB_NAME=$(echo ${JOB_NAME} \
216-
| sed -r 's/^(.*autotest_)?Pyomo_([^\/]+).*/\2/').$BUILD_NUMBER.$python
215+
_NAME=$(echo $JOB_NAME | sed -r 's/^(.*(autotest|Build)_)?([^\/]+).*/\3/')
216+
_MATRIX=$(echo $JOB_NAME | sed -r "s/,/\n/g" | grep -v host \
217+
| sed -r 's/.*=//' | tr '\n' , | sed -r 's/,+$//')
218+
CODECOV_JOB_NAME=${_NAME}/${_MATRIX}.${BUILD_NUMBER}
219+
CODECOV_FLAG=$(echo $JOB_NAME | sed -r "s/,/\n/g" | grep CATEGORY \
220+
| sed -r 's/.*=//')
221+
if test -z "$CODECOV_FLAG"; then
222+
CODECOV_FLAG=linux
223+
fi
217224
if test -z "$CODECOV_REPO_OWNER"; then
218225
if test -n "$PYOMO_SOURCE_REPO"; then
219226
CODECOV_REPO_OWNER=$(echo "$PYOMO_SOURCE_REPO" | cut -d '/' -f 4)
@@ -238,6 +245,7 @@ if test -z "$MODE" -o "$MODE" == test; then
238245
codecovcli -v upload-process --sha $PYOMO_SOURCE_SHA \
239246
--fail-on-error --git-service github --token $CODECOV_TOKEN \
240247
--slug pyomo/pyomo --file coverage.xml --disable-search \
248+
--flag $CODECOV_FLAG \
241249
--name $CODECOV_JOB_NAME \
242250
--branch $CODECOV_REPO_OWNER:$CODECOV_SOURCE_BRANCH \
243251
--env OS,python --network-root-folder `pwd` --plugin noop

.readthedocs.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ build:
99
os: ubuntu-22.04
1010
tools:
1111
python: "3.11"
12+
apt_packages:
13+
- graphviz
14+
- latexmk
15+
- texlive
16+
- texlive-latex-extra
17+
- texlive-pictures
18+
jobs:
19+
post_build:
20+
- |
21+
for pdf in $READTHEDOCS_OUTPUT/pdf/*.pdf; do
22+
if test [[ `basename $pdf` == graphviz* ]]; then
23+
rm -v $pdf;
24+
fi;
25+
done
1226
1327
sphinx:
1428
configuration: doc/OnlineDocs/conf.py

doc/OnlineDocs/Makefile

+6-1
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,15 @@ help:
2222

2323
clean:
2424
@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
25-
@echo "Removing *.spy, *.out"
25+
@echo "Removing *.spy"
2626
@find . -name \*.spy -delete
2727
@for D in $(BUILDDIR) $(SOURCEDIR)/$(APIDIR); do \
2828
if test -d "$$D"; then echo "Removing $$D"; rm -r "$$D"; fi \
2929
done
30+
@for D in ext src; do \
31+
if test -d "$$D/__pycache__"; then \
32+
echo "Removing $$D/__pycache__"; rm -r "$$D/__pycache__" ; \
33+
fi \
34+
done
3035

3136
rebuild: clean html

doc/OnlineDocs/code.rst

+7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
:orphan:
22

3+
This document is a reference containing all Pyomo module, class, and
4+
function documentation.
5+
36
.. autosummary::
47
:toctree: api
58
:caption: Library Reference
69
:template: recursive-module.rst
710
:recursive:
811

912
pyomo
13+
14+
15+
* :ref:`genindex`
16+
* :ref:`modindex`

0 commit comments

Comments
 (0)