Skip to content

Commit

Permalink
Drop support for Python 3.10 as recommended in https://scientific-pyt…
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Fleming committed Nov 1, 2024
1 parent 95c22d9 commit 2ddfaec
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 61 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
python: ['3.10', '3.12']
python: ['3.11', '3.13']
include:
- python: '3.10'
- python: '3.11'
dist: 'ipylab*.tar.gz'
- python: '3.12'
- python: '3.13'
dist: 'ipylab*.whl'
- os: windows
py_cmd: python
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jupyter lab

```bash
# create a new conda environment
mamba create -n ipylab -c conda-forge nodejs python=3.10 -y
mamba create -n ipylab -c conda-forge nodejs python=3.11 -y

# activate the environment
conda activate ipylab
Expand Down
4 changes: 2 additions & 2 deletions ipylab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _jupyter_labextension_paths():
return [{"src": "labextension", "dest": "ipylab"}]


JupyterFrontEnd = App

plugin_manager = _get_plugin_manager()
del _get_plugin_manager

JupyterFrontEnd = App
17 changes: 0 additions & 17 deletions ipylab/_compat/enum.py

This file was deleted.

9 changes: 4 additions & 5 deletions ipylab/_compat/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
from __future__ import annotations

import sys
from typing import TYPE_CHECKING, Any, TypeAlias, TypedDict

if sys.version_info < (3, 11):
from typing_extensions import NotRequired, Self, TypedDict, Unpack, override
if sys.version_info < (3, 12):
from typing_extensions import override
else:
from typing import NotRequired, Self, TypedDict, Unpack, override
from typing import override

__all__ = ["NotRequired", "TYPE_CHECKING", "Any", "TypeAlias", "TypedDict", "Self", "Unpack", "override"]
__all__ = ["override"]


def __dir__() -> list[str]:
Expand Down
18 changes: 9 additions & 9 deletions ipylab/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

import functools
import inspect
from typing import TYPE_CHECKING, ClassVar
from typing import TYPE_CHECKING, Any, ClassVar, NotRequired, TypedDict, Unpack

from ipywidgets import TypedTuple
from traitlets import Bool, Container, Dict, Instance, Tuple, Unicode
from traitlets import Callable as CallableTrait

from ipylab._compat.typing import Any, NotRequired, TypedDict, Unpack, override
from ipylab._compat.typing import override
from ipylab.common import IpylabKwgs, Obj, TaskHooks, TransformType, pack
from ipylab.connection import Connection
from ipylab.ipylab import Ipylab, IpylabBase, Transform, register
Expand All @@ -30,14 +30,14 @@

class CommandOptions(TypedDict):
caption: NotRequired[str]
className: NotRequired[str] # noqa: N815
className: NotRequired[str]
dataset: NotRequired[Any]
describedBy: NotRequired[dict] # noqa: N815
iconClass: NotRequired[str] # noqa: N815
iconLabel: NotRequired[str] # noqa: N815
isEnabled: NotRequired[bool] # noqa: N815
isToggled: NotRequired[bool] # noqa: N815
isVisible: NotRequired[bool] # noqa: N815
describedBy: NotRequired[dict]
iconClass: NotRequired[str]
iconLabel: NotRequired[str]
isEnabled: NotRequired[bool]
isToggled: NotRequired[bool]
isVisible: NotRequired[bool]
label: NotRequired[str]
mnemonic: NotRequired[str]
usage: NotRequired[str]
Expand Down
9 changes: 4 additions & 5 deletions ipylab/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@

import inspect
import typing
from typing import TYPE_CHECKING, Any, Literal
from enum import StrEnum
from typing import TYPE_CHECKING, Any, Literal, NotRequired, TypedDict

import pluggy
from ipywidgets import Widget, widget_serialization

import ipylab
from ipylab._compat.enum import StrEnum
from ipylab._compat.typing import NotRequired, TypedDict

__all__ = ["Area", "Obj", "InsertMode", "Transform", "TransformType", "hookimpl", "pack", "IpylabKwgs"]

Expand Down Expand Up @@ -213,8 +212,8 @@ class TransformDictConnection(TypedDict):

class IpylabKwgs(TypedDict):
transform: NotRequired[TransformType]
toLuminoWidget: NotRequired[list[str]] # noqa: N815
toObject: NotRequired[list[str]] # noqa: N815
toLuminoWidget: NotRequired[list[str]]
toObject: NotRequired[list[str]]
hooks: NotRequired[TaskHookType]


Expand Down
4 changes: 1 addition & 3 deletions ipylab/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@

if TYPE_CHECKING:
from collections.abc import Generator
from typing import Literal, overload

from ipylab._compat.typing import Self
from typing import Literal, Self, overload


@register
Expand Down
3 changes: 1 addition & 2 deletions ipylab/ipylab.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
if TYPE_CHECKING:
from asyncio import Task
from collections.abc import Awaitable, Callable, Hashable
from typing import ClassVar
from typing import ClassVar, Self, Unpack

from ipylab import App
from ipylab._compat.typing import Self, Unpack


__all__ = ["Ipylab", "WidgetBase"]
Expand Down
4 changes: 2 additions & 2 deletions ipylab/jupyterfrontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import inspect
import logging
from collections import OrderedDict
from typing import TYPE_CHECKING, Any
from typing import TYPE_CHECKING, Any, Unpack

import ipywidgets
from IPython.core.getipython import get_ipython
Expand All @@ -17,7 +17,7 @@
import ipylab
import ipylab.hookspecs
from ipylab import Ipylab, ShellConnection, Transform
from ipylab._compat.typing import Unpack, override
from ipylab._compat.typing import override
from ipylab.commands import CommandPalette, CommandRegistry
from ipylab.common import InsertMode, IpylabKwgs, Obj, pack
from ipylab.dialog import Dialog
Expand Down
6 changes: 2 additions & 4 deletions ipylab/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
from __future__ import annotations

import logging
from typing import TYPE_CHECKING, Any, Literal

from ipylab._compat.enum import StrEnum
from ipylab._compat.typing import TypedDict
from enum import StrEnum
from typing import TYPE_CHECKING, Any, Literal, TypedDict

if TYPE_CHECKING:
from ipywidgets import Widget
Expand Down
4 changes: 2 additions & 2 deletions ipylab/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
from __future__ import annotations

import inspect
from typing import TYPE_CHECKING, Literal
from typing import TYPE_CHECKING, Literal, NotRequired, TypedDict

import traitlets
from ipywidgets import TypedTuple, register
from traitlets import Bool, Container, Dict, Instance, Unicode

from ipylab import Connection, NotificationType, Transform, pack
from ipylab._compat.typing import NotRequired, TypedDict, override
from ipylab._compat.typing import override
from ipylab.common import Obj, TaskHooks, TransformType
from ipylab.ipylab import Ipylab, IpylabBase

Expand Down
2 changes: 1 addition & 1 deletion ipylab/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

if TYPE_CHECKING:
from asyncio import Task
from typing import Unpack

from ipylab import App
from ipylab._compat.typing import Unpack


@register
Expand Down
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build-backend = "hatchling.build"
name = "ipylab"
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.10"
requires-python = ">=3.11"
classifiers = [
"Framework :: Jupyter",
"Framework :: Jupyter :: JupyterLab",
Expand All @@ -20,9 +20,9 @@ classifiers = [
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]


Expand All @@ -31,8 +31,7 @@ dependencies = [
"ipywidgets>=8.1.5",
"jupyterlab_widgets>=3.0.11",
"pluggy~=1.1",
"backports.strenum; python_version < '3.11'",
"typing_extensions; python_version < '3.11'",
"typing_extensions; python_version < '3.12'",
]
dynamic = ["version", "description", "authors", "urls", "keywords"]

Expand Down Expand Up @@ -94,7 +93,7 @@ ignore = ["W002"]

[tool.ruff]
extend = "ruff_defaults.toml"
target-version = "py310"
target-version = "py311"
src = ['docs']

[tool.codespell]
Expand Down

0 comments on commit 2ddfaec

Please sign in to comment.