From 94ec59571abb7bdb93fe47655a15eebf35c220f1 Mon Sep 17 00:00:00 2001 From: Min RK Date: Mon, 26 May 2025 12:52:13 +0200 Subject: [PATCH] Revert "breaking: require Python 3.9 (#426)" This reverts commit 25dc203a9f46eb16b64b1e8257d570aa9534f5a9. --- .github/workflows/test.yml | 4 +++- jupyter_core/paths.py | 3 +-- jupyter_core/utils/__init__.py | 3 +-- pyproject.toml | 4 ++-- tests/test_migrate.py | 5 ++--- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fab0033..efd3c0b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,8 +28,10 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.9", "3.12", "3.13"] + python-version: ["3.8", "3.12", "3.13"] include: + - os: windows-latest + python-version: "3.9" - os: ubuntu-latest python-version: "3.11" - os: ubuntu-latest diff --git a/jupyter_core/paths.py b/jupyter_core/paths.py index 3512d0e..a726357 100644 --- a/jupyter_core/paths.py +++ b/jupyter_core/paths.py @@ -15,10 +15,9 @@ import sys import tempfile import warnings -from collections.abc import Iterator from contextlib import contextmanager from pathlib import Path -from typing import Any, Literal, Optional, overload +from typing import Any, Iterator, Literal, Optional, overload import platformdirs diff --git a/jupyter_core/utils/__init__.py b/jupyter_core/utils/__init__.py index 4037b06..665eac2 100644 --- a/jupyter_core/utils/__init__.py +++ b/jupyter_core/utils/__init__.py @@ -9,11 +9,10 @@ import sys import threading import warnings -from collections.abc import Awaitable from contextvars import ContextVar from pathlib import Path from types import FrameType -from typing import Any, Callable, TypeVar, cast +from typing import Any, Awaitable, Callable, TypeVar, cast def ensure_dir_exists(path: str | Path, mode: int = 0o777) -> None: diff --git a/pyproject.toml b/pyproject.toml index 689e4c8..a7f60c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3" ] -requires-python = ">=3.9" +requires-python = ">=3.8" dependencies = [ "platformdirs>=2.5", "traitlets>=5.3", @@ -102,7 +102,7 @@ build = [ [tool.mypy] files = "jupyter_core" -python_version = "3.9" +python_version = "3.8" strict = true enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"] warn_unreachable = true diff --git a/tests/test_migrate.py b/tests/test_migrate.py index 0fe4d75..2beb2c8 100644 --- a/tests/test_migrate.py +++ b/tests/test_migrate.py @@ -132,9 +132,8 @@ def notice_m_dir(src, dst): called["migrate_dir"] = True return migrate_dir(src, dst) - with ( - patch.object(migrate_mod, "migrate_file", notice_m_file), - patch.object(migrate_mod, "migrate_dir", notice_m_dir), + with patch.object(migrate_mod, "migrate_file", notice_m_file), patch.object( + migrate_mod, "migrate_dir", notice_m_dir ): assert migrate_one(src, dst) assert called == {"migrate_file": True}