diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c63c37280..5589bfd7d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,21 +14,11 @@ repos: pass_filenames: false require_serial: true args: ["."] - - repo: local + - repo: https://github.com/psf/black + # WARNING: version should be the same as in `pyproject.toml` and `requirements.dev.txt`. + rev: 'refs/tags/22.3.0:refs/tags/22.3.0' hooks: - # using a local hook for black because of an issue that arises when using - # pre-commit and setuptools-scm that results in version info being lost. - # For more info see https://github.com/psf/black/issues/2493 - # Based on https://github.com/psf/black/blob/main/.pre-commit-hooks.yaml - id: black - name: black - description: "Black: The uncompromising Python code formatter" - entry: black - language: python - # WARNING: version should be the same as in `pyproject.toml` and `requirements.dev.txt`. - additional_dependencies: ["black>=22.0,<23"] - # This is here to defer file selection to black which will do it based on - # black config. pass_filenames: false require_serial: true args: ["."] diff --git a/docs/developers.rst b/docs/developers.rst index ff8778ca7..b716adc7b 100644 --- a/docs/developers.rst +++ b/docs/developers.rst @@ -10,7 +10,7 @@ This document describes the process and conventions to follow when developing RDFLib code. * Please be as Pythonic as possible (:pep:`8`). -* Code should be formatted using `black `_ and we use Black v22.1.0, with the black config in ``pyproject.toml``. +* Code should be formatted using `black `_ and we use Black v22.3.0, with the black config in ``pyproject.toml``. * Code should also pass `flake8 `_ linting and `mypy `_ type checking. * You must supply tests for new code. diff --git a/pyproject.toml b/pyproject.toml index 0b272327f..8341c9c69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.black] -required-version = "22.1.0" +required-version = "22.3.0" line-length = "88" skip-string-normalization = true target-version = ['py37'] diff --git a/requirements.dev.txt b/requirements.dev.txt index afd61309e..085249d22 100644 --- a/requirements.dev.txt +++ b/requirements.dev.txt @@ -1,4 +1,4 @@ -black==22.1.0 +black==22.3.0 coverage doctest-ignore-unicode==0.1.2 flake8 diff --git a/setup.py b/setup.py index fb001dee7..3a2014963 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ "berkeleydb": ["berkeleydb"], "networkx": ["networkx"], "dev": [ - "black==22.1.0", + "black==22.3.0", "mypy", "flake8", "flake8-black",