Skip to content

Commit

Permalink
refacto(cleanup): fix some type hints and relative imports (#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
Guts authored Aug 30, 2024
1 parent e0e5a80 commit 240d9f2
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 21 deletions.
4 changes: 0 additions & 4 deletions qgis_deployment_toolbelt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
#! python3 # noqa: E265

# submodules
from .__about__ import __version__ # noqa: F401
6 changes: 1 addition & 5 deletions qgis_deployment_toolbelt/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@
from qgis_deployment_toolbelt.commands.upgrade import parser_upgrade
from qgis_deployment_toolbelt.utils.journalizer import configure_logger

# #############################################################################
# ########## Globals ###############
# ##################################

# ############################################################################
# ########## FUNCTIONS ###########
# ################################
Expand Down Expand Up @@ -84,7 +80,7 @@ def add_common_arguments(
def set_default_subparser(
parser_to_update: argparse.ArgumentParser,
default_subparser_name: str,
args: list = None,
args: list | None = None,
):
"""Set a default subparser to a parent parser. Call after setup and just before
parse_args().
Expand Down
7 changes: 0 additions & 7 deletions qgis_deployment_toolbelt/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +0,0 @@
#! python3 # noqa: E265

"""Common tools and helpers."""

# submodules
from .proxies import get_proxy_settings # noqa: E402 F401
from .str2bool import str2bool # noqa: E402 F401
4 changes: 2 additions & 2 deletions qgis_deployment_toolbelt/utils/journalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
# ################################


def configure_logger(verbosity: int = 1, logfile: Path = None):
def configure_logger(verbosity: int = 1, logfile: None | Path | str = None):
"""Configure logging according to verbosity from CLI.
Args:
Expand Down Expand Up @@ -169,5 +169,5 @@ def get_logger_filepath() -> Path | None:
if hasattr(handler, "baseFilename"):
return Path(handler.baseFilename)

logger.warning("No file found in ay log handlers.")
logger.warning("No file found in any log handlers.")
return None
2 changes: 1 addition & 1 deletion tests/test_job_environment_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from qgis_deployment_toolbelt.jobs.job_environment_variables import (
JobEnvironmentVariables,
)
from qgis_deployment_toolbelt.utils import str2bool
from qgis_deployment_toolbelt.utils.str2bool import str2bool

# 3rd party

Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils_proxies.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from os import environ

# project
from qgis_deployment_toolbelt.utils import get_proxy_settings
from qgis_deployment_toolbelt.utils.proxies import get_proxy_settings

# ############################################################################
# ########## Classes #############
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils_str2bool.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import unittest

# project
from qgis_deployment_toolbelt.utils import str2bool
from qgis_deployment_toolbelt.utils.str2bool import str2bool

# ############################################################################
# ########## Classes #############
Expand Down

0 comments on commit 240d9f2

Please sign in to comment.