8000 MAINT: run black on runtests.py · numpy/numpy-stubs@415b593 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jun 10, 2020. It is now read-only.

Commit 415b593

Browse files
committed
MAINT: run black on runtests.py
1 parent e2d43df commit 415b593

File tree

1 file changed

+32
-33
lines changed

1 file changed

+32
-33
lines changed

runtests.py

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,35 @@
1313
# Technically "public" functions (they don't start with an underscore)
1414
# that we don't want to include.
1515
BLACKLIST = {
16-
'numpy': {
16+
"numpy": {
1717
# Stdlib modules in the namespace by accident
18-
'absolute_import',
19-
'warnings',
18+
"absolute_import",
19+
"warnings",
2020
# Accidentally public
21-
'add_docstring',
22-
'add_newdoc',
23-
'add_newdoc_ufunc',
21+
"add_docstring",
22+
"add_newdoc",
23+
"add_newdoc_ufunc",
2424
# Builtins
25-
'bool',
26-
'complex',
27-
'float',
28-
'int',
29-
'long',
30-
'object',
31-
'str',
32-
'unicode',
25+
"bool",
26+
"complex",
27+
"float",
28+
"int",
29+
"long",
30+
"object",
31+
"str",
32+
"unicode",
3333
# Should use numpy_financial instead
34-
'fv',
35-
'ipmt',
36-
'irr',
37-
'mirr',
38-
'nper',
39-
'npv',
40-
'pmt',
41-
'ppmt',
42-
'pv',
43-
'rate',
44-
},
34+
"fv",
35+
"ipmt",
36+
"irr",
37+
"mirr",
38+
"nper",
39+
"npv",
40+
"pmt",
41+
"ppmt",
42+
"pv",
43+
"rate",
44+
}
4545
}
4646

4747

@@ -60,7 +60,7 @@ def __init__(self):
6060
self.attributes = set()
6161

6262
def visit_FunctionDef(self, node):
63-
if node.name == '__getattr__':
63+
if node.name == "__getattr__":
6464
# Not really a module member.
6565
return
6666
self.attributes.add(node.name)
@@ -69,7 +69,7 @@ def visit_FunctionDef(self, node):
6969
return
7070

7171
def visit_ClassDef(self, node):
72-
if not node.name.startswith('_'):
72+
if not node.name.startswith("_"):
7373
self.attributes.add(node.name)
7474
return
7575

@@ -80,14 +80,13 @@ def visit_AnnAssign(self, node):
8080
def find_missing(module_name):
8181
module_path = os.path.join(
8282
STUBS_ROOT,
83-
module_name.replace('numpy', 'numpy-stubs').replace('.', os.sep),
84-
'__init__.pyi',
83+
module_name.replace("numpy", "numpy-stubs").replace(".", os.sep),
84+
"__init__.pyi",
8585
)
8686

8787
module = importlib.import_module(module_name)
8888
module_attributes = {
89-
attribute for attribute in dir(module)
90-
if not attribute.startswith('_')
89+
attribute for attribute in dir(module) if not attribute.startswith("_")
9190
}
9291

9392
if os.path.isfile(module_path):
@@ -103,7 +102,7 @@ def find_missing(module_name):
103102
blacklist = BLACKLIST.get(module_name, set())
104103

105104
missing = module_attributes - stubs_attributes - blacklist
106-
print('\n'.join(sorted(missing)))
105+
print("\n".join(sorted(missing)))
107106

108107

109108
def run_pytest(argv):
@@ -117,7 +116,7 @@ def run_pytest(argv):
117116

118117
def main():
119118
parser = argparse.ArgumentParser()
120-
parser.add_argument('--find-missing')
119+
parser.add_argument("--find-missing")
121120
args, remaining_argv = parser.parse_known_args()
122121

123122
if args.find_missing is not None:

0 commit comments

Comments
 (0)
0