mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-28 23:20:09 +03:00
Update to the current version of Black and run it on Synapse codebase (#11596)
* update black version * run updated version of black on code * newsfragment * enumerate python versions
This commit is contained in:
parent
66d7aa783a
commit
fcfe67578f
5 changed files with 3 additions and 4 deletions
1
changelog.d/11596.misc
Normal file
1
changelog.d/11596.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Update black version and run it on all the files.
|
|
@ -35,7 +35,7 @@
|
||||||
showcontent = true
|
showcontent = true
|
||||||
|
|
||||||
[tool.black]
|
[tool.black]
|
||||||
target-version = ['py36']
|
target-version = ['py37', 'py38', 'py39', 'py310']
|
||||||
exclude = '''
|
exclude = '''
|
||||||
|
|
||||||
(
|
(
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -96,7 +96,7 @@ CONDITIONAL_REQUIREMENTS["all"] = list(ALL_OPTIONAL_REQUIREMENTS)
|
||||||
# We pin black so that our tests don't start failing on new releases.
|
# We pin black so that our tests don't start failing on new releases.
|
||||||
CONDITIONAL_REQUIREMENTS["lint"] = [
|
CONDITIONAL_REQUIREMENTS["lint"] = [
|
||||||
"isort==5.7.0",
|
"isort==5.7.0",
|
||||||
"black==21.6b0",
|
"black==21.12b0",
|
||||||
"flake8-comprehensions",
|
"flake8-comprehensions",
|
||||||
"flake8-bugbear==21.3.2",
|
"flake8-bugbear==21.3.2",
|
||||||
"flake8",
|
"flake8",
|
||||||
|
|
|
@ -68,7 +68,6 @@ try:
|
||||||
def get_thread_resource_usage() -> "Optional[resource.struct_rusage]":
|
def get_thread_resource_usage() -> "Optional[resource.struct_rusage]":
|
||||||
return resource.getrusage(RUSAGE_THREAD)
|
return resource.getrusage(RUSAGE_THREAD)
|
||||||
|
|
||||||
|
|
||||||
except Exception:
|
except Exception:
|
||||||
# If the system doesn't support resource.getrusage(RUSAGE_THREAD) then we
|
# If the system doesn't support resource.getrusage(RUSAGE_THREAD) then we
|
||||||
# won't track resource usage.
|
# won't track resource usage.
|
||||||
|
|
|
@ -69,7 +69,6 @@ try:
|
||||||
sizer.exclude_refs((), None, "")
|
sizer.exclude_refs((), None, "")
|
||||||
return sizer.asizeof(val, limit=100 if recurse else 0)
|
return sizer.asizeof(val, limit=100 if recurse else 0)
|
||||||
|
|
||||||
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
||||||
def _get_size_of(val: Any, *, recurse: bool = True) -> int:
|
def _get_size_of(val: Any, *, recurse: bool = True) -> int:
|
||||||
|
|
Loading…
Reference in a new issue