Define __all__ in __init__.py files

Fix ruff's F401 unused-import errors in these files.

Also sort them with: ruff check --extend-select RUF022 --fix.
This commit is contained in:
Štěpán Balážik 2026-01-28 18:49:34 +01:00
parent ffd5b6ac26
commit 2b9c5ccd77
6 changed files with 53 additions and 11 deletions

View file

@ -260,7 +260,7 @@ def configure_algorithm_set(request):
name = None
else:
name = mark.args[0]
isctest.vars.set_algorithm_set(name)
isctest.vars.algorithms.set_algorithm_set(name)
@pytest.fixture(autouse=True)

View file

@ -25,3 +25,15 @@ from . import ( # pylint: disable=redefined-builtin
# environment variables which might not be set at the time of import of the
# `isctest` package. To use the marks, manual `import isctest.mark` is needed
# instead.
__all__ = [
"check",
"hypothesis",
"instance",
"kasp",
"log",
"query",
"run",
"template",
"vars",
]

View file

@ -9,7 +9,9 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
# This ensures we're using a suitable hypothesis version. A newer version is
# required for FIPS-enabled platforms.
from . import settings, strategies
__all__ = [
"settings",
"strategies",
]

View file

@ -23,3 +23,19 @@ from .basic import (
warning,
)
from .watchlog import WatchLogFromHere, WatchLogFromStart
__all__ = [
"WatchLogFromHere",
"WatchLogFromStart",
"avoid_duplicated_logs",
"critical",
"debug",
"deinit_module_logger",
"deinit_test_logger",
"error",
"info",
"init_conftest_logger",
"init_module_logger",
"init_test_logger",
"warning",
]

View file

@ -12,18 +12,28 @@
import os
from .. import log
from .algorithms import init_crypto_supported, set_algorithm_set
from . import algorithms, basic, build, dirs, features, openssl, ports
from .all import ALL
from .features import init_features
from .openssl import parse_openssl_config
__all__ = [
"ALL",
"algorithms",
"basic",
"build",
"dirs",
"features",
"init_vars",
"openssl",
"ports",
]
def init_vars():
"""Initializes the environment variables."""
init_features()
init_crypto_supported()
set_algorithm_set(os.getenv("ALGORITHM_SET"))
parse_openssl_config(ALL["OPENSSL_CONF"])
features.init_features()
algorithms.init_crypto_supported()
algorithms.set_algorithm_set(os.getenv("ALGORITHM_SET"))
openssl.parse_openssl_config(ALL["OPENSSL_CONF"])
os.environ.update(ALL)
log.debug("setting following env vars: %s", ", ".join([str(key) for key in ALL]))

View file

@ -92,6 +92,8 @@ target-version = "py310"
lint.select = [
# import order
"I",
# sorted __all__
"RUF022",
# f-strings
"UP031",
"UP032",