From 5d0e19c85ec64c9fe65246f240d1e84c92a64bb7 Mon Sep 17 00:00:00 2001 From: Miranda Mundt Date: Wed, 26 Jun 2024 09:11:51 -0600 Subject: [PATCH 01/10] Update codecov yml to new version --- .codecov.yml => codecov.yml | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) rename .codecov.yml => codecov.yml (54%) diff --git a/.codecov.yml b/codecov.yml similarity index 54% rename from .codecov.yml rename to codecov.yml index 6b88f948fe1..1184eaf877d 100644 --- a/.codecov.yml +++ b/codecov.yml @@ -1,19 +1,21 @@ +codecov: + notify: + # GHA: 5, Jenkins: 11 + # Accurate as of Jun 26, 2024 + # Potential to change when Python versions change + after_n_builds: 16 + wait_for_ci: true coverage: - range: "50...100" + range: + - 50.0 + - 100.0 status: + patch: + default: + # Force patches to be covered at the level of the codebase + threshold: 0.0 project: default: # Allow overall coverage to drop to avoid failures due to code # cleanup or CI unavailability/lag - threshold: 5% - patch: - default: - # Force patches to be covered at the level of the codebase - threshold: 0% -# ci: -# - !ci.appveyor.com -codecov: - notify: - # GHA: 4, Jenkins: 8 - after_n_builds: 12 # all - wait_for_ci: yes + threshold: 5.0 From e15ec25c554fae58bf936c65cf01f8bf010b1861 Mon Sep 17 00:00:00 2001 From: Miranda Mundt Date: Wed, 26 Jun 2024 09:13:34 -0600 Subject: [PATCH 02/10] Unpinning 0.6.0 --- .github/workflows/test_branches.yml | 6 ------ .github/workflows/test_pr_and_main.yml | 6 ------ 2 files changed, 12 deletions(-) diff --git a/.github/workflows/test_branches.yml b/.github/workflows/test_branches.yml index 2689b97746b..8ba04eec466 100644 --- a/.github/workflows/test_branches.yml +++ b/.github/workflows/test_branches.yml @@ -855,9 +855,6 @@ jobs: token: ${{ secrets.PYOMO_CODECOV_TOKEN }} name: ${{ matrix.TARGET }} flags: ${{ matrix.TARGET }} - # downgrading after v0.7.0 broke tokenless upload - # see codecov/codecov-action#1487 - version: v0.6.0 fail_ci_if_error: true - name: Upload other coverage reports @@ -870,7 +867,4 @@ jobs: token: ${{ secrets.PYOMO_CODECOV_TOKEN }} name: ${{ matrix.TARGET }}/other flags: ${{ matrix.TARGET }},other - # downgrading after v0.7.0 broke tokenless upload - # see codecov/codecov-action#1487 - version: v0.6.0 fail_ci_if_error: true diff --git a/.github/workflows/test_pr_and_main.yml b/.github/workflows/test_pr_and_main.yml index c804372b18a..bdf1f7e1aa5 100644 --- a/.github/workflows/test_pr_and_main.yml +++ b/.github/workflows/test_pr_and_main.yml @@ -899,9 +899,6 @@ jobs: token: ${{ secrets.PYOMO_CODECOV_TOKEN }} name: ${{ matrix.TARGET }} flags: ${{ matrix.TARGET }} - # downgrading after v0.7.0 broke tokenless upload - # see codecov/codecov-action#1487 - version: v0.6.0 fail_ci_if_error: true - name: Upload other coverage reports @@ -914,7 +911,4 @@ jobs: token: ${{ secrets.PYOMO_CODECOV_TOKEN }} name: ${{ matrix.TARGET }}/other flags: ${{ matrix.TARGET }},other - # downgrading after v0.7.0 broke tokenless upload - # see codecov/codecov-action#1487 - version: v0.6.0 fail_ci_if_error: true From 34b131ebd905c62eb69544ad41af0e53030eacda Mon Sep 17 00:00:00 2001 From: Miranda Mundt <55767766+mrmundt@users.noreply.github.com> Date: Mon, 1 Jul 2024 14:29:01 -0600 Subject: [PATCH 03/10] Changing date to re-trigger all jobs from scratch --- codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codecov.yml b/codecov.yml index 1184eaf877d..5c2e8b4177d 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,7 +1,7 @@ codecov: notify: # GHA: 5, Jenkins: 11 - # Accurate as of Jun 26, 2024 + # Accurate as of July 1, 2024 # Potential to change when Python versions change after_n_builds: 16 wait_for_ci: true From 945082fde32a4e2fedd4f6e5870d85500a7e5ff4 Mon Sep 17 00:00:00 2001 From: Miranda Mundt Date: Wed, 3 Jul 2024 10:41:53 -0600 Subject: [PATCH 04/10] Enable codecovcli uploader in jenkins script --- .jenkins.sh | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.jenkins.sh b/.jenkins.sh index 696847fd92c..60ece9ca63d 100644 --- a/.jenkins.sh +++ b/.jenkins.sh @@ -20,8 +20,11 @@ # # CODECOV_TOKEN: the token to use when uploading results to codecov.io # -# CODECOV_ARGS: additional arguments to pass to the codecov uploader -# (e.g., to support SSL certificates) +# CODECOV_SOURCE_BRANCH: passed to the 'codecov-cli' command; branch of Pyomo +# (e.g., to enable correct codecov uploads) +# +# CODECOV_REPO_OWNER: passed to the 'codecov-cli' command; owner of repo +# (e.g., to enable correct codecov uploads) # # DISABLE_COVERAGE: if nonempty, then coverage analysis is disabled # @@ -208,16 +211,23 @@ if test -z "$MODE" -o "$MODE" == test; then coverage xml else CODECOV_JOB_NAME=`echo ${JOB_NAME} | sed -r 's/^(.*autotest_)?Pyomo_([^\/]+).*/\2/'`.$BUILD_NUMBER.$python + if test -z "$CODECOV_REPO_OWNER"; then + CODECOV_REPO_OWNER="pyomo" + fi + if test -z "CODECOV_SOURCE_BRANCH"; then + CODECOV_SOURCE_BRANCH="main" + fi i=0 while /bin/true; do i=$[$i+1] echo "Uploading coverage to codecov (attempt $i)" - codecov -X gcovcodecov -X gcov -X s3 --no-color \ - -t $CODECOV_TOKEN --root `pwd` -e OS,python \ - --name $CODECOV_JOB_NAME $CODECOV_ARGS \ - | tee .cover.upload - if test $? == 0 -a `grep -i error .cover.upload \ - | grep -v branch= | wc -l` -eq 0; then + codecovcli -v upload-process --sha $PYOMO_SOURCE_SHA \ + --fail-on-error --git-service github --token $CODECOV_TOKEN \ + --slug pyomo/pyomo --file coverage.xml --disable-search \ + --name $CODECOV_JOB_NAME \ + --branch $CODECOV_REPO_OWNER:$CODECOV_SOURCE_BRANCH \ + --env OS,python --network-root-folder `pwd` --plugin noop + if test $? == 0; then break elif test $i -ge 4; then exit 1 From 079b7bdc83df3b029b4c1d1eb707f9b569e0642d Mon Sep 17 00:00:00 2001 From: Miranda Mundt Date: Wed, 3 Jul 2024 15:53:38 -0600 Subject: [PATCH 05/10] Changing date to reset test suites --- codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codecov.yml b/codecov.yml index 5c2e8b4177d..318a907905f 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,7 +1,7 @@ codecov: notify: # GHA: 5, Jenkins: 11 - # Accurate as of July 1, 2024 + # Accurate as of July 3, 2024 # Potential to change when Python versions change after_n_builds: 16 wait_for_ci: true From 4f9acf0427f9715f21e5e678aa498a64d1e595e9 Mon Sep 17 00:00:00 2001 From: John Siirola Date: Sun, 7 Jul 2024 05:48:24 -0600 Subject: [PATCH 06/10] Explicitly create coverage.xml file --- .jenkins.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.jenkins.sh b/.jenkins.sh index 60ece9ca63d..51dd92ba123 100644 --- a/.jenkins.sh +++ b/.jenkins.sh @@ -205,11 +205,10 @@ if test -z "$MODE" -o "$MODE" == test; then # Note, that the PWD should still be $WORKSPACE/pyomo # coverage combine || exit 1 - coverage report -i + coverage report -i || exit 1 + coverage xml -i || exit 1 export OS=`uname` - if test -z "$CODECOV_TOKEN"; then - coverage xml - else + if test -n "$CODECOV_TOKEN"; then CODECOV_JOB_NAME=`echo ${JOB_NAME} | sed -r 's/^(.*autotest_)?Pyomo_([^\/]+).*/\2/'`.$BUILD_NUMBER.$python if test -z "$CODECOV_REPO_OWNER"; then CODECOV_REPO_OWNER="pyomo" From 2167033cbea0143aa3c31fce30a6fd731bc9de73 Mon Sep 17 00:00:00 2001 From: John Siirola Date: Sun, 7 Jul 2024 05:57:22 -0600 Subject: [PATCH 07/10] Fix spelling caught by new typos release --- .github/workflows/typos.toml | 2 ++ pyomo/common/config.py | 2 +- pyomo/common/tests/test_dependencies.py | 2 +- pyomo/core/base/set.py | 6 +++--- pyomo/core/plugins/transform/radix_linearization.py | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/typos.toml b/.github/workflows/typos.toml index 7a38164898b..e24957290a5 100644 --- a/.github/workflows/typos.toml +++ b/.github/workflows/typos.toml @@ -67,4 +67,6 @@ RO = "RO" EOF = "EOF" # Ignore lst as shorthand for list lst = "lst" +# Abbreviation of gamma (used in stochpdegas1_automatic.py) +gam = "gam" # AS NEEDED: Add More Words Below diff --git a/pyomo/common/config.py b/pyomo/common/config.py index f9c3a725bb8..ebba2f2732a 100644 --- a/pyomo/common/config.py +++ b/pyomo/common/config.py @@ -996,7 +996,7 @@ class will still create ``c`` instances that only have the single :py:meth:`generate_documentation()`. The simplest is :py:meth:`display()`, which prints out the current values of the configuration object (and if it is a container type, all of it's -children). :py:meth:`generate_yaml_template` is simular to +children). :py:meth:`generate_yaml_template` is similar to :py:meth:`display`, but also includes the description fields as formatted comments. diff --git a/pyomo/common/tests/test_dependencies.py b/pyomo/common/tests/test_dependencies.py index 31f9520b613..6aedc428244 100644 --- a/pyomo/common/tests/test_dependencies.py +++ b/pyomo/common/tests/test_dependencies.py @@ -209,7 +209,7 @@ def test_and_or(self): _and_or = avail0 & avail1 | avail2 self.assertTrue(_and_or) - # Verify operator prescedence + # Verify operator precedence _or_and = avail0 | avail2 & avail2 self.assertTrue(_or_and) _or_and = (avail0 | avail2) & avail2 diff --git a/pyomo/core/base/set.py b/pyomo/core/base/set.py index 8b7c2a246d6..c0d427747c5 100644 --- a/pyomo/core/base/set.py +++ b/pyomo/core/base/set.py @@ -1986,7 +1986,7 @@ class InsertionOrder(object): class SortedOrder(object): pass - _ValidOrderedAuguments = {True, False, InsertionOrder, SortedOrder} + _ValidOrderedArguments = {True, False, InsertionOrder, SortedOrder} _UnorderedInitializers = {set} @overload @@ -2015,7 +2015,7 @@ def __new__(cls, *args, **kwds): ordered = kwds.get('ordered', Set.InsertionOrder) if ordered is True: ordered = Set.InsertionOrder - if ordered not in Set._ValidOrderedAuguments: + if ordered not in Set._ValidOrderedArguments: if inspect.isfunction(ordered): ordered = Set.SortedOrder else: @@ -2032,7 +2032,7 @@ def __new__(cls, *args, **kwds): str(_) for _ in sorted_robust( 'Set.' + x.__name__ if isinstance(x, type) else x - for x in Set._ValidOrderedAuguments.union( + for x in Set._ValidOrderedArguments.union( {''} ) ) diff --git a/pyomo/core/plugins/transform/radix_linearization.py b/pyomo/core/plugins/transform/radix_linearization.py index 92270655f31..3cfde28db3c 100644 --- a/pyomo/core/plugins/transform/radix_linearization.py +++ b/pyomo/core/plugins/transform/radix_linearization.py @@ -280,7 +280,7 @@ def _collect_bilinear(self, expr, bilin, quad): if type(expr) is PowExpression and value(expr._args[1]) == 2: # Note: directly testing the value of the exponent above is # safe: we have already verified that this expression is - # polynominal, so the exponent must be constant. + # polynomial, so the exponent must be constant. tmp = ProductExpression() tmp._numerator = [expr._args[0], expr._args[0]] tmp._denominator = [] From fb60c7f0f627bc2c63574d8ea8d6419b127b7605 Mon Sep 17 00:00:00 2001 From: John Siirola Date: Sun, 7 Jul 2024 06:10:11 -0600 Subject: [PATCH 08/10] (temporarily) disable checking idaes.org URL --- .github/workflows/test_pr_and_main.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_pr_and_main.yml b/.github/workflows/test_pr_and_main.yml index bdf1f7e1aa5..c3634682462 100644 --- a/.github/workflows/test_pr_and_main.yml +++ b/.github/workflows/test_pr_and_main.yml @@ -68,9 +68,11 @@ jobs: verbose: true # How many times to retry a failed request (defaults to 1) retry_count: 3 - # Exclude Jenkins because it's behind a firewall; ignore RTD because - # a magically-generated string is triggering a failure - exclude_urls: https://pyomo-jenkins.sandia.gov/,https://pyomo.readthedocs.io/en/%s/errors.html + # Exclude: + # - Jenkins because it's behind a firewall + # - RTD because a magically-generated string triggers failures + # - IDAES.org because the webserver is currently down + exclude_urls: https://pyomo-jenkins.sandia.gov/,https://pyomo.readthedocs.io/en/%s/errors.html,https://idaes.org/ build: From 995209725dc31b462de174421f9c334f6cbe0157 Mon Sep 17 00:00:00 2001 From: John Siirola Date: Sun, 7 Jul 2024 06:13:16 -0600 Subject: [PATCH 09/10] (temporarily) disable checking idaes.org URL --- .github/workflows/test_pr_and_main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_pr_and_main.yml b/.github/workflows/test_pr_and_main.yml index c3634682462..0a2a4f51143 100644 --- a/.github/workflows/test_pr_and_main.yml +++ b/.github/workflows/test_pr_and_main.yml @@ -72,7 +72,7 @@ jobs: # - Jenkins because it's behind a firewall # - RTD because a magically-generated string triggers failures # - IDAES.org because the webserver is currently down - exclude_urls: https://pyomo-jenkins.sandia.gov/,https://pyomo.readthedocs.io/en/%s/errors.html,https://idaes.org/ + exclude_urls: https://pyomo-jenkins.sandia.gov/,https://pyomo.readthedocs.io/en/%s/errors.html,https://idaes.org build: From 9a2704b9df28af91b0d58ecab31125317920b8ba Mon Sep 17 00:00:00 2001 From: John Siirola Date: Sun, 7 Jul 2024 07:45:26 -0600 Subject: [PATCH 10/10] Remove idaes.org skip (site is back up) --- .github/workflows/test_pr_and_main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test_pr_and_main.yml b/.github/workflows/test_pr_and_main.yml index 0a2a4f51143..0bfd12b998d 100644 --- a/.github/workflows/test_pr_and_main.yml +++ b/.github/workflows/test_pr_and_main.yml @@ -71,8 +71,7 @@ jobs: # Exclude: # - Jenkins because it's behind a firewall # - RTD because a magically-generated string triggers failures - # - IDAES.org because the webserver is currently down - exclude_urls: https://pyomo-jenkins.sandia.gov/,https://pyomo.readthedocs.io/en/%s/errors.html,https://idaes.org + exclude_urls: https://pyomo-jenkins.sandia.gov/,https://pyomo.readthedocs.io/en/%s/errors.html build: