diff --git a/jupyter_core/application.py b/jupyter_core/application.py index e55a657..1f7467f 100644 --- a/jupyter_core/application.py +++ b/jupyter_core/application.py @@ -37,7 +37,7 @@ base_aliases: dict[str, t.Any] = {} if isinstance(Application.aliases, dict): # traitlets 5 - base_aliases.update(Application.aliases) # type:ignore[arg-type] + base_aliases.update(Application.aliases) _jupyter_aliases = { "log-level": "Application.log_level", "config": "JupyterApp.config_file", @@ -47,7 +47,7 @@ base_flags: dict[str, t.Any] = {} if isinstance(Application.flags, dict): # traitlets 5 - base_flags.update(Application.flags) # type:ignore[arg-type] + base_flags.update(Application.flags) _jupyter_flags: dict[str, t.Any] = { "debug": ( {"Application": {"log_level": logging.DEBUG}}, @@ -72,8 +72,8 @@ class JupyterApp(Application): name = "jupyter" # override in subclasses description = "A Jupyter Application" - aliases = base_aliases # type:ignore[assignment] - flags = base_flags # type:ignore[assignment] + aliases = base_aliases + flags = base_flags def _log_level_default(self) -> int: return logging.INFO @@ -156,8 +156,6 @@ def ask() -> str: return config_text = self.generate_config_file() - if isinstance(config_text, bytes): - config_text = config_text.decode("utf8") print("Writing default config to: %s" % config_file) ensure_dir_exists(os.path.abspath(os.path.dirname(config_file)), 0o700) with open(config_file, mode="w", encoding="utf-8") as f: diff --git a/jupyter_core/command.py b/jupyter_core/command.py index 81549fe..6bd5f1f 100644 --- a/jupyter_core/command.py +++ b/jupyter_core/command.py @@ -209,7 +209,7 @@ def _evaluate_argcomplete(parser: JupyterParser) -> list[str]: if cwords and len(cwords) > 1 and not cwords[1].startswith("-"): # If first completion word looks like a subcommand, # increment word from which to start handling arguments - increment_argcomplete_index() # type:ignore[no-untyped-call] + increment_argcomplete_index() return cwords else: # Otherwise no subcommand, directly autocomplete and exit diff --git a/pyproject.toml b/pyproject.toml index ae05147..04f9276 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -88,7 +88,7 @@ nowarn = "test -W default {args}" [tool.hatch.envs.typing] features = ["test"] -dependencies = ["mypy>=1.5.1", "traitlets>=5.10.1"] +dependencies = ["mypy>=1.5.1", "traitlets>=5.11.2"] [tool.hatch.envs.typing.scripts] test = "mypy --install-types --non-interactive {args}"