diff --git a/.appveyor.yml b/.appveyor.yml index c3fcb0ea9591..13705adc99f9 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -94,7 +94,7 @@ on_finish: - codecov -e PYTHON_VERSION PLATFORM -n "%PYTHON_VERSION% Windows" on_failure: - # Generate a html for visual tests + # Generate an html for visual tests - python tools/visualize_tests.py --no-browser - echo zipping images after a failure... - 7z a result_images.zip result_images\ | grep -v "Compressing" diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index a19b6d2346e3..f3595d2b7865 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -82,6 +82,8 @@ body: options: - pip - conda + - pixi + - uv - Linux package manager - from source (.tar.gz) - git checkout diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index bf483dbdd4f4..06cd0d2fd3bf 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -14,13 +14,15 @@ Additionally, please summarize the changes in the title, for example "Raise Valu 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. If you have used -generative AI as an aid in preparing this PR, see +If possible, please provide a minimum self-contained example. +--> +## AI Disclosure + - ## PR checklist diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 44b2beec38b9..0d514a5c8bdc 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -18,8 +18,7 @@ on: - reopened - labeled -permissions: - contents: read +permissions: {} jobs: build_sdist: @@ -37,16 +36,18 @@ jobs: ) name: Build sdist runs-on: ubuntu-latest + permissions: + contents: read outputs: SDIST_NAME: ${{ steps.sdist.outputs.SDIST_NAME }} steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 persist-credentials: false - - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 name: Install Python with: python-version: '3.11' @@ -72,7 +73,7 @@ jobs: run: twine check dist/* - name: Upload sdist result - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: cibw-sdist path: dist/*.tar.gz @@ -93,6 +94,8 @@ jobs: ) needs: build_sdist name: Build wheels on ${{ matrix.os }} for ${{ matrix.cibw_archs }} + permissions: + contents: read runs-on: ${{ matrix.os }} env: CIBW_BEFORE_BUILD: >- @@ -137,13 +140,13 @@ jobs: steps: - name: Download sdist - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 + uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 with: name: cibw-sdist path: dist/ - name: Build wheels for CPython 3.14 - uses: pypa/cibuildwheel@9c00cb4f6b517705a3794b22395aedc36257242c # v3.2.1 + uses: pypa/cibuildwheel@ee02a1537ce3071a004a6b08c41e72f0fdc42d9a # v3.4.0 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: @@ -153,7 +156,7 @@ jobs: CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 - name: Build wheels for CPython 3.13 - uses: pypa/cibuildwheel@9c00cb4f6b517705a3794b22395aedc36257242c # v3.2.1 + uses: pypa/cibuildwheel@ee02a1537ce3071a004a6b08c41e72f0fdc42d9a # v3.4.0 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: @@ -162,7 +165,7 @@ jobs: CIBW_ARCHS: ${{ matrix.cibw_archs }} - name: Build wheels for CPython 3.12 - uses: pypa/cibuildwheel@9c00cb4f6b517705a3794b22395aedc36257242c # v3.2.1 + uses: pypa/cibuildwheel@ee02a1537ce3071a004a6b08c41e72f0fdc42d9a # v3.4.0 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: @@ -170,7 +173,7 @@ jobs: CIBW_ARCHS: ${{ matrix.cibw_archs }} - name: Build wheels for CPython 3.11 - uses: pypa/cibuildwheel@9c00cb4f6b517705a3794b22395aedc36257242c # v3.2.1 + uses: pypa/cibuildwheel@ee02a1537ce3071a004a6b08c41e72f0fdc42d9a # v3.4.0 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: @@ -178,7 +181,7 @@ jobs: CIBW_ARCHS: ${{ matrix.cibw_archs }} - name: Build wheels for PyPy - uses: pypa/cibuildwheel@9c00cb4f6b517705a3794b22395aedc36257242c # v3.2.1 + uses: pypa/cibuildwheel@ee02a1537ce3071a004a6b08c41e72f0fdc42d9a # v3.4.0 with: package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} env: @@ -187,37 +190,8 @@ jobs: CIBW_ENABLE: pypy if: matrix.cibw_archs != 'aarch64' && matrix.os != 'windows-latest' && matrix.os != 'windows-11-arm' - - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 + - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: cibw-wheels-${{ runner.os }}-${{ matrix.cibw_archs }} path: ./wheelhouse/*.whl if-no-files-found: error - - publish: - if: github.repository == 'matplotlib/matplotlib' && github.event_name == 'push' && github.ref_type == 'tag' - name: Upload release to PyPI - needs: [build_sdist, build_wheels] - runs-on: ubuntu-latest - environment: release - permissions: - id-token: write - attestations: write - contents: read - steps: - - name: Download packages - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 - with: - pattern: cibw-* - path: dist - merge-multiple: true - - - name: Print out packages - run: ls dist - - - name: Generate artifact attestation for sdist and wheel - uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0 - with: - subject-path: dist/matplotlib-* - - - name: Publish package distributions to PyPI - uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 diff --git a/.github/workflows/circleci.yml b/.github/workflows/circleci.yml index ab410b194754..49dc4ea3b3ec 100644 --- a/.github/workflows/circleci.yml +++ b/.github/workflows/circleci.yml @@ -1,6 +1,9 @@ --- name: "CircleCI artifact handling" on: [status] + +permissions: {} + jobs: circleci_artifacts_redirector_job: if: "${{ github.event.context == 'ci/circleci: docs-python3' }}" @@ -28,7 +31,7 @@ jobs: runs-on: ubuntu-latest name: Post warnings/errors as review steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false @@ -41,7 +44,7 @@ jobs: - name: Set up reviewdog if: "${{ steps.fetch-artifacts.outputs.count != 0 }}" - uses: reviewdog/action-setup@d8edfce3dd5e1ec6978745e801f9c50b5ef80252 # v1.4.0 + uses: reviewdog/action-setup@d8a7baabd7f3e8544ee4dbde3ee41d0011c3a93f # v1.5.0 with: reviewdog_version: latest diff --git a/.github/workflows/clean_pr.yml b/.github/workflows/clean_pr.yml index fdfc446af15b..75f6a451c7ee 100644 --- a/.github/workflows/clean_pr.yml +++ b/.github/workflows/clean_pr.yml @@ -2,15 +2,16 @@ name: PR cleanliness on: [pull_request] -permissions: - contents: read +permissions: {} jobs: pr_clean: runs-on: ubuntu-latest + permissions: + contents: read steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: '0' persist-credentials: false diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 72d84e46e077..93eefd6ca27f 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -10,6 +10,8 @@ on: schedule: - cron: '45 19 * * 1' +permissions: {} + jobs: analyze: if: github.repository == 'matplotlib/matplotlib' @@ -27,12 +29,12 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v4.31.0 + uses: github/codeql-action/init@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6 with: languages: ${{ matrix.language }} @@ -43,4 +45,4 @@ jobs: pip install --user -v . - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v4.31.0 + uses: github/codeql-action/analyze@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6 diff --git a/.github/workflows/conflictcheck.yml b/.github/workflows/conflictcheck.yml index f4a687cd28d7..2058da8ca9fb 100644 --- a/.github/workflows/conflictcheck.yml +++ b/.github/workflows/conflictcheck.yml @@ -9,6 +9,8 @@ on: pull_request_target: types: [synchronize] +permissions: {} + jobs: main: if: github.repository == 'matplotlib/matplotlib' diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml index ba1fd6f57790..8a01d76c00f5 100644 --- a/.github/workflows/cygwin.yml +++ b/.github/workflows/cygwin.yml @@ -30,8 +30,7 @@ on: - cron: "47 5 * * 6" workflow_dispatch: -permissions: - contents: read +permissions: {} env: NO_AT_BRIDGE: 1 # Necessary for GTK3 interactive test. @@ -47,6 +46,8 @@ jobs: test-cygwin: runs-on: windows-latest + permissions: + contents: read name: Python 3.${{ matrix.python-minor-version }} on Cygwin # Enable these when Cygwin has Python 3.12. if: >- @@ -79,12 +80,12 @@ jobs: - name: Fix line endings run: git config --global core.autocrlf input - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 persist-credentials: false - - uses: cygwin/cygwin-install-action@f2009323764960f80959895c7bc3bb30210afe4d # v6 + - uses: cygwin/cygwin-install-action@711d29f3da23c9f4a1798e369a6f01198c13b11a # v6 with: packages: >- ccache gcc-g++ gdb git graphviz libcairo-devel libffi-devel @@ -140,21 +141,21 @@ jobs: # FreeType build fails with bash, succeeds with dash - name: Cache pip - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 with: path: C:\cygwin\home\runneradmin\.cache\pip key: Cygwin-py3.${{ matrix.python-minor-version }}-pip-${{ hashFiles('requirements/*/*.txt') }} restore-keys: ${{ matrix.os }}-py3.${{ matrix.python-minor-version }}-pip- - name: Cache ccache - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 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@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 with: path: | C:\cygwin\home\runneradmin\.cache\matplotlib diff --git a/.github/workflows/good-first-issue.yml b/.github/workflows/good-first-issue.yml index 5bb69db0595c..6543f05a0837 100644 --- a/.github/workflows/good-first-issue.yml +++ b/.github/workflows/good-first-issue.yml @@ -4,6 +4,9 @@ on: issues: types: - labeled + +permissions: {} + jobs: add-comment: if: github.event.label.name == 'Good first issue' @@ -18,13 +21,16 @@ jobs: body: | ### Good first issue - notes for new contributors - This issue is suited to new contributors because it does not require understanding of the - Matplotlib internals. To get started, please see our [contributing - guide](https://matplotlib.org/stable/devel/index). + This issue is suited to new contributors because it does not require + understanding of the Matplotlib internals. This is a non-urgent task + intended for human contributors to learn how to contribute; therefore please + do not try to automate a solution using AI. To get started, please see our + [contributing guide](https://matplotlib.org/stable/devel/index). - **We do not assign issues**. Check the *Development* section in the sidebar for linked pull - requests (PRs). If there are none, feel free to start working on it. If there is an open PR, please - collaborate on the work by reviewing it rather than duplicating it in a competing PR. + **We do not assign issues**. Check the *Development* section in the sidebar + for linked pull requests (PRs). If there are none, feel free to start + working on it. If there is an open PR, please collaborate on the work by + reviewing it rather than duplicating it in a competing PR. If something is unclear, please reach out on any of our [communication channels](https://matplotlib.org/stable/devel/contributing.html#get-connected). diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 17c4922df054..2914c64a8461 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -3,6 +3,8 @@ name: "Pull Request Labeler" on: - pull_request_target +permissions: {} + jobs: labeler: permissions: diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index f1c6d21019e3..048b78f24761 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -2,22 +2,23 @@ name: Linting on: [pull_request] -permissions: - contents: read +permissions: {} jobs: pre-commit: name: precommit runs-on: ubuntu-latest + permissions: + contents: read steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 persist-credentials: false - - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: "3.x" - - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 + - uses: j178/prek-action@0bb87d7f00b0c99306c8bcb8b8beba1eb581c037 # v1.1.1 with: extra_args: --hook-stage manual --all-files @@ -25,14 +26,15 @@ jobs: name: ruff runs-on: ubuntu-latest permissions: + contents: read checks: write steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Set up Python 3 - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: '3.11' @@ -40,7 +42,7 @@ jobs: run: pip3 install ruff - name: Set up reviewdog - uses: reviewdog/action-setup@d8edfce3dd5e1ec6978745e801f9c50b5ef80252 # v1.4.0 + uses: reviewdog/action-setup@d8a7baabd7f3e8544ee4dbde3ee41d0011c3a93f # v1.5.0 - name: Run ruff env: @@ -54,14 +56,15 @@ jobs: name: mypy runs-on: ubuntu-latest permissions: + contents: read checks: write steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Set up Python 3 - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: '3.11' @@ -69,7 +72,7 @@ jobs: run: pip3 install -r requirements/testing/mypy.txt -r requirements/testing/all.txt - name: Set up reviewdog - uses: reviewdog/action-setup@d8edfce3dd5e1ec6978745e801f9c50b5ef80252 # v1.4.0 + uses: reviewdog/action-setup@d8a7baabd7f3e8544ee4dbde3ee41d0011c3a93f # v1.5.0 - name: Run mypy env: @@ -85,9 +88,10 @@ jobs: name: eslint runs-on: ubuntu-latest permissions: + contents: read checks: write steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false diff --git a/.github/workflows/mypy-stubtest.yml b/.github/workflows/mypy-stubtest.yml index 3815efd08954..81fcd48462e8 100644 --- a/.github/workflows/mypy-stubtest.yml +++ b/.github/workflows/mypy-stubtest.yml @@ -2,27 +2,27 @@ name: Mypy Stubtest on: [pull_request] -permissions: - contents: read +permissions: {} jobs: mypy-stubtest: name: mypy-stubtest runs-on: ubuntu-latest permissions: + contents: read checks: write steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Set up Python 3 - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: '3.11' - name: Set up reviewdog - uses: reviewdog/action-setup@d8edfce3dd5e1ec6978745e801f9c50b5ef80252 # v1.4.0 + uses: reviewdog/action-setup@d8a7baabd7f3e8544ee4dbde3ee41d0011c3a93f # v1.5.0 - name: Install tox run: python -m pip install tox diff --git a/.github/workflows/nightlies.yml b/.github/workflows/nightlies.yml index 393ce2e73472..4cb58bdbf02d 100644 --- a/.github/workflows/nightlies.yml +++ b/.github/workflows/nightlies.yml @@ -8,8 +8,7 @@ on: # Run on demand with workflow dispatch workflow_dispatch: -permissions: - actions: read +permissions: {} jobs: upload_nightly_wheels: @@ -21,6 +20,8 @@ jobs: # to work in subsequent jobs. # https://github.com/mamba-org/setup-micromamba#about-login-shells shell: bash -e -l {0} + permissions: + actions: read if: github.repository_owner == 'matplotlib' steps: @@ -59,7 +60,7 @@ jobs: ls -l dist/ - name: Upload wheels to Anaconda Cloud as nightlies - uses: scientific-python/upload-nightly-action@b36e8c0c10dbcfd2e05bf95f17ef8c14fd708dbf # 0.6.2 + uses: scientific-python/upload-nightly-action@5748273c71e2d8d3a61f3a11a16421c8954f9ecf # 0.6.3 with: artifacts_path: dist anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} diff --git a/.github/workflows/pr_welcome.yml b/.github/workflows/pr_welcome.yml index 2580b5a008a0..466dc9abbaec 100644 --- a/.github/workflows/pr_welcome.yml +++ b/.github/workflows/pr_welcome.yml @@ -1,18 +1,25 @@ --- name: PR Greetings -on: [pull_request_target] +on: + pull_request_target: + types: opened + issues: + types: opened + +permissions: {} jobs: greeting: runs-on: ubuntu-latest permissions: + issues: write pull-requests: write steps: - - uses: actions/first-interaction@1c4688942c71f71d4f5502a26ea67c331730fa4d # v3.1.0 + - uses: plbstl/first-contribution@4fb1541ce2706255850d56c5684552607be1ae9b # v4.2.0 with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - pr_message: >+ + labels: first-contribution + pr-opened-msg: >+ Thank you for opening your first PR into Matplotlib! @@ -29,9 +36,13 @@ jobs: For details on testing, writing docs, and our review process, please see [the developer - guide](https://matplotlib.org/devdocs/devel/index.html) + guide](https://matplotlib.org/devdocs/devel/index.html). + + **Please let us know if (and how) you use AI, it will help us give you + better feedback on your PR.** We strive to be a welcoming and open project. Please follow our [Code of Conduct](https://github.com/matplotlib/matplotlib/blob/main/CODE_OF_CONDUCT.md). + issue-opened-msg: "" diff --git a/.github/workflows/stale-tidy.yml b/.github/workflows/stale-tidy.yml index 85c8fec38e63..feb1fe701d70 100644 --- a/.github/workflows/stale-tidy.yml +++ b/.github/workflows/stale-tidy.yml @@ -4,12 +4,16 @@ on: schedule: - cron: '30 1 * * 2,4,6' +permissions: {} + jobs: stale: if: github.repository == 'matplotlib/matplotlib' runs-on: ubuntu-latest + permissions: + issues: write steps: - - uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0 + - uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} operations-per-run: 300 @@ -20,5 +24,5 @@ jobs: close-issue-label: "status: closed as inactive" days-before-issue-close: 30 ascending: true - exempt-issue-labels: "keep" + exempt-issue-labels: "keep,status: confirmed bug" exempt-pr-labels: "keep,status: orphaned PR" diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index bbc58eca4fb0..63f1a1ce3b05 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -2,14 +2,19 @@ name: 'Label inactive PRs' on: schedule: - - cron: '30 1 * * 1,3,5' + - cron: '30 1 * * 1' + +permissions: {} jobs: stale: if: github.repository == 'matplotlib/matplotlib' runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write steps: - - uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0 + - uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} operations-per-run: 20 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f25b5e4a03dc..1e79166758d1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,6 +22,8 @@ on: - cron: "47 5 * * 6" workflow_dispatch: +permissions: {} + env: NO_AT_BRIDGE: 1 # Necessary for GTK3 interactive test. OPENBLAS_NUM_THREADS: 1 @@ -73,6 +75,8 @@ jobs: 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. @@ -87,15 +91,19 @@ jobs: python-version: '3.13' # https://github.com/matplotlib/matplotlib/issues/29732 pygobject-ver: '<3.52.0' + - os: macos-15 # This runner is on M1 (arm64) chips. + python-version: '3.14' + # https://github.com/matplotlib/matplotlib/issues/29732 + pygobject-ver: '<3.52.0' steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 persist-credentials: false - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ matrix.python-version }} allow-prereleases: true @@ -115,6 +123,7 @@ jobs: fonts-wqy-zenhei \ gdb \ gir1.2-gtk-3.0 \ + gir1.2-gtk-4.0 \ graphviz \ inkscape \ language-pack-de \ @@ -150,7 +159,6 @@ jobs: fi if [[ "${{ matrix.os }}" = ubuntu-22.04 ]]; then sudo apt-get install -yy --no-install-recommends \ - gir1.2-gtk-4.0 \ libgirepository1.0-dev else # ubuntu-24.04 sudo apt-get install -yy --no-install-recommends \ @@ -178,7 +186,7 @@ jobs: esac - name: Cache pip - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 if: startsWith(runner.os, 'Linux') with: path: ~/.cache/pip @@ -186,7 +194,7 @@ jobs: restore-keys: | ${{ matrix.os }}-py${{ matrix.python-version }}-pip- - name: Cache pip - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 if: startsWith(runner.os, 'macOS') with: path: ~/Library/Caches/pip @@ -194,7 +202,7 @@ jobs: restore-keys: | ${{ matrix.os }}-py${{ matrix.python-version }}-pip- - name: Cache ccache - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 with: path: | ~/.ccache @@ -202,7 +210,7 @@ jobs: restore-keys: | ${{ matrix.os }}-py${{ matrix.python-version }}-ccache- - name: Cache Matplotlib - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 with: path: | ~/.cache/matplotlib @@ -264,8 +272,8 @@ jobs: # 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.12' && "${{ matrix.python-version }}" != '3.13' ]]; then + 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' || @@ -389,12 +397,12 @@ jobs: fi - name: Upload code coverage if: ${{ !cancelled() && github.event_name != 'schedule' }} - uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 + uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 with: name: "${{ matrix.python-version }} ${{ matrix.os }} ${{ matrix.name-suffix }}" token: ${{ secrets.CODECOV_TOKEN }} - - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 + - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 if: failure() with: name: "${{ matrix.python-version }} ${{ matrix.os }} ${{ matrix.name-suffix }} result images" diff --git a/.gitignore b/.gitignore index 9389a1612b14..0460152a792f 100644 --- a/.gitignore +++ b/.gitignore @@ -104,6 +104,10 @@ __conda_version__.txt lib/png.lib lib/z.lib +# uv files # +############ +uv.lock + # Environments # ################ .env diff --git a/.mailmap b/.mailmap index 44005da6e2d8..bbadcb8ff879 100644 --- a/.mailmap +++ b/.mailmap @@ -11,6 +11,8 @@ Alon Hershenhorn Alvaro Sanchez +Andreas C Mueller Andreas Mueller + Andrew Dawson anykraus @@ -32,6 +34,8 @@ Carsten Schelp Casper van der Wel +CharlesHe16 + Chris Holdgraf Cho Yin Yong @@ -57,6 +61,8 @@ David Kua Devashish Deshpande +Diego Leal Petrola + Dietmar Schwertberger Dora Fraeman Caswell @@ -84,16 +90,26 @@ Hajoon Choi hannah +Hannes Breytenbach + Hans Moritz Günther Harshal Prakash Patankar Harshit Patni +Harutaka Kawamura + +Hood Chatham Hood + +Ian Hunt-Isaak + ImportanceOfBeingErnest J. Goutin JGoutin +Jakub Klus <48711526+deep-jkl@users.noreply.github.com> + Jack Kelly Jack Kelly @@ -105,6 +121,8 @@ Jake Vanderplas James R. Evans +Jan-Hendrik Müller <44469195+kolibril13@users.noreply.github.com> + Jeff Lutgen Jeffrey Bingham @@ -112,12 +130,18 @@ Jeffrey Bingham Jens Hedegaard Nielsen Jens Hedegaard Nielsen +Jerome F. Villegas + Joel Frederico <458871+joelfrederico@users.noreply.github.com> +Johan von Forstner + John Hunter Jorrit Wronski +Jose Manuel Martí + Joseph Fox-Rabinovitz Mad Physicist Joseph Fox-Rabinovitz Joseph Fox-Rabinovitz @@ -149,11 +173,15 @@ Leon Yin Lion Krischer +luz paz + Manan Kevadiya Manan Kevadiya <43081866+manan2501@users.noreply.github.com> Manuel Nuno Melo +Marat Kopytjuk + Marco Gorelli Marco Gorelli <33491632+MarcoGorelli@users.noreply.github.com> @@ -215,6 +243,8 @@ Paul Ivanov Per Parker +Péter Leéh + Peter Würtz Peter Würtz @@ -222,12 +252,18 @@ Phil Elson Phil Elson Phil Elson +Philipp Nagel + productivememberofsociety666 none Rishikesh +Ruth Nainggolan Ruth G. N <32371319+ruthgn@users.noreply.github.com> + RyanPan +Richard Sheridan + Samesh Lakhotia Samesh Lakhotia <43701530+sameshl@users.noreply.github.com> ' @@ -236,6 +272,8 @@ Scott Lasley Sebastian Raschka Sebastian Raschka +ShawnChen1996 + Sidharth Bansal Sidharth Bansal <20972099+SidharthBansal@users.noreply.github.com> @@ -257,6 +295,7 @@ Taras Kuzyo Terence Honles +Thomas A Caswell Thomas A Caswell Thomas A Caswell Thomas A Caswell Thomas A Caswell Thomas A Caswell Thomas A Caswell <“tcaswell@gmail.com”> diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 11499188509e..4bba747d451b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,6 +5,7 @@ ci: exclude: | (?x)^( extern| + subprojects/packagefiles| LICENSE| lib/matplotlib/mpl-data| doc/devel/gitwash| diff --git a/doc/_static/switcher.json b/doc/_static/switcher.json index 3912afd8a17d..36e743db21b8 100644 --- a/doc/_static/switcher.json +++ b/doc/_static/switcher.json @@ -1,7 +1,7 @@ [ { "name": "3.10 (stable)", - "version": "3.10.7", + "version": "3.10.8", "url": "https://matplotlib.org/stable/", "preferred": true }, diff --git a/doc/api/artist_api.rst b/doc/api/artist_api.rst index 0ca3fb364c41..f256d2b7164e 100644 --- a/doc/api/artist_api.rst +++ b/doc/api/artist_api.rst @@ -122,6 +122,7 @@ Figure and Axes Artist.set_figure Artist.get_figure + Artist.figure Children -------- diff --git a/doc/api/axes_api.rst b/doc/api/axes_api.rst index f5af8744a2bc..1f5f3e403bee 100644 --- a/doc/api/axes_api.rst +++ b/doc/api/axes_api.rst @@ -450,6 +450,7 @@ Units Axes.convert_yunits Axes.have_units +.. _axes-api-adding-artists: Adding artists ============== @@ -628,6 +629,8 @@ Other Axes.get_transformed_clip_path_and_affine Axes.has_data Axes.set + Axes.get_figure + Axes.figure Axes.remove .. autoclass:: matplotlib.axes.Axes.ArtistList diff --git a/doc/api/matplotlib_configuration_api.rst b/doc/api/matplotlib_configuration_api.rst index d5dc60c80613..b2fafc08e5fc 100644 --- a/doc/api/matplotlib_configuration_api.rst +++ b/doc/api/matplotlib_configuration_api.rst @@ -24,8 +24,24 @@ Default values and styling ========================== .. py:data:: rcParams + :type: RcParams + + The global configuration settings for Matplotlib. + + This is a dictionary-like variable that stores the current configuration + settings. Many of the values control styling, but others control + various aspects of Matplotlib's behavior. + + See :doc:`/users/explain/configuration` for a full list of config + parameters. + + See :ref:`customizing` for usage information. + + Notes + ----- + This object is also available as ``plt.rcParams`` via the + `matplotlib.pyplot` module (which by convention is imported as ``plt``). - An instance of `RcParams` for handling default Matplotlib values. .. autoclass:: RcParams :no-members: diff --git a/doc/api/next_api_changes/behavior/28437-CH.rst b/doc/api/next_api_changes/behavior/28437-CH.rst index 6121dfec8163..9d0161b6aac9 100644 --- a/doc/api/next_api_changes/behavior/28437-CH.rst +++ b/doc/api/next_api_changes/behavior/28437-CH.rst @@ -1,8 +1,11 @@ *alpha* parameter handling on images ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -When passing and array to ``imshow(..., alpha=...)``, the parameter was silently ignored -if the image data was a RGB or RBGA image or if :rc:`interpolation_state` -resolved to "rbga". +Prior to Matplotlib 3.10.1, when passing an array to ``imshow(..., alpha=...)``, the +parameter was silently ignored if the image data was an RGB or RGBA image or if +:rc:`image.interpolation_stage` resolved to "rbga". -This is now fixed, and the alpha array overwrites any previous transparency information. +Matplotlib 3.10.1 changed this to apply the alpha array as the alpha channel, +overwriting any existing transparency information in the image data. Matplotlib v3.11.0 +further fixes the handling for RGBA images: the existing alpha channel is now multiplied +by the alpha array, consistent with how scalar alpha values are handled. diff --git a/doc/api/next_api_changes/behavior/30824-AYS.rst b/doc/api/next_api_changes/behavior/30824-AYS.rst new file mode 100644 index 000000000000..a190bd537126 --- /dev/null +++ b/doc/api/next_api_changes/behavior/30824-AYS.rst @@ -0,0 +1,6 @@ +Bivariate colormaps now fully span the intended range of colors +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Bivariate colormaps generated by ``SegmentedBivarColormap`` (e.g., ``BiOrangeBlue``) +from a set of input colors now fully span that range of colors. There had been a bug +with the numerical interpolation such that the colormap did not actually include the +first or last colors. diff --git a/doc/api/next_api_changes/behavior/30975-VM.rst b/doc/api/next_api_changes/behavior/30975-VM.rst new file mode 100644 index 000000000000..185b57ac5de6 --- /dev/null +++ b/doc/api/next_api_changes/behavior/30975-VM.rst @@ -0,0 +1,9 @@ +Windows configuration directory location +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +On Windows, the default configuration and cache directories now use +``%LOCALAPPDATA%\matplotlib`` instead of ``%USERPROFILE%\.matplotlib``. +This follows Windows application data storage conventions. + +The ``MPLCONFIGDIR`` environment variable can still be used to override +this default. diff --git a/doc/api/next_api_changes/behavior/31021-AYS.rst b/doc/api/next_api_changes/behavior/31021-AYS.rst new file mode 100644 index 000000000000..aa5dc598cb26 --- /dev/null +++ b/doc/api/next_api_changes/behavior/31021-AYS.rst @@ -0,0 +1,7 @@ +Rendering of images now more accurate +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +There have been several fixes to improve the accuracy of how images are +resampled and placed during rendering. Some inaccuracies were up to a pixel off +in the output. The most apparent improvement is that the alignment of data +pixels with tick marks and grid lines is now reliable. Nearly all image output +has changed, but often only at a subtle level that is not obvious qualitatively. diff --git a/doc/api/next_api_changes/behavior/31223-AS.rst b/doc/api/next_api_changes/behavior/31223-AS.rst new file mode 100644 index 000000000000..0880659e55ee --- /dev/null +++ b/doc/api/next_api_changes/behavior/31223-AS.rst @@ -0,0 +1,28 @@ +``pyplot.subplot`` and ``pyplot.subplot_mosaic`` raise *ValueError* on existing figures +---------------------------------------------------------------------------------------- + +Passing a *num* argument to `~.pyplot.subplots` or `~.pyplot.subplot_mosaic` +that refers to an existing figure or is a ``Figure`` instance now raises a +`ValueError`. + +These utility functions are intended strictly for the creation of new figures and +subplots. Previously, they accidentally allowed the reuse of existing figures because +they internally called `~.pyplot.figure`. This change ensures that these functions +strictly follow their documented purpose of creating new figures. + +To reuse an existing figure, clear it first using ``clear=True``: + +.. code-block:: python + + fig, axs = plt.subplots(num=1, clear=True) + # or + fig, axd = plt.subplot_mosaic([['A', 'B']], num=1, clear=True) + +If you have a ``Figure`` instance and want to add subplots to it, use the +object-oriented API: + +.. code-block:: python + + fig.subplots(nrows=2, ncols=2) + # or + fig.subplot_mosaic([['A', 'B']]) diff --git a/doc/api/next_api_changes/deprecations/30369-AL.rst b/doc/api/next_api_changes/deprecations/30369-AL.rst new file mode 100644 index 000000000000..8b82c80054d9 --- /dev/null +++ b/doc/api/next_api_changes/deprecations/30369-AL.rst @@ -0,0 +1,14 @@ +:mod:`.axisartist` now uses more standard tick direction controls +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Previously, the position of :mod:`.axisartist` ticks (inside or outside +the axes) were set using ``set_tick_out(bool)``. They are now set +using ``set_tick_direction("in")`` (or "out", or "inout"), and respect +:rc:`xtick.direction` and :rc:`ytick.direction`. In particular, they default +to pointing outwards, consistently with the rest of the library. + +The *tick_out* parameter of `.Ticks` has been deprecated (use *tick_direction* +instead). The ``Ticks.get_tick_out`` method is deprecated (use +`.Ticks.get_tick_direction` instead). + +The unused ``locs_angles_labels`` attribute of `.Ticks` and `.LabelBase` has +also been deprecated. diff --git a/doc/api/next_api_changes/deprecations/30737-TH.rst b/doc/api/next_api_changes/deprecations/30737-TH.rst new file mode 100644 index 000000000000..8feef85912b4 --- /dev/null +++ b/doc/api/next_api_changes/deprecations/30737-TH.rst @@ -0,0 +1,8 @@ +The *canvas* parameter to ``MultiCursor`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +... is deprecated. It has been unused for a while already. + +Please remove the parameter and change the call from +``MultiCursor(canvas, axes)`` to ``MultiCursor(axes)``. Both calls are +valid throughout the deprecation period. diff --git a/doc/api/next_api_changes/deprecations/30844-IHI.rst b/doc/api/next_api_changes/deprecations/30844-IHI.rst new file mode 100644 index 000000000000..55ebe9af6d68 --- /dev/null +++ b/doc/api/next_api_changes/deprecations/30844-IHI.rst @@ -0,0 +1,6 @@ +``CallbackRegistry.disconnect`` *cid* parameter renamed to *cid_or_func* +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The *cid* parameter of `.CallbackRegistry.disconnect` has been renamed to +*cid_or_func*. The method now also accepts a callable, which will disconnect +that callback from all signals or from a specific signal if the *signal* +keyword argument is provided. diff --git a/doc/api/next_api_changes/deprecations/30889-TH.rst b/doc/api/next_api_changes/deprecations/30889-TH.rst new file mode 100644 index 000000000000..d221ae30d4fb --- /dev/null +++ b/doc/api/next_api_changes/deprecations/30889-TH.rst @@ -0,0 +1,10 @@ +Transforms helper functions +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The following functions in the `.transforms` module are deprecated, +because they are considerer internal functionality and should not be used +by end users: + +- ``matplotlib.transforms.nonsingular`` +- ``matplotlib.transforms.interval_contains`` +- ``matplotlib.transforms.interval_contains_open`` diff --git a/doc/api/next_api_changes/deprecations/30993-SS.rst b/doc/api/next_api_changes/deprecations/30993-SS.rst new file mode 100644 index 000000000000..152d25ba438d --- /dev/null +++ b/doc/api/next_api_changes/deprecations/30993-SS.rst @@ -0,0 +1,5 @@ +``InvertedSymmetricalLogTransform.invlinthresh`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The ``invlinthresh`` attribute of `.InvertedSymmetricalLogTransform` is +deprecated. Use the ``.inverted().transform(linthresh)`` method instead. diff --git a/doc/api/next_api_changes/deprecations/31023-AL.rst b/doc/api/next_api_changes/deprecations/31023-AL.rst new file mode 100644 index 000000000000..ac2e8be2e708 --- /dev/null +++ b/doc/api/next_api_changes/deprecations/31023-AL.rst @@ -0,0 +1,4 @@ +``cbook.normalize_kwargs`` only supports passing artists and artist classes as second argument +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Support for directly passing an alias mapping or None as second argument to +`.cbook.normalize_kwargs` has been deprecated. diff --git a/doc/api/next_api_changes/deprecations/31143-AL.rst b/doc/api/next_api_changes/deprecations/31143-AL.rst new file mode 100644 index 000000000000..7de02ff83896 --- /dev/null +++ b/doc/api/next_api_changes/deprecations/31143-AL.rst @@ -0,0 +1,3 @@ +``backend_svg.XMLWriter`` is deprecated +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +It is an internal helper not intended for external use. diff --git a/doc/api/next_api_changes/deprecations/31170-AL.rst b/doc/api/next_api_changes/deprecations/31170-AL.rst new file mode 100644 index 000000000000..ecf1f31f1cff --- /dev/null +++ b/doc/api/next_api_changes/deprecations/31170-AL.rst @@ -0,0 +1,6 @@ +``kw``, ``fontproperties``, ``labelcolor``, and ``verts`` attributes of ``QuiverKey`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +These attributes are deprecated (note that ``fontproperties``, ``labelcolor``, +or ``verts`` after the first draw had no effect previously). Directly +access the relevant attributes on the sub-artists ``QuiverKey.vector`` and +``QuiverKey.text``, instead. diff --git a/doc/api/prev_api_changes/api_changes_3.10.1.rst b/doc/api/prev_api_changes/api_changes_3.10.1.rst index 26d43ddf8b17..71a2f71efc94 100644 --- a/doc/api/prev_api_changes/api_changes_3.10.1.rst +++ b/doc/api/prev_api_changes/api_changes_3.10.1.rst @@ -8,7 +8,7 @@ Behaviour ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When passing and array to ``imshow(..., alpha=...)``, the parameter was silently ignored -if the image data was a RGB or RBGA image or if :rc:`interpolation_state` +if the image data was an RGB or RBGA image or if :rc:`image.interpolation_stage` resolved to "rbga". This is now fixed, and the alpha array overwrites any previous transparency information. diff --git a/doc/api/toolkits/mplot3d/faq.rst b/doc/api/toolkits/mplot3d/faq.rst index e9ba804648e0..20fe81e574fe 100644 --- a/doc/api/toolkits/mplot3d/faq.rst +++ b/doc/api/toolkits/mplot3d/faq.rst @@ -6,8 +6,7 @@ mplot3d FAQ How is mplot3d different from Mayavi? ===================================== -`Mayavi `_ -is a very powerful and featureful 3D graphing library. For advanced +Mayavi_ is a very powerful and featureful 3D graphing library. For advanced 3D scenes and excellent rendering capabilities, it is highly recommended to use Mayavi. @@ -37,8 +36,7 @@ rendered properly in matplotlib's 2D rendering engine. This problem will likely not be solved until OpenGL support is added to all of the backends (patches are greatly welcomed). Until then, if you need complex -3D scenes, we recommend using -`MayaVi `_. +3D scenes, we recommend using Mayavi_. I don't like how the 3D plot is laid out, how do I change that? @@ -49,3 +47,5 @@ Work is being done to eliminate this issue. For matplotlib v1.1.0, there is a semi-official manner to modify these parameters. See the note in the :mod:`.mplot3d.axis3d` section of the mplot3d API documentation for more information. + +.. _Mayavi: https://docs.enthought.com/mayavi/mayavi/ diff --git a/doc/api/toolkits/mplot3d/view_angles.rst b/doc/api/toolkits/mplot3d/view_angles.rst index 75b24ba9c7b0..e4200cd2d0e4 100644 --- a/doc/api/toolkits/mplot3d/view_angles.rst +++ b/doc/api/toolkits/mplot3d/view_angles.rst @@ -11,8 +11,7 @@ The position of the viewport "camera" in a 3D plot is defined by three angles: *elevation*, *azimuth*, and *roll*. From the resulting position, it always points towards the center of the plot box volume. The angle direction is a common convention, and is shared with -`PyVista `_ and -`MATLAB `_. +`PyVista `_ and MATLAB_. Note that a positive roll angle rotates the viewing plane clockwise, so the 3d axes will appear to rotate counter-clockwise. @@ -51,8 +50,7 @@ can be specified by setting :rc:`axes3d.mouserotationstyle`, see :doc:`/users/explain/customizing`. Prior to v3.10, the 2D mouse position corresponded directly -to azimuth and elevation; this is also how it is done -in `MATLAB `_. +to azimuth and elevation; this is also how it is done in MATLAB_. To keep it this way, set ``mouserotationstyle: azel``. This approach works fine for spherical coordinate plots, where the *z* axis is special; however, it leads to a kind of 'gimbal lock' when looking down the *z* axis: @@ -131,7 +129,7 @@ Henriksen et al. [Henriksen2002]_ provide an overview. In summary: You can try out one of the various mouse rotation styles using: -.. code:: +.. code-block:: python import matplotlib as mpl mpl.rcParams['axes3d.mouserotationstyle'] = 'trackball' # 'azel', 'trackball', 'sphere', or 'arcball' @@ -188,6 +186,7 @@ the arcball to the border occurs at 45°, set the border width to The border is a circular arc, wrapped around the arcball sphere cylindrically (like a doughnut), joined smoothly to the sphere, much like Bell's hyperbola. +.. _MATLAB: https://www.mathworks.com/help/matlab/ref/view.html .. [Shoemake1992] Ken Shoemake, "ARCBALL: A user interface for specifying three-dimensional rotation using a mouse", in Proceedings of Graphics diff --git a/doc/api/widgets_api.rst b/doc/api/widgets_api.rst index 014361e70377..30b6c6758d6b 100644 --- a/doc/api/widgets_api.rst +++ b/doc/api/widgets_api.rst @@ -2,11 +2,54 @@ ``matplotlib.widgets`` ********************** -.. inheritance-diagram:: matplotlib.widgets +.. currentmodule:: matplotlib.widgets + +.. automodule:: matplotlib.widgets + :no-members: + :no-undoc-members: + + +Widget classes +============== + +.. inheritance-diagram:: matplotlib.widgets.Widget :parts: 1 + :private-bases: + :include-subclasses: +.. autosummary:: + :toctree: _as_gen + :template: autosummary.rst + :nosignatures: -.. automodule:: matplotlib.widgets - :members: - :undoc-members: - :show-inheritance: + Widget + AxesWidget + Cursor + MultiCursor + Button + _Buttons + CheckButtons + RadioButtons + SliderBase + Slider + RangeSlider + TextBox + _SelectorWidget + RectangleSelector + EllipseSelector + Lasso + LassoSelector + PolygonSelector + SpanSelector + SubplotTool + +Helper classes +============== + +.. autosummary:: + :toctree: _as_gen + :nosignatures: + + LockDraw + ToolHandles + ToolLineHandles diff --git a/doc/conf.py b/doc/conf.py index 4d922a5636e1..1fec5f632d4e 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -132,8 +132,9 @@ def _parse_skip_subdirs_file(): 'sphinxext.math_symbol_table', 'sphinxext.missing_references', 'sphinxext.mock_gui_toolkits', - 'sphinxext.skip_deprecated', + 'sphinxext.rcparams', 'sphinxext.redirect_from', + 'sphinxext.skip_deprecated', 'sphinx_copybutton', 'sphinx_design', 'sphinx_tags', @@ -194,6 +195,7 @@ def _check_dependencies(): gallery_order_sectionorder = 'sphinxext.gallery_order.sectionorder' gallery_order_subsectionorder = 'sphinxext.gallery_order.subsectionorder' clear_basic_units = 'sphinxext.util.clear_basic_units' + patch_header = 'sphinxext.util.patch_header' matplotlib_reduced_latex_scraper = 'sphinxext.util.matplotlib_reduced_latex_scraper' else: # gallery_order.py from the sphinxext folder provides the classes that @@ -201,15 +203,14 @@ def _check_dependencies(): from sphinxext.gallery_order import ( sectionorder as gallery_order_sectionorder, subsectionorder as gallery_order_subsectionorder) - from sphinxext.util import clear_basic_units, matplotlib_reduced_latex_scraper + from sphinxext.util import (clear_basic_units, matplotlib_reduced_latex_scraper, + patch_header) if parse_version(sphinx_gallery.__version__) >= parse_version('0.17.0'): sg_matplotlib_animations = (True, 'mp4') else: sg_matplotlib_animations = True -# The following import is only necessary to monkey patch the signature later on -from sphinx_gallery import gen_rst # Prevent plt.show() from emitting a non-GUI backend warning. warnings.filterwarnings('ignore', category=UserWarning, @@ -270,7 +271,7 @@ def autodoc_process_bases(app, name, obj, options, bases): 'dateutil': ('https://dateutil.readthedocs.io/en/stable/', None), 'ipykernel': ('https://ipykernel.readthedocs.io/en/latest/', None), 'numpy': ('https://numpy.org/doc/stable/', None), - 'pandas': ('https://pandas.pydata.org/pandas-docs/stable/', None), + 'pandas': ('https://pandas.pydata.org/docs/', None), 'pytest': ('https://pytest.org/en/stable/', None), 'python': ('https://docs.python.org/3/', None), 'scipy': ('https://docs.scipy.org/doc/scipy/', None), @@ -307,7 +308,7 @@ def autodoc_process_bases(app, name, obj, options, bases): 'reference_url': {'matplotlib': None, 'mpl_toolkits': None}, 'prefer_full_module': {r'mpl_toolkits\.'}, 'remove_config_comments': True, - 'reset_modules': ('matplotlib', clear_basic_units), + 'reset_modules': ('matplotlib', clear_basic_units, patch_header), 'subsection_order': gallery_order_sectionorder, 'thumbnail_size': (320, 224), 'within_subsection_order': gallery_order_subsectionorder, @@ -355,31 +356,6 @@ def gallery_image_warning_filter(record): mathmpl_fontsize = 11.0 mathmpl_srcset = ['2x'] -# Monkey-patching gallery header to include search keywords -gen_rst.EXAMPLE_HEADER = """ -.. DO NOT EDIT. -.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. -.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "{0}" -.. LINE NUMBERS ARE GIVEN BELOW. - -.. only:: html - - .. meta:: - :keywords: codex - - .. note:: - :class: sphx-glr-download-link-note - - :ref:`Go to the end ` - to download the full example code.{2} - -.. rst-class:: sphx-glr-example-title - -.. _sphx_glr_{1}: - -""" - # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -926,3 +902,4 @@ def setup(app): if sphinx.version_info[:2] < (7, 1): app.connect('html-page-context', add_html_cache_busting, priority=1000) generate_ScalarMappable_docs() + app.config.autodoc_use_legacy_class_based = True diff --git a/doc/devel/api_changes.rst b/doc/devel/api_changes.rst index 5fed9f683a48..6880cf10ae62 100644 --- a/doc/devel/api_changes.rst +++ b/doc/devel/api_changes.rst @@ -32,6 +32,20 @@ take particular care when adding new API: __ https://emptysqua.re/blog/api-evolution-the-right-way/#adding-parameters +Add new rcParams +^^^^^^^^^^^^^^^^ + +When adding a new rcParam, the following files must be updated: + +1. :file:`lib/matplotlib/rcsetup.py` - Add a validator entry to the + ``_validators`` dict and a corresponding ``_Param`` entry with default value + and description. +2. :file:`lib/matplotlib/mpl-data/matplotlibrc` - Add a commented-out entry + showing the default value. +3. :file:`lib/matplotlib/typing.py` - Add the key to the ``RcKeyType`` Literal + so that it is recognized as a valid rcParam key. + + Add or change colormaps, color sequences, and styles ---------------------------------------------------- Visual changes are considered an API break. Therefore, we generally do not modify diff --git a/doc/devel/communication_guide.rst b/doc/devel/communication_guide.rst index c90d1d93b99d..dc5669719442 100644 --- a/doc/devel/communication_guide.rst +++ b/doc/devel/communication_guide.rst @@ -40,7 +40,7 @@ The following venues are managed by Matplotlib maintainers and contributors: * library and docs: https://github.com/matplotlib/matplotlib * forum: https://discourse.matplotlib.org/ -* chat: `https://matrix.to/#/#matplotlib:matrix.org `_ +* chat: `https://discourse.matplotlib.org/chat/c/community/3 `_ * blog: https://blog.scientific-python.org/ .. _social-media: @@ -77,8 +77,7 @@ Mailing lists Social media coordination ------------------------- * Team mailing list: matplotlib-social@numfocus.org -* Public chat room: `https://matrix.to/#/#matplotlib_community:gitter.im `_ - +* Public chat room on Discourse: `Community `_ Maintenance ----------- diff --git a/doc/devel/contribute.rst b/doc/devel/contribute.rst index fe81e625421e..96bc5d157518 100644 --- a/doc/devel/contribute.rst +++ b/doc/devel/contribute.rst @@ -21,10 +21,9 @@ Ways to contribute :open: :icon: person-fill - 100% yes! There are so many ways to contribute to our community. Take a look - at the following sections to learn more. - - There are a few typical new contributor profiles: + Here are a few typical new contributor profiles. If you + don't fit into one of them, come talk to us on `Discourse + `_ about how you might contribute. * **You are a Matplotlib user, and you see a bug, a potential improvement, or something that annoys you, and you can fix it.** @@ -33,7 +32,7 @@ Ways to contribute for an existing issue that describes your problem or open a new issue to inform us of the problem you observed and discuss the best approach to fix it. If your contributions would not be captured on GitHub (social media, - communication, educational content), you can also reach out to us on gitter_, + communication, educational content), you can also reach out to us on `Discourse `__ or attend any of our `community meetings `__. @@ -60,12 +59,14 @@ Ways to contribute chance it is a unique context in any given conversation) and make it easier to understand where other people are coming from. - Understanding the entire codebase is a long-term project, and nobody expects - you to do this right away. If you are determined to get started with - Matplotlib and want to learn, going through the basic functionality, - choosing something to focus on (3d, testing, documentation, animations, etc.) - and gaining context on this area by reading the issues and pull requests - touching these subjects is a reasonable approach. + Understanding the entire codebase is a long-term project, and nobody + expects you to do this right away. Start by building your experience in + using Matplotlib: make complicated visualizations, use niche features, + dive deep into one part of the library. This will help you build the + context to then look at the existing issues and pull requests. You can + then reach out to us at the :ref:`new contributor ` + meeting or Discourse channel (incubator) to discuss what you would like + to work on. .. _contribute_code: @@ -163,7 +164,7 @@ we mean by triage are: Our triage process is discussed in detail in :ref:`bug_triaging`. If you have any questions about the process, please reach out on the -:ref:`contributor_incubator` +:ref:`contributor_incubator`. .. _other_ways_to_contribute: @@ -196,6 +197,10 @@ We expect authentic engagement in our community. - If you use generative AI tools as an aid in developing code or documentation changes, ensure that you fully understand the proposed changes and can explain why they are the correct approach. +- If you use AI for translation or grammar correction, please keep the wording as close + as possible to the original wording. It is much easier to come to a mutual + understanding when we are working off a direct translation of your words/thoughts + rather than a text an LLM may have embellished with possibly spurious information. Make sure you have added value based on your personal competency to your contributions. Just taking some input, feeding it to an AI and posting the @@ -203,6 +208,10 @@ result is not of value to the project. To preserve precious core developer capacity, we reserve the right to rigorously reject seemingly AI generated low-value contributions. +In particular, it is also strictly forbidden to post AI generated +content to issues or PRs via automated tooling such as bots or agents. We +may ban such users and/or report them to GitHub. + .. _new_contributors: New contributors @@ -229,8 +238,8 @@ you can browse previous meeting notes on `GitHub `_. We recommend joining the meeting to clarify any doubts, or lingering questions you might have, and to get to know a few of the people behind the -GitHub handles 😉. You can reach out to us on gitter_ for any clarifications or -suggestions. We ❤ feedback! +GitHub handles 😉. You can reach out to us on `incubator chat`_ for any +clarifications or suggestions. We ❤ feedback! .. _contributor_incubator: @@ -238,41 +247,34 @@ Contributor incubator --------------------- The incubator is our non-public communication channel for new contributors. It -is a private gitter_ (chat) room moderated by core Matplotlib developers where -you can get guidance and support for your first few PRs. It's a place where you -can ask questions about anything: how to use git, GitHub, how our PR review -process works, technical questions about the code, what makes for good +is a public chat room on Discourse_ moderated by core Matplotlib developers +where you can get guidance and support for your first few PRs. It's a place +where you can ask questions about anything: how to use git, GitHub, how our PR +review process works, technical questions about the code, what makes for good documentation or a blog post, how to get involved in community work, or get a "pre-review" on your PR. -To join, please go to our public community_ channel, and ask to be added to -``#incubator``. One of our core developers will see your message and will add you. +To join, go to Discourse_ and click on the chat bubble icon next to the search +icon at the top right of the page. Then, find the "Incubator" channel. -.. _gitter: https://gitter.im/matplotlib/matplotlib -.. _community: https://gitter.im/matplotlib/community +.. _Discourse: https://discourse.matplotlib.org/ +.. _development chat: https://discourse.matplotlib.org/chat/c/matplotlib/2 +.. _community chat: https://discourse.matplotlib.org/chat/c/community/3 +.. _incubator chat: https://discourse.matplotlib.org/chat/c/incubator/4 .. _good_first_issues: Good first issues ----------------- -While any contributions are welcome, we have marked some issues as -particularly suited for new contributors by the label `good first issue -`_. These -are well documented issues, that do not require a deep understanding of the -internals of Matplotlib. The issues may additionally be tagged with a -difficulty. ``Difficulty: Easy`` is suited for people with little Python -experience. ``Difficulty: Medium`` and ``Difficulty: Hard`` require more -programming experience. This could be for a variety of reasons, among them, -though not necessarily all at the same time: - -- The issue is in areas of the code base which have more interdependencies, - or legacy code. -- It has less clearly defined tasks, which require some independent - exploration, making suggestions, or follow-up discussions to clarify a good - path to resolve the issue. -- It involves Python features such as decorators and context managers, which - have subtleties due to our implementation decisions. +We have marked some issues as `good first issue +`_ because we +think they are a good entry point into the process of contributing to Matplotlib. These +issues are well documented, do not require a deep understanding of the internals of +Matplotlib, and do not need urgent resolution. Good first issues are intended to onboard +newcomers with a genuine interest in improving Matplotlib, in the hopes that they will +continue to participate in our development community; therefore, pull requests that are +:ref:`AI generated ` will be closed. .. _first_contribution: @@ -288,7 +290,12 @@ guide you through each step: & `"Good first Issue" `_ (optional). 3. Click on an issue you would like to work on, and check to see if the issue has a pull request opened to resolve it. - * A good way to judge if you chose a suitable issue is by asking yourself, "Can I independently submit a PR in 1-2 weeks?" + * A good way to judge if you chose a suitable issue is by asking yourself, "Can I + independently submit a PR in a reasonable time frame?" This should (at most) + be a few days for an easy issue. If it takes longer, let us know why. + * If you are new to open source, we strongly recommend that you do not choose a + complicated issue for your first contribution - please ask in the incubator + channel if you need help gauging the complexity of the work. 4. Check existing pull requests (e.g., :ghpull:`28476`) and filter by the issue number to make sure the issue is not in progress: * If the issue has a pull request (is in progress), tag the user working on the issue, and ask to collaborate (optional). @@ -311,12 +318,10 @@ Get connected When in doubt, we recommend going together! Get connected with our community of active contributors, many of whom felt just like you when they started out and are happy to welcome you and support you as you get to know how we work, and -where things are. You can reach out on any of our :ref:`communication-channels`. -For development questions we recommend reaching out on our development gitter_ -chat room and for community questions reach out at community_. - -.. _gitter: https://gitter.im/matplotlib/matplotlib -.. _community: https://gitter.im/matplotlib/community +where things are. You can reach out on any of our :ref:`communication-channels`, +including the chat space on Discourse_. For development questions we recommend +reaching out on our `development chat`_ and for community questions reach out at +the `community chat`_. .. _managing_issues_prs: @@ -333,6 +338,22 @@ a new PR; duplicate PRs are subject to being closed. However, if the existing PR is an outline, unlikely to work, or stalled, and the original author is unresponsive, feel free to open a new PR referencing the old one. +Difficulty +---------- +Issues may additionally be tagged with a difficulty. ``Difficulty: Easy`` is suitable +for people with beginner scientific Python experience, i.e. fluency with Python syntax +and some experience using libraries like Numpy, Pandas, or Xarray. ``Difficulty: Medium`` +and ``Difficulty: Hard`` require more programming experience. This could be for a variety +of reasons, for example: + +- requires understanding intermediate to advanced Python features, such as decorators, + context managers, or meta-programming +- is in areas of the code base which have more interdependencies or is legacy code. +- involves complex or significant changes to algorithms or architecture. + +Generally, the difficulty level is correlated with how much conceptual (and contextual) +understanding of Matplotlib is required to resolve it. + .. _how-to-pull-request: Start a pull request @@ -340,7 +361,7 @@ Start a pull request The preferred way to contribute to Matplotlib is to fork the `main repository `__ on GitHub, -then submit a "pull request" (PR). To work on a a pull request: +then submit a "pull request" (PR). To work on a pull request: #. **First** set up a development environment, either by cloning a copy of the Matplotlib repository to your own computer or by using Github codespaces, by diff --git a/doc/devel/development_setup.rst b/doc/devel/development_setup.rst index 5be8500428a0..55bf98b4d380 100644 --- a/doc/devel/development_setup.rst +++ b/doc/devel/development_setup.rst @@ -38,7 +38,7 @@ Set up development environment ============================== You can either work locally on your machine, or online in -`GitHub Codespaces `_, a cloud-based in-browser development +`GitHub Codespaces`_, a cloud-based in-browser development environment. @@ -219,7 +219,7 @@ need to be installed when working in codespaces. Create GitHub Codespace :octicon:`codespaces` --------------------------------------------- -`GitHub Codespaces `_ is a cloud-based +`GitHub Codespaces`_ is a cloud-based in-browser development environment that comes with the appropriate setup to contribute to Matplotlib. @@ -260,7 +260,7 @@ Use the "Extensions" icon in the activity bar to install the "Live Server" extension. Locate the ``doc/build/html`` folder in the Explorer, right click the file you want to open and select "Open with Live Server." -.. _`github-codespaces`: https://docs.github.com/codespaces +.. _Github Codespaces: https://docs.github.com/codespaces .. _development-install: @@ -282,7 +282,7 @@ have :ghpull:`26621` in its history (log), you will have to reinstall from sourc each time you change any compiled extension code. If the installation is not working, please consult the :ref:`troubleshooting guide `. -If the guide does not offer a solution, please reach out via `chat `_ +If the guide does not offer a solution, please reach out via `discourse `_ or :ref:`open an issue `. @@ -322,7 +322,7 @@ you are aware of the existing issues beforehand. Install pre-commit hooks ======================== -`pre-commit `_ hooks save time in the review process by +`prek `_ hooks save time in the review process by identifying issues with the code before a pull request is formally opened. Most hooks can also aide in fixing the errors, and the checks should have corresponding :ref:`development workflow ` and @@ -333,8 +333,8 @@ committed files, import order, and incorrect branching. Install pre-commit hooks :: - python -m pip install pre-commit - pre-commit install + python -m pip install prek + prek install Hooks are run automatically after the ``git commit`` stage of the :ref:`editing workflow`. When a hook has found and fixed an error in a @@ -343,11 +343,11 @@ file, that file must be *staged and committed* again. Hooks can also be run manually. All the hooks can be run, in order as listed in ``.pre-commit-config.yaml``, against the full codebase with :: - pre-commit run --all-files + prek run --all-files -To run a particular hook manually, run ``pre-commit run`` with the hook id :: +To run a particular hook manually, run ``prek run`` with the hook id :: - pre-commit run --all-files + prek run --all-files Please note that the ``mypy`` pre-commit hook cannot check the :ref:`type-hints` diff --git a/doc/devel/development_workflow.rst b/doc/devel/development_workflow.rst index c0300acf1f7f..99c7e29234aa 100644 --- a/doc/devel/development_workflow.rst +++ b/doc/devel/development_workflow.rst @@ -22,8 +22,7 @@ why you did it, we recommend the following: * Make a new branch for each feature or bug fix — "one task, one branch". * Name your branch for the purpose of the changes - e.g. ``bugfix-for-issue-14`` or ``refactor-database-code``. -* If you get stuck, reach out on Gitter or - `discourse `__. +* If you get stuck, reach out on `discourse `__. * When you're ready or need feedback on your code, open a pull request so that the Matplotlib developers can give feedback and eventually include your suggested code into the ``main`` branch. @@ -40,7 +39,7 @@ workflow is: #. Start a new *feature branch* from ``upstream/main``:: - git checkout -b my-feature upstream/main + git checkout -b my-new-feature upstream/main #. When you're done editing, e.g., ``lib/matplotlib/collections.py``, record your changes in Git:: @@ -49,7 +48,7 @@ workflow is: #. Push the changes to your GitHub fork:: - git push -u origin my-feature + git push -u origin my-new-feature .. _update-mirror-main: @@ -250,15 +249,15 @@ If you notice you messed up after the rebase:: If you forgot to make a backup branch:: # look at the reflog of the branch - git reflog show cool-feature + git reflog show my-new-feature - 8630830 cool-feature@{0}: commit: BUG: io: close file handles immediately - 278dd2a cool-feature@{1}: rebase finished: refs/heads/my-feature-branch onto 11ee694744f2552d - 26aa21a cool-feature@{2}: commit: BUG: lib: make seek_gzip_factory not leak gzip obj + 8630830 my-new-feature@{0}: commit: BUG: io: close file handles immediately + 278dd2a my-new-feature@{1}: rebase finished: refs/heads/my-new-feature onto 11ee694744f2552d + 26aa21a my-new-feature@{2}: commit: BUG: lib: make seek_gzip_factory not leak gzip obj ... # reset the branch to where it was before the botched rebase - git reset --hard cool-feature@{2} + git reset --hard my-new-feature@{2} .. _rewriting-commit-history: @@ -276,73 +275,85 @@ This can be done via *interactive rebasing*. Suppose that the commit history looks like this:: - git log --oneline - eadc391 Fix some remaining bugs - a815645 Modify it so that it works - 2dec1ac Fix a few bugs + disable - 13d7934 First implementation - 6ad92e5 * masked is now an instance of a new object, MaskedConstant - 29001ed Add pre-nep for a copule of structured_array_extensions. + $ git log --oneline + b7e99a8659 (HEAD -> my-new-feature) Fix some remaining bugs + 8a5de78b17 Modify it so that it works + 34448c69eb Fix a few bugs + disable + 9a5d1ca186 First implementation + d1da6fbf0b (upstream/main) Merge pull request #30778 from timhoffm/decorator-tracebackhide + 6ad937ad83 Merge pull request #30838 from has2k1/fix-numpy-integer-markers ... -and ``6ad92e5`` is the last commit in the ``cool-feature`` branch. Suppose we +and ``b7e99a8659`` is the most recent commit in the ``my-new-feature`` branch. Suppose we want to make the following changes: -* Rewrite the commit message for ``13d7934`` to something more sensible. -* Combine the commits ``2dec1ac``, ``a815645``, ``eadc391`` into a single one. +* Rewrite the commit message for ``9a5d1ca186`` to something more specific. +* Combine the commits ``34448c69eb``, ``8a5de78b17``, ``b7e99a8659`` into a single one. We do as follows:: # make a backup of the current state git branch tmp HEAD # interactive rebase - git rebase -i 6ad92e5 + git rebase -i d1da6fbf0b This will open an editor with the following text in it:: - pick 13d7934 First implementation - pick 2dec1ac Fix a few bugs + disable - pick a815645 Modify it so that it works - pick eadc391 Fix some remaining bugs + pick 9a5d1ca186 First implementation + pick 34448c69eb Fix a few bugs + disable + pick 8a5de78b17 Modify it so that it works + pick b7e99a8659 Fix some remaining bugs - # Rebase 6ad92e5..eadc391 onto 6ad92e5 + # Rebase d1da6fbf0b..b7e99a8659 onto d1da6fbf0b (4 commands) # # Commands: - # p, pick = use commit - # r, reword = use commit, but edit the commit message - # e, edit = use commit, but stop for amending - # s, squash = use commit, but meld into previous commit - # f, fixup = like "squash", but discard this commit's log message + # p, pick = use commit + # r, reword = use commit, but edit the commit message + # e, edit = use commit, but stop for amending + # s, squash = use commit, but meld into previous commit + # f, fixup [-C | -c] = like "squash" but keep only the previous + # commit's log message, unless -C is used, in which case + # keep only this commit's message; -c is same as -C but + # opens the editor + # x, exec = run command (the rest of the line) using shell + # b, break = stop here (continue rebase later with 'git rebase --continue') + # d, drop = remove commit + # l, label