Skip to content

Commit

Permalink
Merge pull request #1763 from eggplants/fix_black
Browse files Browse the repository at this point in the history
Fix black
  • Loading branch information
nicholascar authored Mar 17, 2022
2 parents cc9ac04 + 9abbbcb commit 8ef6ece
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ repos:
description: "Black: The uncompromising Python code formatter"
entry: black
language: python
# WARNING: version should be the same as in `pyproject.toml`.
additional_dependencies: [black==21.9b0]
# 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
Expand Down
3 changes: 1 addition & 2 deletions docs/developers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +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 <https://github.com/psf/black>`_
and we use Black v21.9b0, with the black.toml config file provided.
* Code should be formatted using `black <https://github.com/psf/black>`_ and we use Black v22.1.0, with the black config in ``pyproject.toml``.
* Code should also pass `flake8 <https://github.com/psf/black>`_ linting
and `mypy <http://mypy-lang.org/>`_ type checking.
* You must supply tests for new code
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[tool.black]
# WARNING: This should be the same as in `.pre-commit-config.yaml`.
required-version = "21.9b0"
required-version = "22.1.0"
line-length = "88"
skip-string-normalization = true
target-version = ['py37']
Expand Down
15 changes: 6 additions & 9 deletions rdflib/plugins/stores/berkeleydb.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,12 @@ def add(self, triple, context, quoted=False, txn=None):
def __remove(self, spo, c, quoted=False, txn=None):
s, p, o = spo
cspo, cpos, cosp = self.__indicies
contexts_value = (
cspo.get(
"^".encode("latin-1").join(
["".encode("latin-1"), s, p, o, "".encode("latin-1")]
),
txn=txn,
)
or "".encode("latin-1")
)
contexts_value = cspo.get(
"^".encode("latin-1").join(
["".encode("latin-1"), s, p, o, "".encode("latin-1")]
),
txn=txn,
) or "".encode("latin-1")
contexts = set(contexts_value.split("^".encode("latin-1")))
contexts.discard(c)
contexts_value = "^".encode("latin-1").join(contexts)
Expand Down
2 changes: 1 addition & 1 deletion requirements.dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
black==21.9b0
black==22.1.0
coverage
doctest-ignore-unicode==0.1.2
flake8
Expand Down

0 comments on commit 8ef6ece

Please sign in to comment.