diff --git a/.appveyor.yml b/.appveyor.yml index 13705adc99f9..10109c9f80f7 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -28,17 +28,13 @@ environment: --cov-report= --cov=lib --log-level=DEBUG matrix: - - PYTHON_VERSION: "3.11" - TEST_ALL: "yes" + - PYTHON_VERSION: "3.12" # We always use a 64-bit machine, but can build x86 distributions # with the PYTHON_ARCH variable platform: - x64 -# all our python builds have to happen in tests_script... -build: false - cache: - '%LOCALAPPDATA%\pip\Cache' - '%USERPROFILE%\.cache\matplotlib' @@ -57,10 +53,18 @@ init: - micromamba info install: - - micromamba env create -f environment.yml python=%PYTHON_VERSION% pywin32 + - set EXTRA_PACKAGES=pywin32 codecov + # These are optional dependencies so that we don't skip so many tests... + - set EXTRA_PACKAGES=%EXTRA_PACKAGES% ffmpeg inkscape + # miktex is available on conda, but seems to fail with permission errors. + # missing packages on conda-forge for imagemagick + # This install sometimes failed randomly :-( + # - choco install imagemagick + + - micromamba env create -f environment.yml python=%PYTHON_VERSION% %EXTRA_PACKAGES% - micromamba activate mpl-dev -test_script: +build_script: # Now build the thing.. - set LINK=/LIBPATH:%cd%\lib - pip install -v --no-build-isolation --editable .[dev] @@ -68,13 +72,7 @@ test_script: - set "DUMPBIN=%VS140COMNTOOLS%\..\..\VC\bin\dumpbin.exe" - '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\ft2font*.pyd | findstr freetype.*.dll && exit /b 1 || exit /b 0' - # this are optional dependencies so that we don't skip so many tests... - - if x%TEST_ALL% == xyes micromamba install -q ffmpeg inkscape - # miktex is available on conda, but seems to fail with permission errors. - # missing packages on conda-forge for imagemagick - # This install sometimes failed randomly :-( - # - choco install imagemagick - +test_script: # Test import of tkagg backend - python -c "import matplotlib as m; m.use('tkagg'); @@ -90,7 +88,6 @@ artifacts: type: Zip on_finish: - - micromamba install codecov - codecov -e PYTHON_VERSION PLATFORM -n "%PYTHON_VERSION% Windows" on_failure: diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 000000000000..64263ec96b7b --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,36 @@ +--- +# clang-tidy configuration for matplotlib's src/ directory. +# +# Philosophy: enable checks that find real bugs (memory safety, undefined +# behaviour, security) and suppress checks that are high-noise style rules +# inappropriate for a C/C++ codebase that interfaces heavily with C APIs +# (CPython, FreeType, libagg) via pybind11. +# +# Run with: +# clang-tidy -p --config-file=src/.clang-tidy + +Checks: > + bugprone-*, + clang-analyzer-*, + objc-*, + performance-move-const-arg, + performance-move-constructor-init, + performance-no-automatic-move, + portability-*, + -bugprone-assignment-in-if-condition, + -bugprone-easily-swappable-parameters, + -bugprone-implicit-widening-of-multiplication-result, + -bugprone-macro-parentheses, + -bugprone-narrowing-conversions, + -bugprone-reserved-identifier, + -bugprone-throwing-static-initialization, + -clang-analyzer-optin.cplusplus.UninitializedObject, + -clang-analyzer-optin.performance.Padding, + +# Only report findings in matplotlib's own src/ headers, not in pybind11, +# Python.h, agg, or other vendored includes. +HeaderFilterRegex: '.*/matplotlib/src/.*' + +WarningsAsErrors: '' + +CheckOptions: [] diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index e66cac52f9c9..bc11ed56927a 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,39 +1,21 @@ - + + + ## PR summary - + -- Why is this change necessary? -- What problem does it solve? -- What is the reasoning for this implementation? - -Additionally, please summarize the changes in the title, for example "Raise ValueError on -non-numeric input to set_xlim" and avoid non-descriptive titles such as "Addresses -issue #8576". - -If possible, please provide a minimum self-contained example. ---> ## AI Disclosure - + -## PR checklist - -- [ ] "closes #0000" is in the body of the PR description to [link the related issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) -- [ ] new and changed code is [tested](https://matplotlib.org/devdocs/devel/testing.html) -- [ ] *Plotting related* features are demonstrated in an [example](https://matplotlib.org/devdocs/devel/document.html#write-examples-and-tutorials) -- [ ] *New Features* and *API Changes* are noted with a [directive and release note](https://matplotlib.org/devdocs/devel/api_changes.html#announce-changes-deprecations-and-new-features) -- [ ] Documentation complies with [general](https://matplotlib.org/devdocs/devel/document.html#write-rest-pages) and [docstring](https://matplotlib.org/devdocs/devel/document.html#write-docstrings) guidelines +## PR quality check + - +- [ ] Use an expressive title, e.g. "Fix title font property precedence" +- [ ] New and changed code is [tested](https://matplotlib.org/devdocs/devel/testing.html) +- [ ] Plotting related features are demonstrated in an [example](https://matplotlib.org/devdocs/devel/document.html#write-examples-and-tutorials) +- [ ] New features and API changes have [release notes](https://matplotlib.org/devdocs/devel/api_changes.html#announce-changes-deprecations-and-new-features) +- [ ] Documentation complies with [general](https://matplotlib.org/devdocs/devel/document.html#write-rest-pages) and [docstring](https://matplotlib.org/devdocs/devel/document.html#write-docstrings) guidelines diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d391ab4a18eb..0a6d627d8bb1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,17 +5,33 @@ updates: directory: "/" schedule: interval: "weekly" + cooldown: + default-days: 7 groups: actions: patterns: - "*" + labels: + - "PR: dependencies" - package-ecosystem: "pip" directory: "/" schedule: interval: "weekly" + cooldown: + default-days: 7 exclude-paths: - "ci/minver-requirements.txt" + labels: + - "PR: dependencies" - package-ecosystem: "pre-commit" directory: "/" schedule: interval: "monthly" + cooldown: + default-days: 7 + groups: + pre-commit: + patterns: + - "*" + labels: + - "PR: dependencies" diff --git a/.github/labeler.yml b/.github/labeler.yml index 77b79146b47f..ee49868c8d7f 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -4,6 +4,7 @@ - any-glob-to-any-file: - '.github/workflows/cibuildwheel.yml' - '.github/workflows/wasm.yml' + - 'pyproject.toml' "CI: Run cygwin": - changed-files: - any-glob-to-any-file: ['.github/workflows/cygwin.yml'] diff --git a/.github/workflows/autoclose_schedule.yml b/.github/workflows/autoclose_schedule.yml index 7e0fbd2055e9..f09a1ff42fb1 100644 --- a/.github/workflows/autoclose_schedule.yml +++ b/.github/workflows/autoclose_schedule.yml @@ -22,16 +22,15 @@ jobs: name: autoclose labeled PRs runs-on: ubuntu-latest steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: '3.13' - name: Install PyGithub run: pip install -Uq PyGithub - - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Close PRs labeled more than 14 days ago run: | python tools/autoclose_prs.py diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 2bb7f9544902..96e306c20d10 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -42,15 +42,15 @@ jobs: SDIST_NAME: ${{ steps.sdist.outputs.SDIST_NAME }} steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 persist-credentials: false - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 name: Install Python with: - python-version: '3.11' + python-version: '3.12' # Something changed somewhere that prevents the downloaded-at-build-time # licenses from being included in built wheels, so pre-download them so @@ -97,31 +97,6 @@ jobs: permissions: contents: read runs-on: ${{ matrix.os }} - env: - CIBW_BEFORE_BUILD: >- - rm -rf {package}/build - CIBW_BEFORE_BUILD_WINDOWS: >- - pip install delvewheel && - rm -rf {package}/build - CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >- - delvewheel repair -w {dest_dir} {wheel} - CIBW_AFTER_BUILD: >- - twine check {wheel} && - python {package}/ci/check_wheel_licenses.py {wheel} - # On Windows, we explicitly request MSVC compilers (as GitHub Action runners have - # MinGW on PATH that would be picked otherwise), switch to a static build for - # runtimes, but use dynamic linking for `VCRUNTIME140.dll`, `VCRUNTIME140_1.dll`, - # and the UCRT. This avoids requiring specific versions of `MSVCP140.dll`, while - # keeping shared state with the rest of the Python process/extensions. - CIBW_CONFIG_SETTINGS_WINDOWS: >- - setup-args="--vsenv" - setup-args="-Db_vscrt=mt" - setup-args="-Dcpp_link_args=['ucrt.lib','vcruntime.lib','/nodefaultlib:libucrt.lib','/nodefaultlib:libvcruntime.lib']" - CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 - CIBW_SKIP: "*-musllinux_aarch64" - CIBW_TEST_COMMAND: >- - python {package}/ci/check_version_number.py - MACOSX_DEPLOYMENT_TARGET: "10.12" strategy: matrix: include: @@ -150,50 +125,29 @@ jobs: run: Remove-Item -Recurse C:\Strawberry - name: Build wheels for CPython 3.14 - uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1 + uses: pypa/cibuildwheel@4726cd35bb13f7bde50cf2761f2499ac7b3aa32c # v4.1.1 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: CIBW_BUILD: "cp314-* cp314t-*" - CIBW_ENABLE: "cpython-freethreading cpython-prerelease" CIBW_ARCHS: ${{ matrix.cibw_archs }} - CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 - name: Build wheels for CPython 3.13 - uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1 + uses: pypa/cibuildwheel@4726cd35bb13f7bde50cf2761f2499ac7b3aa32c # v4.1.1 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: - CIBW_BUILD: "cp313-* cp313t-*" - CIBW_ENABLE: cpython-freethreading + CIBW_BUILD: "cp313-*" CIBW_ARCHS: ${{ matrix.cibw_archs }} - name: Build wheels for CPython 3.12 - uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1 + uses: pypa/cibuildwheel@4726cd35bb13f7bde50cf2761f2499ac7b3aa32c # v4.1.1 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: CIBW_BUILD: "cp312-*" CIBW_ARCHS: ${{ matrix.cibw_archs }} - - name: Build wheels for CPython 3.11 - uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1 - with: - package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} - env: - CIBW_BUILD: "cp311-*" - CIBW_ARCHS: ${{ matrix.cibw_archs }} - - - name: Build wheels for PyPy - uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1 - with: - package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} - env: - CIBW_BUILD: "pp311-*" - CIBW_ARCHS: ${{ matrix.cibw_archs }} - CIBW_ENABLE: pypy - if: matrix.cibw_archs != 'aarch64' && matrix.os != 'windows-latest' && matrix.os != 'windows-11-arm' - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: cibw-wheels-${{ runner.os }}-${{ matrix.cibw_archs }} diff --git a/.github/workflows/circleci.yml b/.github/workflows/circleci.yml index 49dc4ea3b3ec..1796be0d03bf 100644 --- a/.github/workflows/circleci.yml +++ b/.github/workflows/circleci.yml @@ -31,7 +31,7 @@ jobs: runs-on: ubuntu-latest name: Post warnings/errors as review steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false diff --git a/.github/workflows/clean_pr.yml b/.github/workflows/clean_pr.yml index 75f6a451c7ee..07fbecf0df5e 100644 --- a/.github/workflows/clean_pr.yml +++ b/.github/workflows/clean_pr.yml @@ -11,7 +11,7 @@ jobs: contents: read steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: '0' persist-credentials: false diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 9a7b40ccac10..d07566f963f7 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -29,12 +29,12 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2 + uses: github/codeql-action/init@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 with: languages: ${{ matrix.language }} @@ -45,4 +45,4 @@ jobs: pip install --user -v . - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2 + uses: github/codeql-action/analyze@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 diff --git a/.github/workflows/conflictcheck.yml b/.github/workflows/conflictcheck.yml index 2058da8ca9fb..e353e47bfb79 100644 --- a/.github/workflows/conflictcheck.yml +++ b/.github/workflows/conflictcheck.yml @@ -19,7 +19,7 @@ jobs: pull-requests: write steps: - name: Check if PRs have merge conflicts - uses: eps1lon/actions-label-merge-conflict@1df065ebe6e3310545d4f4c4e862e43bdca146f0 # v3.0.3 + uses: eps1lon/actions-label-merge-conflict@0273be72a0bbd58fcd71d0d6c02c209b50d1e5e1 # v3.1.0 with: dirtyLabel: "status: needs rebase" repoToken: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml index 4b790ea52a7d..1a4082636da9 100644 --- a/.github/workflows/cygwin.yml +++ b/.github/workflows/cygwin.yml @@ -80,12 +80,12 @@ jobs: - name: Fix line endings run: git config --global core.autocrlf input - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 persist-credentials: false - - uses: cygwin/cygwin-install-action@711d29f3da23c9f4a1798e369a6f01198c13b11a # v6 + - uses: cygwin/cygwin-install-action@3f0a3f9f988f7e96b8c18098ae05eaec175f5b52 # v6 with: packages: >- ccache gcc-g++ gdb git graphviz libcairo-devel libffi-devel @@ -141,21 +141,21 @@ jobs: # FreeType build fails with bash, succeeds with dash - name: Cache pip - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: C:\cygwin\home\runneradmin\.cache\pip key: Cygwin-py3.${{ matrix.python-minor-version }}-pip-${{ hashFiles('pyproject.toml') }} restore-keys: ${{ matrix.os }}-py3.${{ matrix.python-minor-version }}-pip- - name: Cache ccache - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: C:\cygwin\home\runneradmin\.ccache key: Cygwin-py3.${{ matrix.python-minor-version }}-ccache-${{ hashFiles('src/*') }} restore-keys: Cygwin-py3.${{ matrix.python-minor-version }}-ccache- - name: Cache Matplotlib - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: | C:\cygwin\home\runneradmin\.cache\matplotlib @@ -186,10 +186,6 @@ jobs: python -c 'import PyQt5.QtCore' && echo 'PyQt5 is available' || echo 'PyQt5 is not available' - python -mpip install --upgrade pyside2 && - python -c 'import PySide2.QtCore' && - echo 'PySide2 is available' || - echo 'PySide2 is not available' python -m pip uninstall --yes wxpython || echo 'wxPython already uninstalled' - name: Install Matplotlib diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 2914c64a8461..e3d04a05d78d 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -12,6 +12,6 @@ jobs: pull-requests: write runs-on: ubuntu-latest steps: - - uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6.0.1 + - uses: actions/labeler@bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13 # v7.0.0 with: sync-labels: true diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index f6af70b8b233..848968464c8e 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -11,16 +11,17 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 persist-credentials: false - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + - uses: j178/prek-action@5337cb91e0fa35a7ff31b9ca345126d8bbbcdf16 # v2.0.6 with: - python-version: "3.x" - - uses: j178/prek-action@cbc2f23eb5539cf20d82d1aabd0d0ecbcc56f4e3 # v2.0.2 + extra-args: --hook-stage manual --all-files --skip oxipng + # Only run oxipng on the last diff, because we haven't updated all images. + - uses: j178/prek-action@bdca6f102f98e2b4c7029491a53dfd366469e33d # v2.0.4 with: - extra-args: --hook-stage manual --all-files + extra-args: --hook-stage manual --from-ref origin/${{ github.base_ref }} oxipng ruff: name: ruff @@ -29,14 +30,14 @@ jobs: contents: read checks: write steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Set up Python 3 - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: - python-version: '3.11' + python-version: '3.12' - name: Install ruff run: pip3 install ruff @@ -59,14 +60,14 @@ jobs: contents: read checks: write steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Set up Python 3 - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: - python-version: '3.11' + python-version: '3.12' - name: Install mypy run: pip3 install --group build --group typing @@ -84,6 +85,37 @@ jobs: -tee -reporter=github-check -filter-mode nofilter + clang-tidy: + name: clang-tidy (macOS / Objective-C) + runs-on: macos-latest # run on macOS so we can lint the objectiveC file + permissions: + contents: read + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Set up Python 3 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + with: + python-version: '3.14' + + - name: Install OS dependencies + run: brew install llvm + + - name: Install build dependencies + run: pip3 install meson ninja pybind11 setuptools-scm + + - name: Run clang-tidy + run: | + set -o pipefail + LLVM_PREFIX=$(brew --prefix llvm) + export CC=$LLVM_PREFIX/bin/clang + export CXX=$LLVM_PREFIX/bin/clang++ + export OBJC=$LLVM_PREFIX/bin/clang + export PATH=$LLVM_PREFIX/bin:$PATH + python tools/run_clang_tidy.py + eslint: name: eslint runs-on: ubuntu-latest @@ -91,7 +123,7 @@ jobs: contents: read checks: write steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false @@ -102,3 +134,4 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} reporter: github-check workdir: 'lib/matplotlib/backends/web_backend/' + fail_level: error diff --git a/.github/workflows/mypy-stubtest.yml b/.github/workflows/mypy-stubtest.yml index 81fcd48462e8..8971bf82ad7e 100644 --- a/.github/workflows/mypy-stubtest.yml +++ b/.github/workflows/mypy-stubtest.yml @@ -12,14 +12,14 @@ jobs: contents: read checks: write steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Set up Python 3 - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: - python-version: '3.11' + python-version: '3.12' - name: Set up reviewdog uses: reviewdog/action-setup@d8a7baabd7f3e8544ee4dbde3ee41d0011c3a93f # v1.5.0 @@ -33,7 +33,7 @@ jobs: run: | set -o pipefail tox -e stubtest | \ - sed -e "s!.tox/stubtest/lib/python3.11/site-packages!lib!g" | \ + sed -e "s!.tox/stubtest/lib/python3.12/site-packages!lib!g" | \ reviewdog \ -efm '%Eerror: %m' \ -efm '%CStub: in file %f:%l' \ diff --git a/.github/workflows/pr_welcome.yml b/.github/workflows/pr_welcome.yml index 48691e61d87b..f8b004dc5468 100644 --- a/.github/workflows/pr_welcome.yml +++ b/.github/workflows/pr_welcome.yml @@ -16,9 +16,10 @@ jobs: issues: write pull-requests: write steps: - - uses: plbstl/first-contribution@7c31f41b0e7a70adfcae06cf964679f61af6780b # v4.3.0 + - uses: plbstl/first-contribution@2c36bdb58684587f60549a69aaa3ec00b9d5f4fe # v4.3.3 with: labels: first-contribution + skip-internal-contributors: false pr-opened-msg: >+ Thank you for opening your first PR into Matplotlib! diff --git a/.github/workflows/stale-tidy.yml b/.github/workflows/stale-tidy.yml index feb1fe701d70..c4e8ab51398f 100644 --- a/.github/workflows/stale-tidy.yml +++ b/.github/workflows/stale-tidy.yml @@ -13,7 +13,7 @@ jobs: permissions: issues: write steps: - - uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0 + - uses: actions/stale@1e223db275d687790206a7acac4d1a11bd6fe629 # v10.4.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} operations-per-run: 300 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 63f1a1ce3b05..87e293636564 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -14,7 +14,7 @@ jobs: issues: write pull-requests: write steps: - - uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0 + - uses: actions/stale@1e223db275d687790206a7acac4d1a11bd6fe629 # v10.4.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} operations-per-run: 20 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a3a9def4bd40..bf75c80ddae0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,13 +51,13 @@ jobs: include: - name-suffix: "(Minimum Versions)" os: ubuntu-22.04 - python-version: '3.11' + python-version: '3.12' extra-requirements: '-c ci/minver-requirements.txt' delete-font-cache: true # https://github.com/matplotlib/matplotlib/issues/29844 pygobject-ver: '<3.52.0' - os: ubuntu-22.04 - python-version: '3.11' + python-version: '3.12' CFLAGS: "-fno-lto" # Ensure that disabling LTO works. extra-requirements: '--group test-extra' # https://github.com/matplotlib/matplotlib/issues/29844 @@ -70,19 +70,13 @@ jobs: pygobject-ver: '<3.52.0' - name-suffix: "Free-threaded" os: ubuntu-22.04 - python-version: '3.13t' + python-version: '3.14t' # https://github.com/matplotlib/matplotlib/issues/29844 pygobject-ver: '<3.52.0' - - os: ubuntu-24.04 - python-version: '3.12' - os: ubuntu-24.04 python-version: '3.14' - os: ubuntu-24.04-arm python-version: '3.12' - - os: macos-14 # This runner is on M1 (arm64) chips. - python-version: '3.11' - # https://github.com/matplotlib/matplotlib/issues/29732 - pygobject-ver: '<3.52.0' - os: macos-14 # This runner is on M1 (arm64) chips. python-version: '3.12' # https://github.com/matplotlib/matplotlib/issues/29732 @@ -97,13 +91,13 @@ jobs: pygobject-ver: '<3.52.0' steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 persist-credentials: false - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ matrix.python-version }} allow-prereleases: true @@ -186,7 +180,7 @@ jobs: esac - name: Cache pip - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 if: startsWith(runner.os, 'Linux') with: path: ~/.cache/pip @@ -196,7 +190,7 @@ jobs: restore-keys: | ${{ matrix.os }}-py${{ matrix.python-version }}-pip- - name: Cache pip - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 if: startsWith(runner.os, 'macOS') with: path: ~/Library/Caches/pip @@ -204,7 +198,7 @@ jobs: restore-keys: | ${{ matrix.os }}-py${{ matrix.python-version }}-pip- - name: Cache ccache - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: | ~/.ccache @@ -212,7 +206,7 @@ jobs: restore-keys: | ${{ matrix.os }}-py${{ matrix.python-version }}-ccache- - name: Cache Matplotlib - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: | ~/.cache/matplotlib @@ -244,7 +238,7 @@ jobs: # Sphinx is needed to run sphinxext tests python -m pip install --upgrade sphinx!=6.1.2 - if [[ "${{ matrix.python-version }}" != '3.13t' ]]; then + if [[ "${{ matrix.python-version }}" != '3.14t' ]]; then # GUI toolkits are pip-installable only for some versions of Python # so don't fail if we can't install them. Make it easier to check # whether the install was successful by trying to import the toolkit @@ -267,16 +261,6 @@ jobs: echo 'PyQt5 is available' || echo 'PyQt5 is not available' fi - # Even though PySide2 wheels can be installed on Python 3.12+, they are broken and since PySide2 is - # deprecated, they are unlikely to be fixed. For the same deprecation reason, there are no wheels - # on M1 macOS, so don't bother there either. - if [[ "${{ matrix.os }}" != 'macos-14' && "${{ matrix.python-version }}" == '3.11' - ]]; then - python -mpip install --upgrade pyside2 && - python -c 'import PySide2.QtCore' && - echo 'PySide2 is available' || - echo 'PySide2 is not available' - fi python -mpip install --upgrade --only-binary :all: pyqt6 && python -c 'import PyQt6.QtCore' && echo 'PyQt6 is available' || @@ -293,7 +277,7 @@ jobs: echo 'wxPython is available' || echo 'wxPython is not available' - fi # Skip backends on Python 3.13t. + fi # Skip backends on Python 3.14t. - name: Install the nightly dependencies # Only install the nightly dependencies during the scheduled event @@ -333,7 +317,7 @@ jobs: - name: Run pytest run: | - if [[ "${{ matrix.python-version }}" == '3.13t' ]]; then + if [[ "${{ matrix.python-version }}" == '3.14t' ]]; then export PYTHON_GIL=0 fi pytest -rfEsXR -n auto \ @@ -396,7 +380,7 @@ jobs: fi - name: Upload code coverage if: ${{ !cancelled() && github.event_name != 'schedule' }} - uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0 + uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 with: name: "${{ matrix.python-version }} ${{ matrix.os }} ${{ matrix.name-suffix }}" token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index e1668d99af60..14c1684dd345 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -39,20 +39,14 @@ jobs: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 persist-credentials: false - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - name: Install Python - with: - python-version: '3.13' - - name: Build wheels for wasm - uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1 + uses: pypa/cibuildwheel@4726cd35bb13f7bde50cf2761f2499ac7b3aa32c # v4.1.1 env: - CIBW_BUILD: "cp312-*" CIBW_PLATFORM: "pyodide" CIBW_TEST_COMMAND: "true" diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml new file mode 100644 index 000000000000..e66b441b8e43 --- /dev/null +++ b/.github/workflows/zizmor.yml @@ -0,0 +1,30 @@ +--- +name: zizmor + +on: + push: + branches: [main, v*.x] + pull_request: + branches: [main] + schedule: + - cron: '45 19 * * 1' + +permissions: {} + +jobs: + zizmor: + name: zizmor + if: github.repository == 'matplotlib/matplotlib' + runs-on: ubuntu-latest + permissions: + security-events: write + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Run zizmor + uses: zizmorcore/zizmor-action@6fc4b006235f201fdab3722e17240ab420d580e5 # v0.6.1 diff --git a/.github/zizmor.yml b/.github/zizmor.yml new file mode 100644 index 000000000000..ce9c30c01dbd --- /dev/null +++ b/.github/zizmor.yml @@ -0,0 +1,19 @@ +--- +rules: + dangerous-triggers: + ignore: + # These workflows use pull_request_target solely to obtain write access + # for API operations (labeling, commenting) on fork PRs. None of them + # check out or execute any PR-supplied code. + - autoclose_comment.yml:11 + - conflictcheck.yml:3 + - labeler.yml:3 + - pr_welcome.yml:4 + cache-poisoning: + ignore: + # cygwin.yml is a test-only workflow; no artifacts are published. + # This is triggering a low-confidence flag that the workflow_dispatch: + # trigger may imply artifact publishing + - cygwin.yml:144:9 + - cygwin.yml:151:9 + - cygwin.yml:158:9 diff --git a/.mailmap b/.mailmap index bbadcb8ff879..ad81a9f91430 100644 --- a/.mailmap +++ b/.mailmap @@ -1,8 +1,22 @@ +34j <34j.github@proton.me> <55338215+34j@users.noreply.github.com> + +Aasma Gupta AASMA GUPTA + +Adam Ormondroyd +Adam Ormondroyd <52655393+AdamOrmondroyd@users.noreply.github.com> + Adam Ortiz +Aditi Gautam <72432016+agautam478@users.noreply.github.com> + +Aditya Singh +Aditya Singh + Adrien F. Vincent Adrien F. Vincent +ALBIN BABU VARGHESE + Aleksey Bilogur Alexander Rudy @@ -11,14 +25,35 @@ Alon Hershenhorn Alvaro Sanchez +Aman Kushwaha + +Amisha Mehta +Amisha Mehta <115501608+amishamehta99@users.noreply.github.com> + +Ananya Devarakonda +Ananya Devarakonda <57040724+ananya314@users.noreply.github.com> + Andreas C Mueller Andreas Mueller +Andrés Gutierrez <12andresgutierrez04@gmail.com> + Andrew Dawson +Andrew Fennell + +Andrew Kim <110536383+aseriesof-tubes@users.noreply.github.com> dohyun + +Anna Mastori <72812754+AnnaMastori@users.noreply.github.com> + +Anton <138380708+r3kste@users.noreply.github.com> + anykraus Ariel Hernán Curiale +Atharva Kulkarni Atharva2012 +Atharva Kulkarni <103631956+Atharva2012@users.noreply.github.com> + Ben Cohen Ben Root Benjamin Root @@ -28,20 +63,36 @@ Benedikt Daurer Benjamin Congdon Benjamin Congdon bcongdon +Brandon Dusch + +Brian Lau +Brian Lau <103338659+beelauuu@users.noreply.github.com> + Bruno Zohreh Carsten Schelp Casper van der Wel +Chahak Mehta Chahak Mehta <201501422@daiict.ac.in> + +Chaoyi Hu <90495101+chaoyihu@users.noreply.github.com> + +Charisma Kausar <68203159+ckcherry23@users.noreply.github.com> + CharlesHe16 -Chris Holdgraf +Chirag Sharma +Chirag Sharma <160767827+Chirag3841@users.noreply.github.com> Cho Yin Yong Chris +Chris Holdgraf + +Christine P. Chai + Christoph Gohlke cgohlke Christoph Gohlke C. Gohlke Christoph Gohlke @@ -50,15 +101,29 @@ Cimarron Mittelsteadt Cimarron cldssty +Constantinos Menelaou +Constantinos Menelaou <91343054+konmenel@users.noreply.github.com> + Conner R. Phillips +Dale Dai +Dale Dai <145884899+CouldNot@users.noreply.github.com> + Dan Hickstein Daniel Hyams Daniel Hyams Daniel Hyams +Daniel Weiss +Daniel Weiss <32396142+dkweiss31@users.noreply.github.com> + David Kua +David Matos +David Matos + +DerWeh + Devashish Deshpande Diego Leal Petrola @@ -78,6 +143,9 @@ Eric Ma esvhd +Eva Sibinga +Eva Sibinga <46283995+esibinga@users.noreply.github.com> + Filipe Fernandes Florian Le Bourdais @@ -86,6 +154,11 @@ Francesco Montesano montefra +G Karthik Koundinya +G Karthik Koundinya <144328549+G26karthik@users.noreply.github.com> + +Greg Lucas + Hajoon Choi hannah @@ -94,14 +167,23 @@ Hannes Breytenbach Hans Moritz Günther +Haoying Zhang +Haoying Zhang <38875181+stevezhang1999@users.noreply.github.com> +Haoying Zhang stevezhang + Harshal Prakash Patankar Harshit Patni Harutaka Kawamura +Hasan Rashid + Hood Chatham Hood +Husain Gadiwala +Husain Gadiwala <69296939+alphanoobie@users.noreply.github.com> + Ian Hunt-Isaak ImportanceOfBeingErnest @@ -119,10 +201,14 @@ Jake Vanderplas Jake Vanderplas Jake Vanderplas +Jacob Stevens-Haas <37048747+Jacob-Stevens-Haas@users.noreply.github.com> + James R. Evans Jan-Hendrik Müller <44469195+kolibril13@users.noreply.github.com> +jaya prajapati + Jeff Lutgen Jeffrey Bingham @@ -132,6 +218,8 @@ Jens Hedegaard Nielsen Jerome F. Villegas +JOD + Joel Frederico <458871+joelfrederico@users.noreply.github.com> Johan von Forstner @@ -147,13 +235,20 @@ Joseph Fox-Rabinovitz Joseph Fox-Rabinovitz +Juanita Gomez + Julien Lhermitte Julien Schueller Julien Schueller +Kaustubh Desale +Kaustubh Desale <97254178+Kaustbh@users.noreply.github.com> + Kevin Davies +Khushikela29 <121342846+Khushikela29@users.noreply.github.com> + kikocorreoso Klara Gerlei @@ -163,6 +258,8 @@ Kristen M. Thyng Kyle Sunden +Kyra Cho + Leeonadoh Lennart Fricke @@ -173,6 +270,13 @@ Leon Yin Lion Krischer +Logan Pageler +Logan Pageler <48865621+Logan-Pageler@users.noreply.github.com> + +Lukas Hergt + +Lumberbot (aka Jack) <39504233+meeseeksmachine@users.noreply.github.com> + luz paz Manan Kevadiya @@ -187,13 +291,22 @@ Marco Gorelli <33491632+MarcoGorelli@users.noreply.githu Marek Rudnicki +Marten Henric van Kerkwijk + Martin Fitzpatrick +Marvin +Marvin <101656586+Marvvxi@users.noreply.github.com> + +Mathias Hauser + Matt Newville Matthew Emmett Matthew Emmett +Matthew Morrison <120498834+mattymo30@users.noreply.github.com> + Matthias Bussonnier Matthias Bussonnier @@ -202,6 +315,9 @@ Matthias Lüthi Matti Picus +Melissa Weber Mendonça +Melissa Weber Mendonça + Michael Droettboom Michael Droettboom Michael Droettboom @@ -211,9 +327,14 @@ Michiel de Hoon Michiel de Hoon Michiel de Hoon Michiel de Hoon Michiel de Hoon +Milan Gittler +Milan Gittler <55838375+Cemonix@users.noreply.github.com> + MinRK MinRK Min RK +Miriam Simone + Nelle Varoquaux Nic Eggert Nic Eggert @@ -221,8 +342,12 @@ Nic Eggert Nic Eggert Nicolas P. Rougier +N R Navaneet <156576749+nrnavaneet@users.noreply.github.com> + OceanWolf +odile OdileVidrine <65249488+OdileVidrine@users.noreply.github.com> + Olivier Castany <1868182+ocastany@users.noreply.github.com> Olivier Castany <1868182+ocastany@users.noreply.github.com> Olivier Castany <1868182+ocastany@users.noreply.github.com> @@ -241,6 +366,10 @@ Paul Ivanov Paul Ivanov Paul Ivanov +Pedro Marques + +Pedro Peçanha <60028123+pedrompecanha@users.noreply.github.com> + Per Parker Péter Leéh @@ -254,10 +383,32 @@ Phil Elson Philipp Nagel +Pirzada Ahmad Faraz +Pirzada Ahmad Faraz <136244856+pirzada-ahmadfaraz@users.noreply.github.com> + +photoniker <17592823+photoniker@users.noreply.github.com> + +Pranav Raghu +Pranav Raghu <73378019+Impaler343@users.noreply.github.com> + productivememberofsociety666 none +Quentin Peter + +Rahul Monani + +Raphael Quast + +Ratnabali Dutta + +Richard Penney + Rishikesh +Roman <121314722+GameRoMan@users.noreply.github.com> + +Ruth Comer <10599679+rcomer@users.noreply.github.com> + Ruth Nainggolan Ruth G. N <32371319+ruthgn@users.noreply.github.com> RyanPan @@ -267,13 +418,22 @@ Richard Sheridan Samesh Lakhotia Samesh Lakhotia <43701530+sameshl@users.noreply.github.com> ' +Saumya Agrawal <145997182+saumyacoder1709@users.noreply.github.com> Saumya + Scott Lasley +Scott Shambaugh <14363975+scottshambaugh@users.noreply.github.com> + Sebastian Raschka Sebastian Raschka ShawnChen1996 +Shriya Kalakata +Shriya Kalakata <87483933+shriyakalakata@users.noreply.github.com> +Shriya Kalakata Shriya Kalakata +Shriya Kalakata Shriya Kalakata + Sidharth Bansal Sidharth Bansal <20972099+SidharthBansal@users.noreply.github.com> @@ -289,6 +449,8 @@ switham switham Taehoon Lee +Takumasa Nakamura + Ted Drain Taras Kuzyo @@ -303,17 +465,33 @@ Thomas A Caswell Thomas A Caswell +Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> + +Tine Zivic <43860297+tinezivic@users.noreply.github.com> + +Tobias Thrien tobias + +Tom Sarantis + Trish Gillett-Kawamoto Tuan Dung Tran +tybeller <73607363+tybeller@users.noreply.github.com> + +Valentin Bruch +Valentin Bruch <46252273+stiglers-eponym@users.noreply.github.com> + Víctor Zabalza Vidur Satija -WANG Aiyong +Vishal Pankaj Chandratreya <19171016+tfpf@users.noreply.github.com> +Vishal Pankaj Chandratreya <19171016+tfpf@users.noreply.github.com> -Zhili (Jerry) Pan +vittoboa <38300176+vittoboa@users.noreply.github.com> + +WANG Aiyong Werner F Bruhin @@ -321,3 +499,7 @@ Yunfei Yang Yunfei Yang Yunfei Yang Zac Hatfield-Dodds + +Zhili (Jerry) Pan + +ZPyrolink <38cz74@gmail.com> <73246085+ZPyrolink@users.noreply.github.com> diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bfce3c54a030..5425b3fb99ee 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: - id: trailing-whitespace exclude_types: [diff, svg] - repo: https://github.com/pre-commit/mirrors-mypy - rev: fc0f09a29bb495f4a91f00266155d6282d52485d # frozen: v1.20.2 + rev: d2823d321df3af8f878f7ee3414dc94d037145b9 # frozen: v2.1.0 hooks: - id: mypy additional_dependencies: @@ -44,7 +44,7 @@ repos: pass_filenames: false - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: d1b833175a5d08a925900115526febd8fe71c98e # frozen: v0.15.11 + rev: c59bba8fb259db0fec2bbb77ad8ba51ea7341b56 # frozen: v0.15.20 hooks: # Run the linter. - id: ruff-check @@ -66,19 +66,35 @@ repos: name: isort (python) files: ^galleries/tutorials/|^galleries/examples/|^galleries/plot_types/ - repo: https://github.com/rstcheck/rstcheck - rev: 77490ffa33bfc0928975ae3cf904219903db755d # frozen: v6.2.5 + rev: d8774e96810795967ed9603f445b4e751e7b313f # frozen: v6.3.0 hooks: - id: rstcheck additional_dependencies: - sphinx>=1.8.1 - - tomli + args: ["--sphinx-source-dir", "doc"] - repo: https://github.com/adrienverge/yamllint rev: cba56bcde1fdd01c1deb3f945e69764c291a6530 # frozen: v1.38.0 hooks: - id: yamllint args: ["--strict", "--config-file=.yamllint.yml"] + - repo: https://github.com/shellcheck-py/shellcheck-py + rev: 745eface02aef23e168a8afb6b5737818efbea95 # frozen: v0.11.0.1 + hooks: + - id: shellcheck + - repo: https://github.com/zizmorcore/zizmor-pre-commit + rev: e3eebf65325ccc992422292cb7a4baee967cf815 # frozen: v1.26.1 + hooks: + - id: zizmor + - repo: https://github.com/simple-icons/svglint + rev: 8402586b94f073686e46707a163082e270ee5768 # frozen: v4.2.1 + hooks: + - id: svglint + # Override the top-level exclude so that mpl-data/images/ toolbar + # icons are also linted. Exemptions for the intentional interactive + # SVG examples are handled in .svglintrc.mjs. + exclude: '^$' - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 13614ab716a3113145f1294ed259d9fbe5678ff3 # frozen: 0.37.1 + rev: 5030dca3047414c338091455ac41803200ec1f0f # frozen: 0.37.3 hooks: # TODO: Re-enable this when https://github.com/microsoft/azure-pipelines-vscode/issues/567 is fixed. # - id: check-azure-pipelines @@ -119,3 +135,7 @@ repos: name: "Validate Conda environment file" files: ^environment\.yml$ args: ["--verbose", "--schemafile", "ci/schemas/conda-environment.json"] + - repo: https://github.com/oxipng/oxipng + rev: 628e241e23f368097883807fa6e985ccf7c00357 # frozen: v10.1.1 + hooks: + - id: oxipng diff --git a/.svglintrc.mjs b/.svglintrc.mjs new file mode 100644 index 000000000000..7c6c3e194a64 --- /dev/null +++ b/.svglintrc.mjs @@ -0,0 +1,56 @@ +/** @type {import('svglint').Config} */ +const config = { + rules: { + // Ensure all SVGs are valid XML. + valid: true, + + // Block elements that can execute code or embed arbitrary content. + //