diff --git a/.circleci/config.yml b/.circleci/config.yml index ad663a7c5845..2f1a3e2339cf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -103,7 +103,15 @@ commands: steps: - run: name: Install Matplotlib - command: python -m pip install --user -ve . + command: | + if [[ "$CIRCLE_BRANCH" == v*-doc ]]; then + # The v*-doc branches must build against the specified release. + version=${CIRCLE_BRANCH%-doc} + version=${version#v} + python -m pip install matplotlib==${version} + else + python -m pip install --user -ve . + fi - save_cache: key: build-deps-1 paths: diff --git a/.github/workflows/clean_pr.yml b/.github/workflows/clean_pr.yml index fc2acc0b2e4c..f6c7e72e3fdc 100644 --- a/.github/workflows/clean_pr.yml +++ b/.github/workflows/clean_pr.yml @@ -20,3 +20,14 @@ jobs: exit 1 fi + - name: Check for invalid backports to -doc branches + if: endsWith(github.base_ref, '-doc') + run: | + git fetch --quiet origin "$GITHUB_BASE_REF" + base="$(git merge-base "origin/$GITHUB_BASE_REF" 'HEAD^2')" + lib="$(git log "$base..HEAD^2" --pretty=tformat: --name-status -- lib src | + cut --fields 2 | sort || true)" + if [[ -n "$lib" ]]; then + printf 'Changes to the following files have no effect and should not be backported:\n%s\n' "$lib" + exit 1 + fi diff --git a/lib/matplotlib/colors.py b/lib/matplotlib/colors.py index c171ff6b99b3..da9d8187d143 100644 --- a/lib/matplotlib/colors.py +++ b/lib/matplotlib/colors.py @@ -8,8 +8,8 @@ and for mapping numbers to colors in a 1-D array of colors called a colormap. Mapping data onto colors using a colormap typically involves two steps: a data -array is first mapped onto the range 0-1 using a subclass of `Normalize`, -then this number is mapped to a color using a subclass of `Colormap`. Two +array is first mapped onto the range 0-1 using a subclass of `Normalize`, then +this number is mapped to a color using a subclass of `Colormap`. Two subclasses of `Colormap` provided here: `LinearSegmentedColormap`, which uses piecewise-linear interpolation to define colormaps, and `ListedColormap`, which makes a colormap from a list of colors.