Skip to content

Commit 919d8f9

Browse files
committed
Ignore F401 in __init__.py
Because the nicest modular Pythonic design is to import all your public API from supporting files into __init__.py, so they are available from the toplevel, and we don't want flake8 yelling at us about it. Thanks to @gselzer and https://stackoverflow.com/a/58029222/1207769.
1 parent 0623161 commit 919d8f9

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ extend-ignore = ["E203"]
7878
# See https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8
7979
max-line-length = 88
8080
min_python_version = "3.7"
81+
per-file-ignores = "__init__.py:F401"
8182

8283
[tool.isort]
8384
profile = "black"

src/scyjava/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
from functools import lru_cache
7171
from typing import Any, Callable, Dict
7272

73-
from ._arrays import is_arraylike, is_memoryarraylike, is_xarraylike # noqa: F401
74-
from ._convert import ( # noqa: F401
73+
from ._arrays import is_arraylike, is_memoryarraylike, is_xarraylike
74+
from ._convert import (
7575
Converter,
7676
JavaCollection,
7777
JavaIterable,
@@ -90,7 +90,7 @@
9090
to_java,
9191
to_python,
9292
)
93-
from ._jvm import ( # noqa: F401
93+
from ._jvm import (
9494
is_awt_initialized,
9595
is_jvm_headless,
9696
jimport,
@@ -101,8 +101,8 @@
101101
when_jvm_starts,
102102
when_jvm_stops,
103103
)
104-
from ._script import enable_python_scripting # noqa: F401
105-
from ._types import ( # noqa: F401
104+
from ._script import enable_python_scripting
105+
from ._types import (
106106
JavaClasses,
107107
is_jarray,
108108
isjava,
@@ -112,7 +112,7 @@
112112
jstacktrace,
113113
numeric_bounds,
114114
)
115-
from ._versions import compare_version, get_version, is_version_at_least # noqa: F401
115+
from ._versions import compare_version, get_version, is_version_at_least
116116

117117
__version__ = get_version("scyjava")
118118
__all__ = [

0 commit comments

Comments
 (0)