Skip to content

Commit aee6605

Browse files
authored
chore: Drop support for python 3.8 (#2679)
* chore: Drop `3.8` in `pyproject.toml`, re-run tools All of these are automated changes, still have lots of manual stuff to do * test: Drop `zoneinfo` backcompat Always available in `3.9` * chore: Bump `pandas`, `modin` minimums #2084 (comment) * chore: Drop `pandas<1.1.3` branches in `_pandas_like` * test: Remove `sqlframe` `3.8` branches * test: Drop `pandas<1.1.3` branches in tests Man that was a slog * ci: Update `pytest-39` job * ci: Bump `python`, `pandas`, `numpy` in `extremes.yml` See vega/altair#3647 (comment) * chore: Use `str.removeprefix` - https://docs.python.org/3.9/library/stdtypes.html#str.removeprefix - #2677 * chore: Remove commented out unsupported pandas * revert: chore: Use str.removeprefix https://results.pre-commit.ci/run/github/760058710/1749910773.Y87psMZQSbKWzq63NeGHHg * fix: Avoid unbound `kwargs` https://github.com/narwhals-dev/narwhals/actions/runs/15652961693/job/44100161548?pr=2679 * ci: bump `scipy==1.6.0` - https://github.com/scipy/scipy/blob/ab1c0907fe9255582397db04592d6066745018d3/pyproject.toml#L8 - https://github.com/narwhals-dev/narwhals/actions/runs/15652961703/job/44100161543?pr=2679 * refactor: Replace `remove_prefix` take ✌️ See #2679 (comment)
1 parent cb2446f commit aee6605

File tree

105 files changed

+315
-501
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+315
-501
lines changed

.github/workflows/extremes.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
minimum_versions:
1010
strategy:
1111
matrix:
12-
python-version: ["3.8"]
12+
python-version: ["3.9"]
1313
os: [ubuntu-latest]
1414

1515
runs-on: ${{ matrix.os }}
@@ -25,7 +25,7 @@ jobs:
2525
cache-suffix: ${{ matrix.python-version }}
2626
cache-dependency-glob: "pyproject.toml"
2727
- name: install-minimum-versions
28-
run: uv pip install pipdeptree tox virtualenv setuptools pandas==0.25.3 polars==0.20.3 numpy==1.17.5 pyarrow==11.0.0 "pyarrow-stubs<17" scipy==1.5.0 scikit-learn==1.1.0 duckdb==1.0 tzdata backports.zoneinfo --system
28+
run: uv pip install pipdeptree tox virtualenv setuptools pandas==1.1.3 polars==0.20.3 numpy==1.19.3 pyarrow==11.0.0 "pyarrow-stubs<17" scipy==1.6.0 scikit-learn==1.1.0 duckdb==1.0 tzdata --system
2929
- name: install-reqs
3030
run: |
3131
uv pip install -e . --group tests --system
@@ -34,11 +34,11 @@ jobs:
3434
- name: Assert dependencies
3535
run: |
3636
DEPS=$(uv pip freeze)
37-
echo "$DEPS" | grep 'pandas==0.25.3'
37+
echo "$DEPS" | grep 'pandas==1.1.3'
3838
echo "$DEPS" | grep 'polars==0.20.3'
39-
echo "$DEPS" | grep 'numpy==1.17.5'
39+
echo "$DEPS" | grep 'numpy==1.19.3'
4040
echo "$DEPS" | grep 'pyarrow==11.0.0'
41-
echo "$DEPS" | grep 'scipy==1.5.0'
41+
echo "$DEPS" | grep 'scipy==1.6.0'
4242
echo "$DEPS" | grep 'scikit-learn==1.1.0'
4343
echo "$DEPS" | grep 'duckdb==1.0'
4444
- name: Run pytest
@@ -47,7 +47,7 @@ jobs:
4747
pretty_old_versions:
4848
strategy:
4949
matrix:
50-
python-version: ["3.8"]
50+
python-version: ["3.9"]
5151
os: [ubuntu-latest]
5252
runs-on: ${{ matrix.os }}
5353
steps:
@@ -62,7 +62,7 @@ jobs:
6262
cache-suffix: ${{ matrix.python-version }}
6363
cache-dependency-glob: "pyproject.toml"
6464
- name: install-pretty-old-versions
65-
run: uv pip install pipdeptree tox virtualenv setuptools pandas==1.1.5 polars==0.20.3 numpy==1.17.5 pyarrow==11.0.0 "pyarrow-stubs<17" scipy==1.5.0 scikit-learn==1.1.0 duckdb==1.0 tzdata backports.zoneinfo --system
65+
run: uv pip install pipdeptree tox virtualenv setuptools pandas==1.1.5 polars==0.20.3 numpy==1.19.3 pyarrow==11.0.0 "pyarrow-stubs<17" scipy==1.6.0 scikit-learn==1.1.0 duckdb==1.0 tzdata --system
6666
- name: install-reqs
6767
run: uv pip install -e . --group tests --system
6868
- name: show-deps
@@ -74,9 +74,9 @@ jobs:
7474
DEPS=$(uv pip freeze)
7575
echo "$DEPS" | grep 'pandas==1.1.5'
7676
echo "$DEPS" | grep 'polars==0.20.3'
77-
echo "$DEPS" | grep 'numpy==1.17.5'
77+
echo "$DEPS" | grep 'numpy==1.19.3'
7878
echo "$DEPS" | grep 'pyarrow==11.0.0'
79-
echo "$DEPS" | grep 'scipy==1.5.0'
79+
echo "$DEPS" | grep 'scipy==1.6.0'
8080
echo "$DEPS" | grep 'scikit-learn==1.1.0'
8181
echo "$DEPS" | grep 'duckdb==1.0'
8282
- name: Run pytest

.github/workflows/pytest.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ env:
99
PY_COLORS: 1
1010

1111
jobs:
12-
pytest-38:
12+
pytest-39:
1313
strategy:
1414
matrix:
15-
python-version: ["3.8"]
15+
python-version: ["3.9"]
1616
os: [windows-latest, ubuntu-latest]
1717
runs-on: ${{ matrix.os }}
1818
steps:
@@ -27,8 +27,7 @@ jobs:
2727
cache-suffix: ${{ matrix.python-version }}
2828
cache-dependency-glob: "pyproject.toml"
2929
- name: install-reqs
30-
# Python3.8 is technically at end-of-life, so we don't test everything
31-
run: uv pip install -e ".[pandas,polars,pyarrow]" backports.zoneinfo --group tests --system
30+
run: uv pip install -e ".[pandas,polars,pyarrow]" --group tests --system
3231
- name: show-deps
3332
run: uv pip freeze
3433
- name: Run pytest

narwhals/_arrow/dataframe.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
from __future__ import annotations
22

3+
from collections.abc import Collection, Iterator, Mapping, Sequence
34
from functools import partial
4-
from typing import (
5-
TYPE_CHECKING,
6-
Any,
7-
Collection,
8-
Iterator,
9-
Literal,
10-
Mapping,
11-
Sequence,
12-
cast,
13-
overload,
14-
)
5+
from typing import TYPE_CHECKING, Any, Literal, cast, overload
156

167
import pyarrow as pa
178
import pyarrow.compute as pc

narwhals/_arrow/expr.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING, Any, Sequence
3+
from typing import TYPE_CHECKING, Any
44

55
import pyarrow.compute as pc
66

@@ -14,6 +14,8 @@
1414
)
1515

1616
if TYPE_CHECKING:
17+
from collections.abc import Sequence
18+
1719
from typing_extensions import Self
1820

1921
from narwhals._arrow.dataframe import ArrowDataFrame

narwhals/_arrow/group_by.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
import collections
4-
from typing import TYPE_CHECKING, Any, ClassVar, Iterator, Mapping, Sequence
4+
from typing import TYPE_CHECKING, Any, ClassVar
55

66
import pyarrow as pa
77
import pyarrow.compute as pc
@@ -12,6 +12,8 @@
1212
from narwhals._utils import generate_temporary_column_name
1313

1414
if TYPE_CHECKING:
15+
from collections.abc import Iterator, Mapping, Sequence
16+
1517
from narwhals._arrow.dataframe import ArrowDataFrame
1618
from narwhals._arrow.expr import ArrowExpr
1719
from narwhals._arrow.typing import ( # type: ignore[attr-defined]

narwhals/_arrow/namespace.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import operator
44
from functools import reduce
55
from itertools import chain
6-
from typing import TYPE_CHECKING, Literal, Sequence
6+
from typing import TYPE_CHECKING, Literal
77

88
import pyarrow as pa
99
import pyarrow.compute as pc
@@ -24,6 +24,8 @@
2424
from narwhals._utils import Implementation
2525

2626
if TYPE_CHECKING:
27+
from collections.abc import Sequence
28+
2729
from narwhals._arrow.typing import Incomplete
2830
from narwhals._utils import Version
2931
from narwhals.typing import IntoDType, NonNestedLiteral

narwhals/_arrow/series.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import (
4-
TYPE_CHECKING,
5-
Any,
6-
Iterable,
7-
Iterator,
8-
Mapping,
9-
Sequence,
10-
cast,
11-
overload,
12-
)
3+
from typing import TYPE_CHECKING, Any, cast, overload
134

145
import pyarrow as pa
156
import pyarrow.compute as pc
@@ -44,6 +35,7 @@
4435
from narwhals.exceptions import InvalidOperationError
4536

4637
if TYPE_CHECKING:
38+
from collections.abc import Iterable, Iterator, Mapping, Sequence
4739
from types import ModuleType
4840

4941
import pandas as pd

narwhals/_arrow/series_dt.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING, Any, Callable, ClassVar, Mapping, cast
3+
from typing import TYPE_CHECKING, Any, Callable, ClassVar, cast
44

55
import pyarrow as pa
66
import pyarrow.compute as pc
@@ -9,6 +9,8 @@
99
from narwhals._duration import parse_interval_string
1010

1111
if TYPE_CHECKING:
12+
from collections.abc import Mapping
13+
1214
from typing_extensions import TypeAlias
1315

1416
from narwhals._arrow.series import ArrowSeries

narwhals/_arrow/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
from functools import lru_cache
4-
from typing import TYPE_CHECKING, Any, Iterable, Iterator, Mapping, Sequence, cast
4+
from typing import TYPE_CHECKING, Any, cast
55

66
import pyarrow as pa
77
import pyarrow.compute as pc
@@ -11,6 +11,8 @@
1111
from narwhals.exceptions import ShapeError
1212

1313
if TYPE_CHECKING:
14+
from collections.abc import Iterable, Iterator, Mapping, Sequence
15+
1416
from typing_extensions import TypeAlias, TypeIs
1517

1618
from narwhals._arrow.series import ArrowSeries

narwhals/_compliant/dataframe.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
from __future__ import annotations
22

3+
from collections.abc import Iterator, Mapping, Sequence, Sized
34
from itertools import chain
4-
from typing import (
5-
TYPE_CHECKING,
6-
Any,
7-
Iterator,
8-
Literal,
9-
Mapping,
10-
Protocol,
11-
Sequence,
12-
Sized,
13-
TypeVar,
14-
overload,
15-
)
5+
from typing import TYPE_CHECKING, Any, Literal, Protocol, TypeVar, overload
166

177
from narwhals._compliant.typing import (
188
CompliantDataFrameAny,

0 commit comments

Comments
 (0)