Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Update to the current version of Black and run it on Synapse codebase (
Browse files Browse the repository at this point in the history
…#11596)

* update black version

* run updated version of black on code

* newsfragment

* enumerate python versions
  • Loading branch information
H-Shay authored Dec 24, 2021
1 parent 66d7aa7 commit fcfe675
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.d/11596.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update black version and run it on all the files.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
showcontent = true

[tool.black]
target-version = ['py36']
target-version = ['py37', 'py38', 'py39', 'py310']
exclude = '''
(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def exec_file(path_segments):
# We pin black so that our tests don't start failing on new releases.
CONDITIONAL_REQUIREMENTS["lint"] = [
"isort==5.7.0",
"black==21.6b0",
"black==21.12b0",
"flake8-comprehensions",
"flake8-bugbear==21.3.2",
"flake8",
Expand Down
1 change: 0 additions & 1 deletion synapse/logging/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
def get_thread_resource_usage() -> "Optional[resource.struct_rusage]":
return resource.getrusage(RUSAGE_THREAD)


except Exception:
# If the system doesn't support resource.getrusage(RUSAGE_THREAD) then we
# won't track resource usage.
Expand Down
1 change: 0 additions & 1 deletion synapse/util/caches/lrucache.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def _get_size_of(val: Any, *, recurse: bool = True) -> int:
sizer.exclude_refs((), None, "")
return sizer.asizeof(val, limit=100 if recurse else 0)


except ImportError:

def _get_size_of(val: Any, *, recurse: bool = True) -> int:
Expand Down

0 comments on commit fcfe675

Please sign in to comment.