Skip to content

Commit 3968484

Browse files
phofllithomas1
andauthored
CI: Change development python version to 3.10 (#51133)
* CI: Change development python version to 3.10 * Update checks * Remove strict * Remove strict * Fixes * Add dt * Switch python to 3.9 * Remove * Fix * Try attribute * Adjust * Fix mypy * Try fixing doc build * Fix mypy * Fix stubtest * Remove workflow file * Rename back * Update * Rename * Rename * Change python version * Remove * Fix doc errors * Remove pypy * Update ci/deps/actions-pypy-39.yaml Co-authored-by: Thomas Li <[email protected]> * Revert pypy removal * Remove again * Fix * Change to 3.9 * Address --------- Co-authored-by: Thomas Li <[email protected]>
1 parent d182a34 commit 3968484

29 files changed

+71
-104
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
image: ubuntu-2004:2022.04.1
77
resource_class: arm.large
88
environment:
9-
ENV_FILE: ci/deps/circle-38-arm64.yaml
9+
ENV_FILE: ci/deps/circle-39-arm64.yaml
1010
PYTEST_WORKERS: auto
1111
PATTERN: "not single_cpu and not slow and not network and not clipboard and not arm_slow and not db"
1212
PYTEST_TARGET: "pandas"

.github/workflows/code-checks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ jobs:
179179
id: setup_python
180180
uses: actions/setup-python@v4
181181
with:
182-
python-version: '3.8'
182+
python-version: '3.10'
183183
cache: 'pip'
184184
cache-dependency-path: 'requirements-dev.txt'
185185

.github/workflows/package-checks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
id: setup_python
3939
uses: actions/setup-python@v4
4040
with:
41-
python-version: '3.8'
41+
python-version: '3.10'
4242

4343
- name: Install required dependencies
4444
run: |

.github/workflows/sdist.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
fail-fast: false
3131
matrix:
32-
python-version: ["3.8", "3.9", "3.10", "3.11"]
32+
python-version: ["3.9", "3.10", "3.11"]
3333
concurrency:
3434
# https://github.community/t/concurrecy-not-work-for-push/183068/7
3535
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{matrix.python-version}}-sdist
@@ -80,8 +80,6 @@ jobs:
8080
- name: Force oldest supported NumPy
8181
run: |
8282
case "${{matrix.python-version}}" in
83-
3.8)
84-
pip install numpy==1.21.6 ;;
8583
3.9)
8684
pip install numpy==1.21.6 ;;
8785
3.10)

.github/workflows/unit-tests.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ jobs:
2626
timeout-minutes: 180
2727
strategy:
2828
matrix:
29-
env_file: [actions-38.yaml, actions-39.yaml, actions-310.yaml, actions-311.yaml]
29+
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml]
3030
# Prevent the include jobs from overriding other jobs
3131
pattern: [""]
3232
include:
3333
- name: "Downstream Compat"
34-
env_file: actions-38-downstream_compat.yaml
34+
env_file: actions-39-downstream_compat.yaml
3535
pattern: "not slow and not network and not single_cpu"
3636
pytest_target: "pandas/tests/test_downstream.py"
3737
- name: "Minimum Versions"
38-
env_file: actions-38-minimum_versions.yaml
38+
env_file: actions-39-minimum_versions.yaml
3939
pattern: "not slow and not network and not single_cpu"
4040
- name: "Locale: it_IT"
41-
env_file: actions-38.yaml
41+
env_file: actions-310.yaml
4242
pattern: "not slow and not network and not single_cpu"
4343
extra_apt: "language-pack-it"
4444
# Use the utf8 version as the default, it has no bad side-effect.
@@ -48,7 +48,7 @@ jobs:
4848
# It will be temporarily activated during tests with locale.setlocale
4949
extra_loc: "it_IT"
5050
- name: "Locale: zh_CN"
51-
env_file: actions-38.yaml
51+
env_file: actions-310.yaml
5252
pattern: "not slow and not network and not single_cpu"
5353
extra_apt: "language-pack-zh-hans"
5454
# Use the utf8 version as the default, it has no bad side-effect.
@@ -62,7 +62,7 @@ jobs:
6262
pattern: "not slow and not network and not single_cpu"
6363
pandas_copy_on_write: "1"
6464
- name: "Pypy"
65-
env_file: actions-pypy-38.yaml
65+
env_file: actions-pypy-39.yaml
6666
pattern: "not slow and not network and not single_cpu"
6767
test_args: "--max-worker-restart 0"
6868
- name: "Numpy Dev"
@@ -173,7 +173,7 @@ jobs:
173173
strategy:
174174
matrix:
175175
os: [macos-latest, windows-latest]
176-
env_file: [actions-38.yaml, actions-39.yaml, actions-310.yaml, actions-311.yaml]
176+
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml]
177177
fail-fast: false
178178
runs-on: ${{ matrix.os }}
179179
name: ${{ format('{0} {1}', matrix.os, matrix.env_file) }}
@@ -227,7 +227,7 @@ jobs:
227227
fi
228228
- name: Build environment and Run Tests
229229
run: |
230-
/opt/python/cp38-cp38/bin/python -m venv ~/virtualenvs/pandas-dev
230+
/opt/python/cp39-cp39/bin/python -m venv ~/virtualenvs/pandas-dev
231231
. ~/virtualenvs/pandas-dev/bin/activate
232232
python -m pip install --no-cache-dir --no-deps -U pip wheel setuptools
233233
python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytz pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17 hypothesis>=6.46.1

.github/workflows/wheels.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
- [windows-2019, win_amd64]
5656
- [windows-2019, win32]
5757
# TODO: support PyPy?
58-
python: [["cp38", "3.8"], ["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"]]# "pp38", "pp39"]
58+
python: [["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"]]# "pp39"]
5959
env:
6060
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
6161
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
@@ -152,7 +152,7 @@ jobs:
152152
auto-update-conda: true
153153
# Really doesn't matter what version we upload with
154154
# just the version we test with
155-
python-version: '3.8'
155+
python-version: '3.10'
156156
channels: conda-forge
157157
channel-priority: true
158158
# mamba fails to solve, also we really don't need this since we're just installing python

ci/deps/actions-38.yaml

-60
This file was deleted.

ci/deps/actions-38-downstream_compat.yaml renamed to ci/deps/actions-39-downstream_compat.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: pandas-dev
33
channels:
44
- conda-forge
55
dependencies:
6-
- python=3.8
6+
- python=3.9
77

88
# build dependencies
99
- versioneer[toml]

ci/deps/actions-38-minimum_versions.yaml renamed to ci/deps/actions-39-minimum_versions.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: pandas-dev
44
channels:
55
- conda-forge
66
dependencies:
7-
- python=3.8.0
7+
- python=3.9
88

99
# build dependencies
1010
- versioneer[toml]

ci/deps/actions-pypy-38.yaml renamed to ci/deps/actions-pypy-39.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies:
55
# TODO: Add the rest of the dependencies in here
66
# once the other plentiful failures/segfaults
77
# with base pandas has been dealt with
8-
- python=3.8[build=*_pypy] # TODO: use this once pypy3.8 is available
8+
- python=3.9[build=*_pypy]
99

1010
# build dependencies
1111
- versioneer[toml]

ci/deps/circle-38-arm64.yaml renamed to ci/deps/circle-39-arm64.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: pandas-dev
22
channels:
33
- conda-forge
44
dependencies:
5-
- python=3.8
5+
- python=3.9
66

77
# build dependencies
88
- versioneer[toml]

doc/source/conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
# to ensure that include files (partial pages) aren't built, exclude them
7777
# https://github.com/sphinx-doc/sphinx/issues/1965#issuecomment-124732907
7878
"**/includes/**",
79+
"**/api/pandas.Series.dt.rst",
7980
]
8081
try:
8182
import nbconvert

doc/source/development/contributing_gitpod.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ you do not have an account yet, you will need to create one first.
2929

3030
To get started just login at `Gitpod`_, and grant the appropriate permissions to GitHub.
3131

32-
We have built a python 3.8 environment and all development dependencies will
32+
We have built a python 3.10 environment and all development dependencies will
3333
install when the environment starts.
3434

3535

doc/source/getting_started/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Instructions for installing from source,
2020
Python version support
2121
----------------------
2222

23-
Officially Python 3.8, 3.9, 3.10 and 3.11.
23+
Officially Python 3.9, 3.10 and 3.11.
2424

2525
Installing pandas
2626
-----------------

doc/source/whatsnew/v2.1.0.rst

+5
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ Backwards incompatible API changes
124124

125125
.. _whatsnew_210.api_breaking.deps:
126126

127+
Increased minimum version for Python
128+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
129+
130+
pandas 2.1.0 supports Python 3.9 and higher.
131+
127132
Increased minimum versions for dependencies
128133
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
129134
Some minimum supported versions of dependencies were updated.

environment.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: pandas-dev
33
channels:
44
- conda-forge
55
dependencies:
6-
- python=3.8
6+
- python=3.10
77
- pip
88

99
# build dependencies
@@ -38,7 +38,7 @@ dependencies:
3838
- matplotlib>=3.6.1
3939
- numba>=0.55.2
4040
- numexpr>=2.8.0 # pin for "Run checks on imported code" job
41-
- openpyxl<3.1.1, >=3.0.7
41+
- openpyxl>=3.0.10
4242
- odfpy>=1.4.1
4343
- py
4444
- psycopg2>=2.9.3

pandas/_libs/tslibs/timestamps.pyi

+3-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ class Timestamp(datetime):
158158
def __hash__(self) -> int: ...
159159
def weekday(self) -> int: ...
160160
def isoweekday(self) -> int: ...
161-
def isocalendar(self) -> tuple[int, int, int]: ...
161+
# Return type "Tuple[int, int, int]" of "isocalendar" incompatible with return
162+
# type "_IsoCalendarDate" in supertype "date"
163+
def isocalendar(self) -> tuple[int, int, int]: ... # type: ignore[override]
162164
@property
163165
def is_leap_year(self) -> bool: ...
164166
@property

pandas/conftest.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
zoneinfo = None
8585
if compat.PY39:
8686
# Import "zoneinfo" could not be resolved (reportMissingImports)
87-
import zoneinfo # type: ignore[no-redef]
87+
import zoneinfo # type: ignore[assignment]
8888

8989
# Although zoneinfo can be imported in Py39, it is effectively
9090
# "not available" without tzdata/IANA tz data.
@@ -1964,7 +1964,9 @@ def using_copy_on_write() -> bool:
19641964

19651965
warsaws = ["Europe/Warsaw", "dateutil/Europe/Warsaw"]
19661966
if zoneinfo is not None:
1967-
warsaws.append(zoneinfo.ZoneInfo("Europe/Warsaw"))
1967+
warsaws.append(
1968+
zoneinfo.ZoneInfo("Europe/Warsaw") # pyright: ignore[reportGeneralTypeIssues]
1969+
)
19681970

19691971

19701972
@pytest.fixture(params=warsaws)

pandas/core/generic.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -11756,8 +11756,7 @@ def __iand__(self, other) -> Self:
1175611756

1175711757
@final
1175811758
def __ior__(self, other) -> Self:
11759-
# error: Unsupported left operand type for | ("Type[NDFrame]")
11760-
return self._inplace_method(other, type(self).__or__) # type: ignore[operator]
11759+
return self._inplace_method(other, type(self).__or__)
1176111760

1176211761
@final
1176311762
def __ixor__(self, other) -> Self:

pandas/plotting/_core.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1831,7 +1831,9 @@ def _load_backend(backend: str) -> types.ModuleType:
18311831
if hasattr(eps, "select"):
18321832
entry = eps.select(group=key) # pyright: ignore[reportGeneralTypeIssues]
18331833
else:
1834-
entry = eps.get(key, ())
1834+
# Argument 2 to "get" of "dict" has incompatible type "Tuple[]";
1835+
# expected "EntryPoints" [arg-type]
1836+
entry = eps.get(key, ()) # type: ignore[arg-type]
18351837
for entry_point in entry:
18361838
found_backend = entry_point.name == backend
18371839
if found_backend:

pandas/tests/arrays/test_datetimes.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
"""
22
Tests for DatetimeArray
33
"""
4+
from __future__ import annotations
5+
46
from datetime import timedelta
57
import operator
68

79
try:
810
from zoneinfo import ZoneInfo
911
except ImportError:
10-
ZoneInfo = None
12+
# Cannot assign to a type
13+
ZoneInfo = None # type: ignore[misc, assignment]
1114

1215
import numpy as np
1316
import pytest
@@ -712,7 +715,9 @@ def test_tz_localize_t2d(self):
712715
# no tzdata
713716
pass
714717
else:
715-
easts.append(tz)
718+
# Argument 1 to "append" of "list" has incompatible type "ZoneInfo";
719+
# expected "str"
720+
easts.append(tz) # type: ignore[arg-type]
716721

717722
@pytest.mark.parametrize("tz", easts)
718723
def test_iter_zoneinfo_fold(self, tz):

pandas/tests/indexes/datetimes/test_constructors.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from datetime import (
24
datetime,
35
timedelta,

pandas/tests/indexes/datetimes/test_timezones.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
try:
2323
from zoneinfo import ZoneInfo
2424
except ImportError:
25-
ZoneInfo = None
25+
# Cannot assign to a type [misc]
26+
ZoneInfo = None # type: ignore[misc, assignment]
2627

2728
from pandas._libs.tslibs import (
2829
conversion,

pandas/tests/scalar/timestamp/test_constructors.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,10 @@ def test_timestamp_constructor_retain_fold(tz, fold):
848848
_tzs = ["dateutil/Europe/London"]
849849
if PY39:
850850
try:
851-
_tzs = ["dateutil/Europe/London", zoneinfo.ZoneInfo("Europe/London")]
851+
_tzs = [
852+
"dateutil/Europe/London",
853+
zoneinfo.ZoneInfo("Europe/London"), # type: ignore[list-item]
854+
]
852855
except zoneinfo.ZoneInfoNotFoundError:
853856
pass
854857

pandas/tests/scalar/timestamp/test_timezones.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
try:
3535
from zoneinfo import ZoneInfo
3636
except ImportError:
37-
ZoneInfo = None
37+
# Cannot assign to a type
38+
ZoneInfo = None # type: ignore[misc, assignment]
3839

3940

4041
class TestTimestampTZOperations:

0 commit comments

Comments
 (0)