Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.13"]
python-version: ["3.10", "3.13", "3.14"]

steps:
- uses: actions/checkout@v7
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ DataLab-Kernel uses **xeus-python** as its backend, which provides:

The kernel requires:

- Python 3.10 or later
- `xeus-python>=0.17.0` - The xeus-based Python kernel
- `xeus-python-shell>=0.6.0` - Python shell utilities for xeus-python
- `sigima>=1.0` - Scientific signal and image processing
Expand Down
8 changes: 4 additions & 4 deletions datalab_kernel/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

from __future__ import annotations

import sys

from datalab_kernel import __version__

# Kernel metadata (used by kernel spec and for identification)
Expand All @@ -25,11 +27,11 @@
KERNEL_IMPLEMENTATION = "datalab-kernel"
KERNEL_IMPLEMENTATION_VERSION = __version__
KERNEL_LANGUAGE = "python"
KERNEL_LANGUAGE_VERSION = "3.9"
KERNEL_LANGUAGE_VERSION = f"{sys.version_info.major}.{sys.version_info.minor}"

KERNEL_LANGUAGE_INFO = {
"name": "python",
"version": "3.9",
"version": KERNEL_LANGUAGE_VERSION,
"mimetype": "text/x-python",
"codemirror_mode": {"name": "ipython", "version": 3},
"pygments_lexer": "ipython3",
Expand Down Expand Up @@ -79,8 +81,6 @@ def launch_kernel():

It launches xeus-python with the DataLab startup configuration.
"""
import sys

# Import and launch xeus-python
try:
# xeus-python provides an extension module for launching
Expand Down
6 changes: 3 additions & 3 deletions datalab_kernel/matplotlib_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def _add_table_results_to_axes(

# Format each row (typically just one row for statistics)
for row in data:
for header, value in zip(headers, row):
for header, value in zip(headers, row, strict=False):
# Format numeric values
if isinstance(value, float):
if abs(value) < 0.001 or abs(value) >= 10000:
Expand All @@ -184,7 +184,7 @@ def _add_table_results_to_axes(
coords = (
geometry.coords[0] if geometry.coords.ndim > 1 else geometry.coords
)
for label, value in zip(coord_labels, coords):
for label, value in zip(coord_labels, coords, strict=False):
if isinstance(value, float):
if abs(value) < 0.001 or abs(value) >= 10000:
formatted = f"{value:.3g}"
Expand Down Expand Up @@ -1187,7 +1187,7 @@ def _render_to_png(self) -> bytes:
all_geo_results: list = []

for idx, (ax, img, img_title, result) in enumerate(
zip(axes_flat, self._objs, titles, results_list)
zip(axes_flat, self._objs, titles, results_list, strict=False)
):
obj_type = type(img).__name__

Expand Down
18 changes: 12 additions & 6 deletions datalab_kernel/plotly_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def _build_annotation_text(
lines.append(f"<b>{table.title}:</b>")
headers = list(table.headers)
for row in table.data:
for header, value in zip(headers, row):
for header, value in zip(headers, row, strict=False):
if isinstance(value, float):
formatted = (
f"{value:.3g}"
Expand All @@ -264,7 +264,7 @@ def _build_annotation_text(
coords = (
geometry.coords[0] if geometry.coords.ndim > 1 else geometry.coords
)
for lbl, val in zip(coord_labels, coords):
for lbl, val in zip(coord_labels, coords, strict=False):
if isinstance(val, float):
formatted = (
f"{val:.3g}"
Expand Down Expand Up @@ -474,7 +474,11 @@ def _add_image_roi_shapes(
# Close the polygon
xs = list(points[:, 0]) + [points[0, 0]]
ys = list(points[:, 1]) + [points[0, 1]]
path = "M " + " L ".join(f"{x},{y}" for x, y in zip(xs, ys)) + " Z"
path = (
"M "
+ " L ".join(f"{x},{y}" for x, y in zip(xs, ys, strict=False))
+ " Z"
)
fig.add_shape(
type="path",
path=path,
Expand Down Expand Up @@ -1014,7 +1018,7 @@ def _build_signal_figure(self) -> go.Figure:
# Build interleaved arrays: (x, baseline) -> (x, y) -> None gap
xs: list = []
ys: list = []
for xi, yi in zip(x, y):
for xi, yi in zip(x, y, strict=False):
xs.extend([xi, xi, None])
ys.extend([baseline, yi, None])
fig.add_trace(
Expand Down Expand Up @@ -1431,7 +1435,7 @@ def _build_figure(self) -> go.Figure:
baseline = float(obj.get_metadata_option("baseline"))
xs: list = []
ys: list = []
for xi, yi in zip(x, y):
for xi, yi in zip(x, y, strict=False):
xs.extend([xi, xi, None])
ys.extend([baseline, yi, None])
fig.add_trace(
Expand Down Expand Up @@ -1770,7 +1774,9 @@ def _build_figure(self) -> go.Figure:
all_tbl_results: list = []
all_geo_results: list = []

for idx, (img, result) in enumerate(zip(self._objs, results_list)):
for idx, (img, result) in enumerate(
zip(self._objs, results_list, strict=False)
):
row = idx // ncols + 1
col = idx % ncols + 1

Expand Down
8 changes: 8 additions & 0 deletions datalab_kernel/tests/unit/test_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from __future__ import annotations

import json
import sys

import pytest

Expand Down Expand Up @@ -76,13 +77,17 @@ def test_kernel_metadata_exists(self):
KERNEL_IMPLEMENTATION,
KERNEL_LANGUAGE,
KERNEL_LANGUAGE_INFO,
KERNEL_LANGUAGE_VERSION,
)

assert KERNEL_IMPLEMENTATION == "datalab-kernel"
assert KERNEL_LANGUAGE == "python"
assert KERNEL_DISPLAY_NAME == "DataLab"
assert "xeus-python" in KERNEL_BANNER
assert isinstance(KERNEL_LANGUAGE_INFO, dict)
expected_version = f"{sys.version_info.major}.{sys.version_info.minor}"
assert expected_version == KERNEL_LANGUAGE_VERSION
assert KERNEL_LANGUAGE_INFO["version"] == KERNEL_LANGUAGE_VERSION
assert isinstance(KERNEL_HELP_LINKS, list)

def test_get_kernel_info_function(self):
Expand All @@ -99,6 +104,9 @@ def test_get_kernel_info_function(self):
assert "help_links" in info

assert info["implementation"] == "datalab-kernel"
assert info["language_info"]["version"] == (
f"{sys.version_info.major}.{sys.version_info.minor}"
)


class TestStartupModule:
Expand Down
5 changes: 5 additions & 0 deletions doc/release_notes/release_0.02.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Version 0.2 #

## Unreleased ##

* Python 3.10 or later is now required. Python 3.9 users must keep an earlier compatible release.
* Kernel language information now reports the Python version actually running the kernel, rather than always announcing Python 3.9.

## DataLab-Kernel Version 0.2.11 (2026-02-15) ##

### 🛠️ Bug Fixes since version 0.2.10 ###
Expand Down
73 changes: 44 additions & 29 deletions doc/requirements.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The ``datalab-kernel`` package requires the following Python modules:
The `datalab-kernel` package requires the following Python modules:

.. list-table::
:header-rows: 1
Expand All @@ -8,28 +8,31 @@ The ``datalab-kernel`` package requires the following Python modules:
- Version
- Summary
* - Python
- >=3.9
- >=3.10
- Python programming language
* - ipykernel
- >= 6.0
- IPython Kernel for Jupyter
* - jupyter-client
- >= 7.0
- Jupyter protocol client APIs
* - NumPy
- >= 1.22
* - xeus-python
- >=0.17.0
- A wheel for xeus-python
* - xeus-python-shell
- >=0.6.0
- The xeus-python core python logic.
* - numpy
- >=1.22
- Fundamental package for array computing in Python
* - httpx
- >=0.25.0
- The next generation HTTP client.
* - h5py
- >= 3.0
- >=3.0
- Read and write HDF5 files from Python
* - matplotlib
- >= 3.5
- >=3.5
- Python plotting package
* - Sigima
- >= 1.0
- Scientific signal and image processing library
* - sigima
- >=1.0
- Scientific computing engine for 1D signals and 2D images, part of the DataLab open-source platform.

Optional modules for DataLab integration:
Optional modules for development:

.. list-table::
:header-rows: 1
Expand All @@ -38,11 +41,17 @@ Optional modules for DataLab integration:
* - Name
- Version
- Summary
* - datalab-platform
- >= 1.0
- DataLab - Scientific Data Analysis Platform
* - pytest
- >=7.0
- pytest: simple powerful testing with Python
* - pytest-cov
- >=4.0
- Pytest plugin for measuring coverage.
* - ruff
- >=0.1.0
- An extremely fast Python linter and code formatter, written in Rust.

Development dependencies:
Optional modules for building the documentation:

.. list-table::
:header-rows: 1
Expand All @@ -51,12 +60,18 @@ Development dependencies:
* - Name
- Version
- Summary
* - pytest
- >= 7.0
- Python testing framework
* - pytest-cov
- >= 4.0
- Pytest coverage plugin
* - ruff
- >= 0.1.0
- Fast Python linter and formatter
* - sphinx
- >=7.0
- Python documentation generator
* - pydata-sphinx-theme
- >=0.14
- Bootstrap-based Sphinx theme from the PyData community
* - myst-nb
- >=1.0
- A Jupyter Notebook Sphinx reader built on top of the MyST markdown parser.
* - sphinx-design
- >=0.5
- A sphinx extension for designing beautiful, view size responsive web components.
* - sphinx-copybutton
- >=0.5
- Add a copy button to each of your code cells.
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ classifiers = [
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Expand All @@ -26,7 +25,7 @@ classifiers = [
"Topic :: Scientific/Engineering",
]
keywords = ["jupyter", "kernel", "datalab", "scientific", "data processing", "xeus"]
requires-python = ">=3.9"
requires-python = ">=3.10"
dependencies = [
"xeus-python>=0.17.0",
"xeus-python-shell>=0.6.0",
Expand Down Expand Up @@ -90,7 +89,7 @@ markers = [

[tool.ruff]
line-length = 88
target-version = "py39"
target-version = "py310"

[tool.ruff.lint]
select = ["E", "F", "W", "I", "UP", "B", "C4", "SIM"]
Expand Down
19 changes: 15 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
xeus-python>=0.17.0
xeus-python-shell>=0.6.0
numpy>=1.22
httpx>=0.25.0
datalab-platform>=1.1
h5py>=3.0
httpx>=0.25.0
jupyter-client>=7.0
matplotlib>=3.5
myst-nb>=1.0
numpy>=1.22
plotly>=5.0
pydata-sphinx-theme>=0.14
pytest-cov>=4.0
pytest>=7.0
ruff>=0.1.0
sigima>=1.0
sphinx-copybutton>=0.5
sphinx-design>=0.5
sphinx>=7.0
xeus-python-shell>=0.6.0
xeus-python>=0.17.0
Loading