From f81186b2f31fe79949fe5bcd5ea0da6b0794a8fb Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Sun, 31 Dec 2023 05:15:38 -0700 Subject: [PATCH] Fix export of package version (#386) --- jupyter_core/__init__.py | 3 +++ pyproject.toml | 7 +++---- tests/test_command.py | 5 +++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/jupyter_core/__init__.py b/jupyter_core/__init__.py index e69de29b..5e868478 100644 --- a/jupyter_core/__init__.py +++ b/jupyter_core/__init__.py @@ -0,0 +1,3 @@ +from __future__ import annotations + +from .version import __version__, version_info # noqa: F401 diff --git a/pyproject.toml b/pyproject.toml index d7f61569..9a224e61 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -185,10 +185,9 @@ ignore = [ "RUF012" # Mutable class attributes should be annotated ] unfixable = [ - # Don't touch print statements - "T201", - # Don't touch noqa lines - "RUF100", + "T201", # Don't touch print statements + "RUF100", # Don't touch noqa lines + "F401" # Unused imports ] isort.required-imports = ["from __future__ import annotations"] diff --git a/tests/test_command.py b/tests/test_command.py index ff8731ca..7a0b8992 100644 --- a/tests/test_command.py +++ b/tests/test_command.py @@ -10,6 +10,7 @@ import pytest +from jupyter_core import __version__ from jupyter_core.command import list_subcommands from jupyter_core.paths import ( jupyter_config_dir, @@ -248,3 +249,7 @@ def test_argv0(tmpdir): # Make sure the first argv is the full path to the executing script assert f"{jupyter}-witness".encode() in out + + +def test_version(): + assert isinstance(__version__, str)