diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..af3b9f0 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +--- +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" + groups: + github-actions: + patterns: + - "*" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e1a8621..6a5d182 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,4 +1,6 @@ name: Build docs +permissions: + contents: read on: @@ -17,13 +19,15 @@ jobs: name: Build & Upload Artifact runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + persist-credentials: false - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v5 with: python-version: "3.10" - - uses: tlambert03/setup-qt-libs@v1 + - uses: tlambert03/setup-qt-libs@19e4ef2d781d81f5f067182e228b54ec90d23b76 # v1 - name: Install Dependencies run: | @@ -32,13 +36,13 @@ jobs: sudo apt install graphviz --yes - name: Build Docs - uses: aganders3/headless-gui@v2 + uses: aganders3/headless-gui@f85dd6316993505dfc5f21839d520ae440c84816 # v2 with: run: make html working-directory: ./docs - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: docs path: docs/_build @@ -49,13 +53,15 @@ jobs: needs: build-docs if: contains(github.ref, 'tags') steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v4.1.7 + - uses: actions/checkout@v4 + with: + persist-credentials: false + - uses: actions/download-artifact@v4.3.0 with: name: docs - name: Push to GitHub pages - uses: JamesIves/github-pages-deploy-action@v4 + uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # v4 with: folder: html ssh-key: ${{ secrets.DEPLOY_KEY }} diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index 2a8b731..0521c9e 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -1,4 +1,6 @@ name: tests +permissions: + contents: read on: push: @@ -17,6 +19,19 @@ concurrency: cancel-in-progress: true jobs: + pre-commit: + name: precommit + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + - uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0 + with: + python-version: "3.x" + - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 + with: + extra_args: --hook-stage manual --all-files test: name: ${{ matrix.platform }} py${{ matrix.python-version }} runs-on: ${{ matrix.platform }} @@ -27,15 +42,17 @@ jobs: python-version: ['3.10', '3.11', '3.12'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + persist-credentials: false - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} # these libraries enable testing on Qt on linux - - uses: tlambert03/setup-qt-libs@v1 + - uses: tlambert03/setup-qt-libs@19e4ef2d781d81f5f067182e228b54ec90d23b76 # v1 # strategy borrowed from vispy for installing opengl libs on windows - name: Install Windows OpenGL @@ -54,7 +71,7 @@ jobs: run: python -m tox - name: Upload pytest test results - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: pytest-results-${{ matrix.platform }} py${{ matrix.python-version }} path: reports/ @@ -62,7 +79,7 @@ jobs: if: ${{ always() }} - name: Coverage - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5 # Don't run coverage on merge queue CI to avoid duplicating reports # to codecov. See https://github.com/matplotlib/napari-matplotlib/issues/155 if: github.event_name != 'merge_group' @@ -83,9 +100,11 @@ jobs: permissions: id-token: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + with: + persist-credentials: false - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: "3.x" - name: Install build @@ -99,4 +118,4 @@ jobs: python -m build . - name: Publish package - uses: pypa/gh-action-pypi-publish@release/v1 + uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e807909..e592dea 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,13 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-docstring-first - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.8.0 + rev: 25.1.0 hooks: - id: black @@ -17,14 +17,14 @@ repos: - id: napari-plugin-checks - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.2 + rev: v1.15.0 hooks: - id: mypy additional_dependencies: [numpy, matplotlib] - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: 'v0.6.8' + rev: 'v0.11.9' hooks: - id: ruff diff --git a/src/napari_matplotlib/histogram.py b/src/napari_matplotlib/histogram.py index acdd840..85bba9d 100644 --- a/src/napari_matplotlib/histogram.py +++ b/src/napari_matplotlib/histogram.py @@ -28,7 +28,7 @@ def _get_bins( data: npt.NDArray[Any], num_bins: int = 100, -) -> npt.NDArray[Any]: +) -> npt.NDArray[np.floating]: """Create evenly spaced bins with a given interval. Parameters