Skip to content

Commit

Permalink
Bump black version and reformat
Browse files Browse the repository at this point in the history
A version bump is needed as the older version has become uninstallable,
apparently due to using some private API from click module.
  • Loading branch information
rohanpm committed Apr 1, 2022
1 parent 87db1c6 commit 46de169
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
7 changes: 3 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
repos:
- repo: https://github.com/ambv/black
rev: 026c81b83454f176a9f9253cbfb70be2c159d822
- repo: https://github.com/ambv/black
rev: 22.3.0
hooks:
- id: black
language_version: python3.6

language_version: python3.8
1 change: 0 additions & 1 deletion pubtools/pulplib/_impl/compat_attr.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def fields_dict(cls):
out[field.name] = field
return out


else:
fields_dict = attr.fields_dict

Expand Down
2 changes: 1 addition & 1 deletion pubtools/pulplib/_impl/fake/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ def _do_sync(self, repo_id, sync_config): # pylint:disable = unused-argument

def _next_task_id(self):
with self._lock:
next_raw_id = self._uuidgen.randint(0, 2 ** 128)
next_raw_id = self._uuidgen.randint(0, 2**128)
return str(uuid.UUID(int=next_raw_id))

def _next_request_id(self):
Expand Down
2 changes: 1 addition & 1 deletion pubtools/pulplib/_impl/fake/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self, seen_unit_ids):
def next_unit_id(self):
with self._lock:
while True:
next_raw_id = self._uuidgen.randint(0, 2 ** 128)
next_raw_id = self._uuidgen.randint(0, 2**128)
if next_raw_id not in self._seen_unit_ids:
break

Expand Down
4 changes: 4 additions & 0 deletions tests/comps/test_comps_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

from pubtools.pulplib._impl.comps import units_for_xml

# Don't use autoformatting in this file because we use u'' string literals
# at least until py2 support is dropped, and black wants to remove them...
# fmt: off


def test_can_parse_units(data_path):
"""units_for_xml parses typical comps.xml data correctly."""
Expand Down
6 changes: 3 additions & 3 deletions tests/repository/test_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ def test_upload_file(client, requests_mocker, tmpdir, caplog, fast_timed_logger)
# 4th call should be import, check if right unit_key's passed
import_request = requests_mocker.request_history[3].json()
import_unit_key = {
u"name": somefile.basename,
u"checksum": u"fad3fc1e6d583b2003ec0a5273702ed8fcc2504271c87c40d9176467ebe218cb",
u"size": 29,
"name": somefile.basename,
"checksum": "fad3fc1e6d583b2003ec0a5273702ed8fcc2504271c87c40d9176467ebe218cb",
"size": 29,
}
assert import_request["unit_key"] == import_unit_key

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ deps=
[testenv:static]
deps=
-rtest-requirements.txt
black==20.8b1
black==22.3.0
pylint==2.7.2
commands=
black --check .
Expand Down

0 comments on commit 46de169

Please sign in to comment.