Skip to content

Commit fb13ab0

Browse files
mishushakovclaudejakubno
authored
Update Python 3.13 support and bump dependencies (#192)
* Update Python 3.13 support: bump dependencies and fix numpy constraints Update template to Python 3.13 base image and bump key packages for compatibility: - numpy 1.26.4 → 2.3.5 (Python 3.13 requires numpy 2.x) - scipy 1.13.1 → 1.17.0, gensim 4.3.3 → 4.4.0, numba 0.61.2 → 0.63.1, spacy 3.8.2 → 3.8.11 - e2b_charts: relax numpy constraint from ^1.26.4 to >=1.26.4 for numpy 2 compatibility Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * Regenerate poetry.lock for updated dependencies Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Install e2b_charts with --no-deps to bypass numpy<2 pin on PyPI The published e2b_charts 0.0.4 on PyPI still has numpy<2.0.0. Until a new version is published, install it separately with --no-deps. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Revert template/requirements.txt and build script changes Keep these files as-is on main; e2b_charts updates will be in a separate PR. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * moved the changes here to separate pr * keep comment * added changeset * re-try with fix missing * return * skip cache * return * install r-base with fix missing * simplify r install --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com> Co-authored-by: Jakub Novák <jakub@e2b.dev>
1 parent fff3df6 commit fb13ab0

3 files changed

Lines changed: 16 additions & 21 deletions

File tree

.changeset/tangy-grapes-crash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@e2b/code-interpreter-template': minor
3+
---
4+
5+
updated Python version to 3.13

template/requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ e2b_charts
1515
aiohttp==3.13.3
1616
beautifulsoup4==4.14.3
1717
bokeh==3.8.2
18-
gensim==4.3.3 # unmaintained, blocking numpy and scipy bump
18+
gensim==4.4.0
1919
imageio==2.37.2
2020
joblib==1.5.3
2121
librosa==0.11.0
2222
nltk==3.9.3
23-
numpy==1.26.4 # bump blocked by gensim
24-
numba==0.61.2
23+
numpy==2.3.5
24+
numba==0.63.1
2525
opencv-python==4.11.0.86
2626
openpyxl==3.1.5
2727
plotly==6.0.1
@@ -32,10 +32,10 @@ pytz==2025.2
3232
requests==2.32.5
3333
scikit-image==0.25.2
3434
scikit-learn==1.6.1
35-
scipy==1.13.1 # bump blocked by gensim
35+
scipy==1.17.0
3636
seaborn==0.13.2
3737
soundfile==0.13.1
38-
spacy==3.8.11 # doesn't work on 3.13.x
38+
spacy==3.8.11
3939
textblob==0.19.0
4040
tornado==6.5.4
4141
urllib3==2.6.3

template/template.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def make_template(
99
# Start with base template
1010
template = (
1111
Template()
12-
.from_image("python:3.12")
12+
.from_image("python:3.13")
1313
.set_user("root")
1414
.set_workdir("/root")
1515
.set_envs(
@@ -51,21 +51,11 @@ def make_template(
5151

5252
# Install R Kernel if requested
5353
if "r" in enabled_kernels:
54-
template = (
55-
template.run_cmd(
56-
[
57-
"sudo gpg --keyserver keyserver.ubuntu.com --recv-key 95C0FAF38DB3CCAD0C080A7BDC78B2DDEABC47B7",
58-
"sudo gpg --armor --export 95C0FAF38DB3CCAD0C080A7BDC78B2DDEABC47B7 | sudo tee /etc/apt/trusted.gpg.d/cran_debian_key.asc",
59-
'echo "deb https://cloud.r-project.org/bin/linux/debian trixie-cran40/" | sudo tee /etc/apt/sources.list.d/cran.list',
60-
]
61-
)
62-
.apt_install("r-base=${R_VERSION} r-base-dev")
63-
.run_cmd(
64-
[
65-
"R -e \"install.packages('IRkernel', repos='https://cloud.r-project.org')\"",
66-
"R -e \"IRkernel::installspec(user = FALSE, name = 'r', displayname = 'R')\"",
67-
]
68-
)
54+
template = template.apt_install("r-base=${R_VERSION} r-base-dev").run_cmd(
55+
[
56+
"R -e \"install.packages('IRkernel', repos='https://cloud.r-project.org')\"",
57+
"R -e \"IRkernel::installspec(user = FALSE, name = 'r', displayname = 'R')\"",
58+
]
6959
)
7060

7161
# Install JavaScript Kernel if requested

0 commit comments

Comments
 (0)