Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix black #1763

Merged
merged 7 commits into from
Mar 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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"
ashleysommer marked this conversation as resolved.
Show resolved Hide resolved
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
eggplants marked this conversation as resolved.
Show resolved Hide resolved
Expand Down