diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,6 +43,6 @@ - id: isort - repo: https://github.com/python/black - rev: 19.10b0 + rev: 20.8b1 hooks: - id: black diff --git a/swh/provenance/postgresql/provenancedb_with_path.py b/swh/provenance/postgresql/provenancedb_with_path.py --- a/swh/provenance/postgresql/provenancedb_with_path.py +++ b/swh/provenance/postgresql/provenancedb_with_path.py @@ -150,7 +150,8 @@ src0_sha1s = tuple(set(sha1 for (sha1, _, _) in self.insert_cache[dst_table])) fmt = ",".join(["%s"] * len(src0_sha1s)) self.cursor.execute( - f"""SELECT sha1, id FROM {src0_table} WHERE sha1 IN ({fmt})""", src0_sha1s, + f"""SELECT sha1, id FROM {src0_table} WHERE sha1 IN ({fmt})""", + src0_sha1s, ) src0_values = dict(self.cursor.fetchall()) @@ -158,7 +159,8 @@ src1_sha1s = tuple(set(sha1 for (_, sha1, _) in self.insert_cache[dst_table])) fmt = ",".join(["%s"] * len(src1_sha1s)) self.cursor.execute( - f"""SELECT sha1, id FROM {src1_table} WHERE sha1 IN ({fmt})""", src1_sha1s, + f"""SELECT sha1, id FROM {src1_table} WHERE sha1 IN ({fmt})""", + src1_sha1s, ) src1_values = dict(self.cursor.fetchall()) @@ -175,7 +177,8 @@ # fetch location ids fmt = ",".join(["%s"] * len(locations)) self.cursor.execute( - f"SELECT path, id FROM location WHERE path IN ({fmt})", locations, + f"SELECT path, id FROM location WHERE path IN ({fmt})", + locations, ) loc_ids = dict(self.cursor.fetchall()) diff --git a/swh/provenance/revision.py b/swh/provenance/revision.py --- a/swh/provenance/revision.py +++ b/swh/provenance/revision.py @@ -50,7 +50,9 @@ if date.tzinfo is None: date = date.replace(tzinfo=timezone.utc) return RevisionEntry( - hash_to_bytes(id), date=date, root=hash_to_bytes(root), + hash_to_bytes(id), + date=date, + root=hash_to_bytes(root), ) diff --git a/swh/provenance/tests/test_cli.py b/swh/provenance/tests/test_cli.py --- a/swh/provenance/tests/test_cli.py +++ b/swh/provenance/tests/test_cli.py @@ -32,7 +32,10 @@ def test_cli_create_deprecated(provenance_db, tmp_path): conffile = tmp_path / "config.yml" conf = { - "provenance": {"cls": "local", "with_path": True,}, + "provenance": { + "cls": "local", + "with_path": True, + }, } yaml.dump(conf, conffile.open("w")) result = CliRunner().invoke( diff --git a/swh/provenance/tests/test_provenance_db.py b/swh/provenance/tests/test_provenance_db.py --- a/swh/provenance/tests/test_provenance_db.py +++ b/swh/provenance/tests/test_provenance_db.py @@ -82,7 +82,9 @@ storage, data = storage_and_CMDBTS for revision in data["revision"]: entry = RevisionEntry( - id=revision["id"], date=ts2dt(revision["date"]), root=revision["directory"], + id=revision["id"], + date=ts2dt(revision["date"]), + root=revision["directory"], ) revision_add(provenance, archive, entry) @@ -236,7 +238,9 @@ for synth_rev in synthetic_result(syntheticfile): revision = revisions[synth_rev["sha1"]] entry = RevisionEntry( - id=revision["id"], date=ts2dt(revision["date"]), root=revision["directory"], + id=revision["id"], + date=ts2dt(revision["date"]), + root=revision["directory"], ) revision_add(provenance, archive, entry, **args) diff --git a/tox.ini b/tox.ini --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,7 @@ [testenv:black] skip_install = true deps = - black==19.10b0 + black==20.8b1 commands = {envpython} -m black --check swh