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 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,10 @@ repos:
pass_filenames: false
require_serial: true
args: ["."]
- repo: local
- repo: https://github.com/psf/black
rev: 22.1.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`.
additional_dependencies: [black==21.9b0]
# This is here to defer file selection to black which will do it based on
# black config.
pass_filenames: false
require_serial: true
args: ["."]
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>`_.
* 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
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
[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
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
3 changes: 1 addition & 2 deletions requirements.dev.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
black==21.9b0
black
coverage
doctest-ignore-unicode==0.1.2
flake8
eggplants marked this conversation as resolved.
Show resolved Hide resolved
flake8-black
Copy link
Member

@aucampia aucampia Mar 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this?

html5lib
isort
mypy
Expand Down