From 0b566853976dd3331ce4b49fa068dc4ee3403785 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Dec 2023 20:34:54 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit automatically updated. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.9.1 → 23.12.1](https://github.com/psf/black/compare/23.9.1...23.12.1) - [github.com/astral-sh/ruff-pre-commit: v0.0.292 → v0.1.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.292...v0.1.9) - [github.com/pre-commit/mirrors-eslint: v8.51.0 → v8.56.0](https://github.com/pre-commit/mirrors-eslint/compare/v8.51.0...v8.56.0) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 19737907..df0b167b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 23.12.1 hooks: - id: black types: [python] @@ -32,7 +32,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: "v0.0.292" + rev: "v0.1.9" hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] @@ -48,7 +48,7 @@ repos: # - svelte - repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.51.0 + rev: v8.56.0 hooks: - id: eslint types: [file] From a58d889dd55fc72229d082f0a6266c79e9cc445b Mon Sep 17 00:00:00 2001 From: slackline Date: Wed, 10 Jan 2024 10:23:46 +0000 Subject: [PATCH 2/2] Fixing pytest-regtest issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New releases of `pytest-regtest>=2.0.0` on PyPI are currently broken as the released packages don't appear to include the Python code for the module itself. This has been reported upstream and when fixed I will remove the dependency. + [pytest-regtest #20](https://gitlab.com/uweschmitt/pytest-regtest/-/issues/20) At the same time I've... + Made the `pre-commit` updates that were automated in #253 where the `pytest-regtest` issue cropped up + Added `no-commit-to-branch` check to `pre-commit` hooks which protects against commits to `master` locally. + Introduced `NPY201` checks under `ruff` linting to check for forthcoming Numpy2 deprecations. Numpy2 is due to be released early later this year (first release candidate is scheduled 2024-02-01). This may introduce some breaking changes, a broad overview is available [here](https://pythonspeed.com/articles/numpy-2/). Mentioned in that article is that `scikit-image` has issues, which is indirect because the package has an optional dependency on `matplotlib` (I've discovered this whilst working on `skan` issues). The official [NumPy 2.0 migration guide — NumPy v2.0.dev0 Manual](https://numpy.org/devdocs/numpy_2_0_migration_guide.html) suggests that `ruff` can be leveraged to address the mentioned changes under [Ruff Plugin](https://numpy.org/devdocs/numpy_2_0_migration_guide.html#ruff-plugin). A useful summary of how to handle potential problems is provided at [Numpy #24300](numpy/numpy#24300) and broadly suggests pinning `numpy<2.0` for releases whilst development proceeds on resolving issues. --- .pre-commit-config.yaml | 5 +++-- lib/pyproject.toml | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index df0b167b..605b7df2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,6 +19,7 @@ repos: - id: fix-byte-order-marker - id: name-tests-test args: ["--pytest-test-first"] + - id: no-commit-to-branch # Protects main/master by default - id: requirements-txt-fixer - id: trailing-whitespace @@ -32,7 +33,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: "v0.1.9" + rev: "v0.1.11" hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] @@ -48,7 +49,7 @@ repos: # - svelte - repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.56.0 + rev: v9.0.0-alpha.0 hooks: - id: eslint types: [file] diff --git a/lib/pyproject.toml b/lib/pyproject.toml index 0f68ee3a..26a587e1 100644 --- a/lib/pyproject.toml +++ b/lib/pyproject.toml @@ -40,7 +40,7 @@ tests = [ "pytest>=7.0", "pytest-cov", "pytest-mpl", - "pytest-regtest", + "pytest-regtest<2.0.0", "pytest-xdist" ] docs = [ @@ -135,5 +135,9 @@ select = ["B", "E", "F", "W", "I001"] # Allow autofix for all enabled rules (when `--fix`) is provided. fixable = ["A", "B", "C", "D", "E", "F", "R", "S", "W", "U", "I001"] +[tool.ruff.lint] +extend-select = ["NPY201"] +preview = true + [project.scripts] find_pg = "pgfinder.find_pg:main"