Skip to content

Commit 2a1a117

Browse files
FilipPyrekmfranczel
andcommitted
feat: python 3.13 support
Co-authored-by: mfranczel <mfranczel@users.noreply.github.com>
1 parent 48b0a54 commit 2a1a117

File tree

11 files changed

+779
-132
lines changed

11 files changed

+779
-132
lines changed

.cursorrules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ Supported versions:
137137
- Python 3.10
138138
- Python 3.11
139139
- Python 3.12
140+
- Python 3.13
140141

141142
## Code Examples
142143

.github/workflows/cd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
strategy:
3636
fail-fast: false
3737
matrix:
38-
python_version: ["3.9", "3.10", "3.11", "3.12"]
38+
python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
3939
permissions:
4040
id-token: write
4141
contents: read
@@ -413,7 +413,7 @@ jobs:
413413
needs: build-and-push-artifacts-status
414414
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
415415
env:
416-
PYTHON_VERSIONS: "3.9,3.10,3.11,3.12"
416+
PYTHON_VERSIONS: "3.9,3.10,3.11,3.12,3.13"
417417
steps:
418418
- name: Checkout code
419419
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ jobs:
162162
strategy:
163163
fail-fast: false
164164
matrix:
165-
python-version: ["3.9", "3.10", "3.11", "3.12"]
165+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
166166

167167
steps:
168168
- name: Checkout code
@@ -283,7 +283,7 @@ jobs:
283283
strategy:
284284
fail-fast: false
285285
matrix:
286-
python-version: ["3.9", "3.10", "3.11", "3.12"]
286+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
287287
steps:
288288
- name: Checkout code
289289
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
@@ -299,11 +299,11 @@ jobs:
299299
with:
300300
python-version: ${{ matrix.python-version }}
301301

302-
- name: Set up Java 11
302+
- name: Set up Java 17
303303
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4
304304
with:
305305
distribution: 'temurin'
306-
java-version: '11'
306+
java-version: '17'
307307

308308
- name: Load cached Poetry installation
309309
id: cached-poetry

.mise.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
[tools]
66
python = "3.12"
7-
java = "temurin-11"
7+
java = "temurin-17"
88
poetry = "2.2.0"
99

1010
[tasks.setup]

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
## Python Version Support
5454

55-
- Python 3.9, 3.10, 3.11, 3.12
55+
- Python 3.9, 3.10, 3.11, 3.12, 3.13
5656

5757
## Dependencies
5858

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ The toolkit consists of two main bundle types:
3737
2. Run setup:
3838

3939
```bash
40-
mise install # Installs Python 3.12 and Java 11
40+
mise install # Installs Python 3.12 and Java 17
4141
mise run setup # Installs dependencies and pre-commit hooks
4242
```
4343

4444
#### Option 2: Manual setup
4545

4646
1. Install poetry: [Installation](https://python-poetry.org/docs/#installation)
47-
2. Install Java 11 (required for PySpark tests):
47+
2. Install Java 17 (required for PySpark tests):
4848
- macOS: `brew install openjdk@11`
49-
- Ubuntu/Debian: `sudo apt-get install openjdk-11-jdk`
50-
- RHEL/Fedora: `sudo dnf install java-11-openjdk-devel`
49+
- Ubuntu/Debian: `sudo apt-get install openjdk-17-jdk`
50+
- RHEL/Fedora: `sudo dnf install java-17-openjdk-devel`
5151
3. Set up venv for development package:
5252

5353
```bash
@@ -277,7 +277,7 @@ $ ./bin/test-local
277277
278278
We use Docker to ensure reproducible environments due to Jupyter libraries' binary dependencies:
279279

280-
- `builder.Dockerfile`: Creates Python package bundles for different versions (3.9-3.12), generates kernel and server bundles, and packages the toolkit for distribution using Poetry.
280+
- `builder.Dockerfile`: Creates Python package bundles for different versions (3.9-3.13), generates kernel and server bundles, and packages the toolkit for distribution using Poetry.
281281

282282
- `test.Dockerfile`: Provides consistent test environment for running unit and integration tests across Python versions using nox. Used both locally and in CI/CD pipeline.
283283

deepnote_toolkit/ocelots/pandas/analyze.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,15 @@ def _get_histogram(pd_series):
8383
{"bin_start": bins[i], "bin_end": bins[i + 1], "count": count.item()}
8484
for i, count in enumerate(y)
8585
]
86-
except IndexError:
87-
# numpy bug https://github.com/numpy/numpy/issues/8627
88-
return None
86+
except ValueError as e:
87+
# NumPy 2.2+ raises "Too many bins for data range" when:
88+
# - Data range is zero (all values identical), or
89+
# - For integer data, bin width would be < 1.0, or
90+
# - Floating point precision prevents creating finite-sized bins at large scales
91+
# Numpy implementation: https://github.com/numpy/numpy/blob/e7a123b2d3eca9897843791dd698c1803d9a39c2/numpy/lib/_histograms_impl.py#L454
92+
if "Too many bins for data range" in str(e):
93+
return None
94+
raise
8995

9096

9197
def _calculate_min_max(column):

dockerfiles/test.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM quay.io/pypa/manylinux_2_28_x86_64:2025.05.28-1
22
RUN pipx install nox poetry==2.2.0
33

44
RUN dnf -y update && \
5-
dnf -y install java-11-openjdk-devel \
5+
dnf -y install java-17-openjdk-devel \
66
# Required for pymssql - provides sqlfront.h header file
77
freetds-devel \
88
# Required for database connectivity through ODBC

noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from nox import session
44

55

6-
@session(python=["3.9", "3.10", "3.11", "3.12"], reuse_venv=True)
6+
@session(python=["3.9", "3.10", "3.11", "3.12", "3.13"], reuse_venv=True)
77
def unit(session):
88
"""Run unit tests. Coverage is disabled by default, use --coverage to enable."""
99

@@ -67,7 +67,7 @@ def unit(session):
6767
)
6868

6969

70-
@session(python=["3.9", "3.10", "3.11", "3.12"], reuse_venv=True)
70+
@session(python=["3.9", "3.10", "3.11", "3.12", "3.13"], reuse_venv=True)
7171
def integration(session):
7272
"""Run integration tests. Coverage is disabled by default, use --coverage to enable."""
7373
# Validate required environment variables

0 commit comments

Comments
 (0)