Skip to content

Commit

Permalink
Ignore F401 in __init__.py
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ctrueden committed Jul 26, 2023
1 parent 0623161 commit 919d8f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ extend-ignore = ["E203"]
# See https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8
max-line-length = 88
min_python_version = "3.7"
per-file-ignores = "__init__.py:F401"

[tool.isort]
profile = "black"
12 changes: 6 additions & 6 deletions src/scyjava/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
from functools import lru_cache
from typing import Any, Callable, Dict

from ._arrays import is_arraylike, is_memoryarraylike, is_xarraylike # noqa: F401
from ._convert import ( # noqa: F401
from ._arrays import is_arraylike, is_memoryarraylike, is_xarraylike
from ._convert import (

Check warning on line 74 in src/scyjava/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/scyjava/__init__.py#L73-L74

Added lines #L73 - L74 were not covered by tests
Converter,
JavaCollection,
JavaIterable,
Expand All @@ -90,7 +90,7 @@
to_java,
to_python,
)
from ._jvm import ( # noqa: F401
from ._jvm import (

Check warning on line 93 in src/scyjava/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/scyjava/__init__.py#L93

Added line #L93 was not covered by tests
is_awt_initialized,
is_jvm_headless,
jimport,
Expand All @@ -101,8 +101,8 @@
when_jvm_starts,
when_jvm_stops,
)
from ._script import enable_python_scripting # noqa: F401
from ._types import ( # noqa: F401
from ._script import enable_python_scripting
from ._types import (

Check warning on line 105 in src/scyjava/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/scyjava/__init__.py#L104-L105

Added lines #L104 - L105 were not covered by tests
JavaClasses,
is_jarray,
isjava,
Expand All @@ -112,7 +112,7 @@
jstacktrace,
numeric_bounds,
)
from ._versions import compare_version, get_version, is_version_at_least # noqa: F401
from ._versions import compare_version, get_version, is_version_at_least

Check warning on line 115 in src/scyjava/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/scyjava/__init__.py#L115

Added line #L115 was not covered by tests

__version__ = get_version("scyjava")
__all__ = [
Expand Down

0 comments on commit 919d8f9

Please sign in to comment.