Skip to content

Commit

Permalink
CI: Change development python version to 3.10 (pandas-dev#51133)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
2 people authored and topper-123 committed Apr 27, 2023
1 parent 7d52d2d commit a7bc431
Show file tree
Hide file tree
Showing 29 changed files with 71 additions and 104 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
image: ubuntu-2004:2022.04.1
resource_class: arm.large
environment:
ENV_FILE: ci/deps/circle-38-arm64.yaml
ENV_FILE: ci/deps/circle-39-arm64.yaml
PYTEST_WORKERS: auto
PATTERN: "not single_cpu and not slow and not network and not clipboard and not arm_slow and not db"
PYTEST_TARGET: "pandas"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ jobs:
id: setup_python
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.10'
cache: 'pip'
cache-dependency-path: 'requirements-dev.txt'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/package-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
id: setup_python
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.10'

- name: Install required dependencies
run: |
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11"]
concurrency:
# https://github.jparrowsec.cnmunity/t/concurrecy-not-work-for-push/183068/7
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{matrix.python-version}}-sdist
Expand Down Expand Up @@ -80,8 +80,6 @@ jobs:
- name: Force oldest supported NumPy
run: |
case "${{matrix.python-version}}" in
3.8)
pip install numpy==1.21.6 ;;
3.9)
pip install numpy==1.21.6 ;;
3.10)
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ jobs:
timeout-minutes: 180
strategy:
matrix:
env_file: [actions-38.yaml, actions-39.yaml, actions-310.yaml, actions-311.yaml]
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml]
# Prevent the include jobs from overriding other jobs
pattern: [""]
include:
- name: "Downstream Compat"
env_file: actions-38-downstream_compat.yaml
env_file: actions-39-downstream_compat.yaml
pattern: "not slow and not network and not single_cpu"
pytest_target: "pandas/tests/test_downstream.py"
- name: "Minimum Versions"
env_file: actions-38-minimum_versions.yaml
env_file: actions-39-minimum_versions.yaml
pattern: "not slow and not network and not single_cpu"
- name: "Locale: it_IT"
env_file: actions-38.yaml
env_file: actions-310.yaml
pattern: "not slow and not network and not single_cpu"
extra_apt: "language-pack-it"
# Use the utf8 version as the default, it has no bad side-effect.
Expand All @@ -48,7 +48,7 @@ jobs:
# It will be temporarily activated during tests with locale.setlocale
extra_loc: "it_IT"
- name: "Locale: zh_CN"
env_file: actions-38.yaml
env_file: actions-310.yaml
pattern: "not slow and not network and not single_cpu"
extra_apt: "language-pack-zh-hans"
# Use the utf8 version as the default, it has no bad side-effect.
Expand All @@ -62,7 +62,7 @@ jobs:
pattern: "not slow and not network and not single_cpu"
pandas_copy_on_write: "1"
- name: "Pypy"
env_file: actions-pypy-38.yaml
env_file: actions-pypy-39.yaml
pattern: "not slow and not network and not single_cpu"
test_args: "--max-worker-restart 0"
- name: "Numpy Dev"
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
strategy:
matrix:
os: [macos-latest, windows-latest]
env_file: [actions-38.yaml, actions-39.yaml, actions-310.yaml, actions-311.yaml]
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml]
fail-fast: false
runs-on: ${{ matrix.os }}
name: ${{ format('{0} {1}', matrix.os, matrix.env_file) }}
Expand Down Expand Up @@ -227,7 +227,7 @@ jobs:
fi
- name: Build environment and Run Tests
run: |
/opt/python/cp38-cp38/bin/python -m venv ~/virtualenvs/pandas-dev
/opt/python/cp39-cp39/bin/python -m venv ~/virtualenvs/pandas-dev
. ~/virtualenvs/pandas-dev/bin/activate
python -m pip install --no-cache-dir --no-deps -U pip wheel setuptools
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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- [windows-2019, win_amd64]
- [windows-2019, win32]
# TODO: support PyPy?
python: [["cp38", "3.8"], ["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"]]# "pp38", "pp39"]
python: [["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"]]# "pp39"]
env:
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
auto-update-conda: true
# Really doesn't matter what version we upload with
# just the version we test with
python-version: '3.8'
python-version: '3.10'
channels: conda-forge
channel-priority: true
# mamba fails to solve, also we really don't need this since we're just installing python
Expand Down
60 changes: 0 additions & 60 deletions ci/deps/actions-38.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: pandas-dev
channels:
- conda-forge
dependencies:
- python=3.8
- python=3.9

# build dependencies
- versioneer[toml]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: pandas-dev
channels:
- conda-forge
dependencies:
- python=3.8.0
- python=3.9

# build dependencies
- versioneer[toml]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dependencies:
# TODO: Add the rest of the dependencies in here
# once the other plentiful failures/segfaults
# with base pandas has been dealt with
- python=3.8[build=*_pypy] # TODO: use this once pypy3.8 is available
- python=3.9[build=*_pypy]

# build dependencies
- versioneer[toml]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: pandas-dev
channels:
- conda-forge
dependencies:
- python=3.8
- python=3.9

# build dependencies
- versioneer[toml]
Expand Down
1 change: 1 addition & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
# to ensure that include files (partial pages) aren't built, exclude them
# https://github.com/sphinx-doc/sphinx/issues/1965#issuecomment-124732907
"**/includes/**",
"**/api/pandas.Series.dt.rst",
]
try:
import nbconvert
Expand Down
2 changes: 1 addition & 1 deletion doc/source/development/contributing_gitpod.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ you do not have an account yet, you will need to create one first.

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

We have built a python 3.8 environment and all development dependencies will
We have built a python 3.10 environment and all development dependencies will
install when the environment starts.


Expand Down
2 changes: 1 addition & 1 deletion doc/source/getting_started/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Instructions for installing from source,
Python version support
----------------------

Officially Python 3.8, 3.9, 3.10 and 3.11.
Officially Python 3.9, 3.10 and 3.11.

Installing pandas
-----------------
Expand Down
5 changes: 5 additions & 0 deletions doc/source/whatsnew/v2.1.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ Backwards incompatible API changes

.. _whatsnew_210.api_breaking.deps:

Increased minimum version for Python
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

pandas 2.1.0 supports Python 3.9 and higher.

Increased minimum versions for dependencies
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Some minimum supported versions of dependencies were updated.
Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: pandas-dev
channels:
- conda-forge
dependencies:
- python=3.8
- python=3.10
- pip

# build dependencies
Expand Down Expand Up @@ -38,7 +38,7 @@ dependencies:
- matplotlib>=3.6.1
- numba>=0.55.2
- numexpr>=2.8.0 # pin for "Run checks on imported code" job
- openpyxl<3.1.1, >=3.0.7
- openpyxl>=3.0.10
- odfpy>=1.4.1
- py
- psycopg2>=2.9.3
Expand Down
4 changes: 3 additions & 1 deletion pandas/_libs/tslibs/timestamps.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ class Timestamp(datetime):
def __hash__(self) -> int: ...
def weekday(self) -> int: ...
def isoweekday(self) -> int: ...
def isocalendar(self) -> tuple[int, int, int]: ...
# Return type "Tuple[int, int, int]" of "isocalendar" incompatible with return
# type "_IsoCalendarDate" in supertype "date"
def isocalendar(self) -> tuple[int, int, int]: ... # type: ignore[override]
@property
def is_leap_year(self) -> bool: ...
@property
Expand Down
6 changes: 4 additions & 2 deletions pandas/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
zoneinfo = None
if compat.PY39:
# Import "zoneinfo" could not be resolved (reportMissingImports)
import zoneinfo # type: ignore[no-redef]
import zoneinfo # type: ignore[assignment]

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

warsaws = ["Europe/Warsaw", "dateutil/Europe/Warsaw"]
if zoneinfo is not None:
warsaws.append(zoneinfo.ZoneInfo("Europe/Warsaw"))
warsaws.append(
zoneinfo.ZoneInfo("Europe/Warsaw") # pyright: ignore[reportGeneralTypeIssues]
)


@pytest.fixture(params=warsaws)
Expand Down
3 changes: 1 addition & 2 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -11756,8 +11756,7 @@ def __iand__(self, other) -> Self:

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

@final
def __ixor__(self, other) -> Self:
Expand Down
4 changes: 3 additions & 1 deletion pandas/plotting/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1831,7 +1831,9 @@ def _load_backend(backend: str) -> types.ModuleType:
if hasattr(eps, "select"):
entry = eps.select(group=key) # pyright: ignore[reportGeneralTypeIssues]
else:
entry = eps.get(key, ())
# Argument 2 to "get" of "dict" has incompatible type "Tuple[]";
# expected "EntryPoints" [arg-type]
entry = eps.get(key, ()) # type: ignore[arg-type]
for entry_point in entry:
found_backend = entry_point.name == backend
if found_backend:
Expand Down
9 changes: 7 additions & 2 deletions pandas/tests/arrays/test_datetimes.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
"""
Tests for DatetimeArray
"""
from __future__ import annotations

from datetime import timedelta
import operator

try:
from zoneinfo import ZoneInfo
except ImportError:
ZoneInfo = None
# Cannot assign to a type
ZoneInfo = None # type: ignore[misc, assignment]

import numpy as np
import pytest
Expand Down Expand Up @@ -712,7 +715,9 @@ def test_tz_localize_t2d(self):
# no tzdata
pass
else:
easts.append(tz)
# Argument 1 to "append" of "list" has incompatible type "ZoneInfo";
# expected "str"
easts.append(tz) # type: ignore[arg-type]

@pytest.mark.parametrize("tz", easts)
def test_iter_zoneinfo_fold(self, tz):
Expand Down
2 changes: 2 additions & 0 deletions pandas/tests/indexes/datetimes/test_constructors.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from datetime import (
datetime,
timedelta,
Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/indexes/datetimes/test_timezones.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
try:
from zoneinfo import ZoneInfo
except ImportError:
ZoneInfo = None
# Cannot assign to a type [misc]
ZoneInfo = None # type: ignore[misc, assignment]

from pandas._libs.tslibs import (
conversion,
Expand Down
5 changes: 4 additions & 1 deletion pandas/tests/scalar/timestamp/test_constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,10 @@ def test_timestamp_constructor_retain_fold(tz, fold):
_tzs = ["dateutil/Europe/London"]
if PY39:
try:
_tzs = ["dateutil/Europe/London", zoneinfo.ZoneInfo("Europe/London")]
_tzs = [
"dateutil/Europe/London",
zoneinfo.ZoneInfo("Europe/London"), # type: ignore[list-item]
]
except zoneinfo.ZoneInfoNotFoundError:
pass

Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/scalar/timestamp/test_timezones.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
try:
from zoneinfo import ZoneInfo
except ImportError:
ZoneInfo = None
# Cannot assign to a type
ZoneInfo = None # type: ignore[misc, assignment]


class TestTimestampTZOperations:
Expand Down
Loading

0 comments on commit a7bc431

Please sign in to comment.