From 9dbb38d1faa45c681e328a218bbe68306c1bdacf Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 12 Sep 2022 19:34:30 -0400 Subject: [PATCH] Backport PR #23868: Show errors and warnings in doc CI after build. --- .circleci/config.yml | 22 ++++++++++++++++++- .../pcolormesh_grids.py | 9 ++++---- .../pcolormesh_levels.py | 5 ++--- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d6da6baa1e97..27fa3de84243 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -141,7 +141,7 @@ commands: [ "$CIRCLE_PR_NUMBER" = "" ]; then export RELEASE_TAG='-t release' fi - make html O="-T $RELEASE_TAG -j4" + make html O="-T $RELEASE_TAG -j4 -w /tmp/sphinxerrorswarnings.log" rm -r build/html/_sources working_directory: doc - save_cache: @@ -149,6 +149,24 @@ commands: paths: - doc/build/doctrees + doc-show-errors-warnings: + steps: + - run: + name: Extract possible build errors and warnings + command: | + (grep "WARNING\|ERROR" /tmp/sphinxerrorswarnings.log || + echo "No errors or warnings") + + doc-show-deprecations: + steps: + - run: + name: Extract possible deprecation warnings in examples and tutorials + command: | + (grep DeprecationWarning -r -l doc/build/html/gallery || + echo "No deprecation warnings in gallery") + (grep DeprecationWarning -r -l doc/build/html/tutorials || + echo "No deprecation warnings in tutorials") + doc-bundle: steps: - run: @@ -186,6 +204,8 @@ jobs: - doc-deps-install - doc-build + - doc-show-errors-warnings + - doc-show-deprecations - doc-bundle diff --git a/examples/images_contours_and_fields/pcolormesh_grids.py b/examples/images_contours_and_fields/pcolormesh_grids.py index 3b628efe58bd..7fc75f8b6dd9 100644 --- a/examples/images_contours_and_fields/pcolormesh_grids.py +++ b/examples/images_contours_and_fields/pcolormesh_grids.py @@ -54,11 +54,10 @@ def _annotate(ax, x, y, title): # ----------------------------- # # Often, however, data is provided where *X* and *Y* match the shape of *Z*. -# While this makes sense for other ``shading`` types, it is no longer permitted -# when ``shading='flat'`` (and will raise a MatplotlibDeprecationWarning as of -# Matplotlib v3.3). Historically, Matplotlib silently dropped the last row and -# column of *Z* in this case, to match Matlab's behavior. If this behavior is -# still desired, simply drop the last row and column manually: +# While this makes sense for other ``shading`` types, it is not permitted +# when ``shading='flat'``. Historically, Matplotlib silently dropped the last +# row and column of *Z* in this case, to match Matlab's behavior. If this +# behavior is still desired, simply drop the last row and column manually: x = np.arange(ncols) # note *not* ncols + 1 as before y = np.arange(nrows) diff --git a/examples/images_contours_and_fields/pcolormesh_levels.py b/examples/images_contours_and_fields/pcolormesh_levels.py index d42643f15574..5821e4fbf41a 100644 --- a/examples/images_contours_and_fields/pcolormesh_levels.py +++ b/examples/images_contours_and_fields/pcolormesh_levels.py @@ -52,9 +52,8 @@ # Often a user wants to pass *X* and *Y* with the same sizes as *Z* to # `.axes.Axes.pcolormesh`. This is also allowed if ``shading='auto'`` is # passed (default set by :rc:`pcolor.shading`). Pre Matplotlib 3.3, -# ``shading='flat'`` would drop the last column and row of *Z*; while that -# is still allowed for back compatibility purposes, a DeprecationWarning is -# raised. If this is really what you want, then simply drop the last row and +# ``shading='flat'`` would drop the last column and row of *Z*, but now gives +# an error. If this is really what you want, then simply drop the last row and # column of Z manually: x = np.arange(10) # len = 10