chore: adding extra checks, more scoping (#867)

* chore: adding extra checks, more scoping

* Remove 'manual' pre-commit checks from CI

Co-authored-by: Joe Rickerby <joerick@mac.com>
This commit is contained in:
Henry Schreiner
2021-10-16 21:31:20 -04:00
committed by GitHub
co-authored by Joe Rickerby
parent bf36398572
commit f511961b40
10 changed files with 50 additions and 30 deletions
+1 -1
View File
@@ -166,7 +166,7 @@ def main() -> None:
os.environ["CIBUILDWHEEL"] = "1"
# Python is buffering by default when running on the CI platforms, giving problems interleaving subprocess call output with unflushed calls to 'print'
sys.stdout = Unbuffered(sys.stdout) # type: ignore
sys.stdout = Unbuffered(sys.stdout) # type: ignore[no-untyped-call,assignment]
print_preamble(platform, build_options)
+1 -1
View File
@@ -180,7 +180,7 @@ class ConfigOptions:
# get the option from the environment, then the config file, then finally the default.
# platform-specific options are preferred, if they're allowed.
result = _dig_first(
(os.environ if env_plat else {}, plat_envvar), # type: ignore
(os.environ if env_plat else {}, plat_envvar), # type: ignore[arg-type]
(os.environ, envvar),
(self.config_platform_options, name),
(self.config_options, name),
+2 -2
View File
@@ -27,7 +27,7 @@ class Analyzer(ast.NodeVisitor):
def visit(self, content: ast.AST) -> None:
for node in ast.walk(content):
for child in ast.iter_child_nodes(node):
child.parent = node # type: ignore
child.parent = node # type: ignore[attr-defined]
super().visit(content)
def visit_keyword(self, node: ast.keyword) -> None:
@@ -35,7 +35,7 @@ class Analyzer(ast.NodeVisitor):
if node.arg == "python_requires":
# Must not be nested in an if or other structure
# This will be Module -> Expr -> Call -> keyword
if not hasattr(node.parent.parent.parent, "parent") and isinstance( # type: ignore
if not hasattr(node.parent.parent.parent, "parent") and isinstance( # type: ignore[attr-defined]
node.value, Constant
):
self.requires_python = get_constant(node.value)
+4 -4
View File
@@ -157,18 +157,18 @@ class TestSelector(IdentifierSelector):
# Taken from https://stackoverflow.com/a/107717
class Unbuffered:
def __init__(self, stream): # type: ignore
def __init__(self, stream): # type: ignore[no-untyped-def]
self.stream = stream
def write(self, data): # type: ignore
def write(self, data): # type: ignore[no-untyped-def]
self.stream.write(data)
self.stream.flush()
def writelines(self, data): # type: ignore
def writelines(self, data): # type: ignore[no-untyped-def]
self.stream.writelines(data)
self.stream.flush()
def __getattr__(self, attr): # type: ignore
def __getattr__(self, attr): # type: ignore[no-untyped-def]
return getattr(self.stream, attr)