Skip to content

Commit 8284fc3

Browse files
authored
Update typings for traitlets 5.11 (#366)
1 parent 269bb70 commit 8284fc3

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

jupyter_core/application.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
base_aliases: dict[str, t.Any] = {}
3838
if isinstance(Application.aliases, dict):
3939
# traitlets 5
40-
base_aliases.update(Application.aliases) # type:ignore[arg-type]
40+
base_aliases.update(Application.aliases)
4141
_jupyter_aliases = {
4242
"log-level": "Application.log_level",
4343
"config": "JupyterApp.config_file",
@@ -47,7 +47,7 @@
4747
base_flags: dict[str, t.Any] = {}
4848
if isinstance(Application.flags, dict):
4949
# traitlets 5
50-
base_flags.update(Application.flags) # type:ignore[arg-type]
50+
base_flags.update(Application.flags)
5151
_jupyter_flags: dict[str, t.Any] = {
5252
"debug": (
5353
{"Application": {"log_level": logging.DEBUG}},
@@ -72,8 +72,8 @@ class JupyterApp(Application):
7272
name = "jupyter" # override in subclasses
7373
description = "A Jupyter Application"
7474

75-
aliases = base_aliases # type:ignore[assignment]
76-
flags = base_flags # type:ignore[assignment]
75+
aliases = base_aliases
76+
flags = base_flags
7777

7878
def _log_level_default(self) -> int:
7979
return logging.INFO
@@ -156,8 +156,6 @@ def ask() -> str:
156156
return
157157

158158
config_text = self.generate_config_file()
159-
if isinstance(config_text, bytes):
160-
config_text = config_text.decode("utf8")
161159
print("Writing default config to: %s" % config_file)
162160
ensure_dir_exists(os.path.abspath(os.path.dirname(config_file)), 0o700)
163161
with open(config_file, mode="w", encoding="utf-8") as f:

jupyter_core/command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def _evaluate_argcomplete(parser: JupyterParser) -> list[str]:
209209
if cwords and len(cwords) > 1 and not cwords[1].startswith("-"):
210210
# If first completion word looks like a subcommand,
211211
# increment word from which to start handling arguments
212-
increment_argcomplete_index() # type:ignore[no-untyped-call]
212+
increment_argcomplete_index()
213213
return cwords
214214
else:
215215
# Otherwise no subcommand, directly autocomplete and exit

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ nowarn = "test -W default {args}"
8888

8989
[tool.hatch.envs.typing]
9090
features = ["test"]
91-
dependencies = ["mypy>=1.5.1", "traitlets>=5.10.1"]
91+
dependencies = ["mypy>=1.5.1", "traitlets>=5.11.2"]
9292
[tool.hatch.envs.typing.scripts]
9393
test = "mypy --install-types --non-interactive {args}"
9494

0 commit comments

Comments
 (0)