Skip to content

Commit e51ffbb

Browse files
schloerkecpsievertkarangattu
authored
chore!: Add python 3.13 support (#1711)
Co-authored-by: Carson Sievert <cpsievert1@gmail.com> Co-authored-by: Karan <karangattu@users.noreply.github.com>
1 parent 3322f29 commit e51ffbb

File tree

12 files changed

+17
-86
lines changed

12 files changed

+17
-86
lines changed

.github/py-shiny/setup/action.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ inputs:
44
python-version:
55
description: 'Python version to use'
66
required: false
7-
default: "3.12"
7+
default: "3.13"
88
runs:
99
using: "composite"
1010
steps:
@@ -39,12 +39,6 @@ runs:
3939
run: |
4040
make ci-install-wheel
4141
42-
- name: Install backports.tarfile
43-
if: ${{ startsWith(inputs.python-version, '3.8') }}
44-
shell: bash
45-
run: |
46-
uv pip install backports.tarfile
47-
4842
- name: Pip list
4943
shell: bash
5044
run: |

.github/workflows/build-docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python-version: ["3.12"]
18+
python-version: ["3.13"]
1919
fail-fast: false
2020

2121
steps:

.github/workflows/pytest.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
# "3.10" must be a string; otherwise it is interpreted as 3.1.
20-
python-version: ["3.12", "3.11", "3.10", "3.9"]
20+
python-version: ["3.13", "3.12", "3.11", "3.10", "3.9"]
2121
os: [ubuntu-latest, windows-latest, macOS-latest]
2222
exclude:
2323
- python-version: ${{ github.event.pull_request.draft && '3.11' }}
@@ -73,7 +73,7 @@ jobs:
7373
with:
7474
fetch-depth: 0
7575
- name: "Set up Python 3.10"
76-
uses: actions/setup-python@v4
76+
uses: actions/setup-python@v5
7777
with:
7878
python-version: "3.10"
7979
- name: Install dependencies
@@ -107,7 +107,7 @@ jobs:
107107
runs-on: ubuntu-latest
108108
strategy:
109109
matrix:
110-
python-version: ["3.12", "3.11", "3.10", "3.9"]
110+
python-version: ["3.13", "3.12", "3.11", "3.10", "3.9"]
111111
browser: ["chromium", "firefox", "webkit"]
112112
exclude:
113113
- python-version: ${{ github.event.pull_request.draft && '3.11' }}
@@ -117,8 +117,6 @@ jobs:
117117
- browser: ${{ github.event.pull_request.draft && 'webkit' }}
118118
# There are many unexplained tests that fail on webkit w/ python 3.8, 3.9
119119
# Given the more recent versions of python work, we will exclude this combination
120-
- browser: "webkit"
121-
python-version: "3.8"
122120
- browser: "webkit"
123121
python-version: "3.9"
124122
fail-fast: false
@@ -157,7 +155,7 @@ jobs:
157155
runs-on: ubuntu-latest
158156
strategy:
159157
matrix:
160-
python-version: ["3.12", "3.11", "3.10", "3.9"]
158+
python-version: ["3.13", "3.12", "3.11", "3.10", "3.9"]
161159
browser: ["chromium", "firefox", "webkit"]
162160
exclude:
163161
- python-version: ${{ github.event.pull_request.draft && '3.11' }}

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ classifiers = [
2626
"Programming Language :: Python :: 3.10",
2727
"Programming Language :: Python :: 3.11",
2828
"Programming Language :: Python :: 3.12",
29+
"Programming Language :: Python :: 3.13",
2930
]
3031
dependencies = [
3132
"typing-extensions>=4.10.0",
@@ -54,8 +55,8 @@ theme = ["libsass>=0.23.0", "brand_yml>=0.1.0"]
5455
test = [
5556
"pytest>=6.2.4",
5657
"pytest-asyncio>=0.17.2",
57-
"pytest-playwright>=0.3.0",
58-
"playwright>=1.43.0",
58+
"pytest-playwright>=0.5.2",
59+
"playwright>=1.48.0",
5960
"pytest-xdist",
6061
"pytest-timeout",
6162
"pytest-rerunfailures",
@@ -86,7 +87,6 @@ test = [
8687
"faicons",
8788
"ridgeplot",
8889
"great_tables",
89-
"modin[all]",
9090
"polars",
9191
"dask[dataframe]",
9292
"pyarrow",

shiny/_datastructures.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ class PriorityQueueFIFO(Generic[T]):
1515
"""
1616

1717
def __init__(self) -> None:
18-
# Using Tuple instead of tuple because in Python 3.8 and earlier, tuple isn't
19-
# generic
2018
self._pq: PriorityQueue[tuple[int, int, T]] = PriorityQueue()
2119
self._counter: int = 0
2220

shiny/_utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,14 @@ def sort_keys_length(x: dict[str, T], descending: bool = False) -> dict[str, T]:
7272

7373

7474
def guess_mime_type(
75-
url: "str | os.PathLike[str]",
75+
url: str | os.PathLike[str],
7676
default: str = "application/octet-stream",
7777
strict: bool = True,
7878
) -> str:
7979
"""
8080
Guess the MIME type of a file. This is a wrapper for mimetypes.guess_type, but it
8181
only returns the type (and not encoding), and it allows a default value.
8282
"""
83-
# Note that in the parameters above, "os.PathLike[str]" is in quotes to avoid
84-
# "TypeError: 'ABCMeta' object is not subscriptable", in Python<=3.8.
8583
if url:
8684
# Work around issue #1601, some installations of Windows 10 return text/plain
8785
# as the mime type for .js files

shiny/render/_render.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
import os
55
import sys
66
import typing
7-
8-
# `typing.Dict` sed for python 3.8 compatibility
9-
# Can use `dict` in python >= 3.9
107
from typing import TYPE_CHECKING, Any, Callable, Literal, Optional, Union, cast
118

129
from htmltools import Tag, TagAttrValue, TagChild

shiny/render/renderer/_renderer.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,6 @@ def _auto_register(self) -> None:
336336
self._auto_registered = True
337337

338338

339-
# Not inheriting from `WrapAsync[[], IT]` as python 3.8 needs typing extensions that
340-
# doesn't support `[]` for a ParamSpec definition. :-( Would be minimal/clean if we
341-
# could do `class AsyncValueFn(WrapAsync[[], IT]):`
342339
class AsyncValueFn(Generic[IT]):
343340
"""
344341
App-supplied output value function which returns type `IT`.

tests/playwright/shiny/components/data_frame/data_type/app.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import annotations
22

3-
import modin.pandas as mpd # pyright: ignore[reportMissingTypeStubs]
43
import narwhals.stable.v1 as nw
54
import palmerpenguins # pyright: ignore[reportMissingTypeStubs]
65
import polars as pl
@@ -12,7 +11,6 @@
1211

1312
nw_df = nw.from_native(pd_df, eager_only=True)
1413
pa_df = pa.table(pd_df) # pyright: ignore[reportUnknownMemberType]
15-
mpd_df = mpd.DataFrame(pd_df)
1614
pl_df = pl.DataFrame(pd_df)
1715

1816

@@ -138,46 +136,6 @@ def pa_data_view():
138136
def pa_data_view_selected():
139137
return str(type(pa_df_original.data_view(selected=True)))
140138

141-
with ui.card():
142-
ui.h2("Modin Data")
143-
144-
@render.data_frame
145-
def mpd_df_original():
146-
return render.DataGrid(
147-
data=mpd_df,
148-
selection_mode="row",
149-
)
150-
151-
"Selected row:"
152-
153-
@render.data_frame
154-
def selected_mpd_row():
155-
return mpd_df_original.data_view(selected=True)
156-
157-
"Data type:"
158-
159-
@render.code
160-
def mpd_type():
161-
return str(type(mpd_df))
162-
163-
ui.markdown("`.data()` type:")
164-
165-
@render.code
166-
def mpd_data():
167-
return str(type(mpd_df_original.data()))
168-
169-
ui.markdown("`.data_view()` type:")
170-
171-
@render.code
172-
def mpd_data_view():
173-
return str(type(mpd_df_original.data_view()))
174-
175-
ui.markdown("`.data_view(selected=True)` type:")
176-
177-
@render.code
178-
def mpd_data_view_selected():
179-
return str(type(mpd_df_original.data_view(selected=True)))
180-
181139
with ui.card():
182140
ui.h2("Polars Data")
183141

tests/playwright/shiny/components/data_frame/data_type/test_df_data_type.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@
3030
"df_original": "pl_df_original",
3131
"selected_row": "selected_pl_row",
3232
},
33-
{
34-
"name": "modin",
35-
"prefix": "mpd",
36-
"df_original": "mpd_df_original",
37-
"selected_row": "selected_mpd_row",
38-
},
3933
]
4034

4135

0 commit comments

Comments
 (0)