Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEPS: Drop Python 3.9 #58238

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
5248558
DEPS: Drop Python 3.9
mroeschke Apr 12, 2024
309991b
Update GHA files
mroeschke Apr 12, 2024
997c6b1
remove 3.8 ref in test file
mroeschke Apr 12, 2024
4ddcf75
Move back to 3.9 for pypy
mroeschke Apr 12, 2024
1dbe036
Bump pyupgrade
mroeschke Apr 12, 2024
3986c3a
Run pyupgrade
mroeschke Apr 12, 2024
a6b7938
Remove pandas.compat.compressors
mroeschke Apr 13, 2024
fc65cc5
Fix env file
mroeschke Apr 13, 2024
ab17fa1
Wronge error message
mroeschke Apr 13, 2024
2402302
Ignore pypy
mroeschke Apr 13, 2024
fe527cc
Merge remote-tracking branch 'upstream/main' into drop/39
mroeschke Apr 15, 2024
709a132
Test package checks with 3.12
mroeschke Apr 15, 2024
4e2a4de
Modify subprocess test
mroeschke Apr 15, 2024
ba2d2cf
revert conda-forge checks
mroeschke Apr 15, 2024
52a7c0b
Merge remote-tracking branch 'upstream/main' into drop/39
mroeschke Apr 15, 2024
c5fea80
Merge remote-tracking branch 'upstream/main' into drop/39
mroeschke Apr 16, 2024
f083f68
Remove 3.9 from circleci
mroeschke Apr 17, 2024
9323bfd
Merge remote-tracking branch 'upstream/main' into drop/39
mroeschke Apr 17, 2024
4264d9d
Merge remote-tracking branch 'upstream/main' into drop/39
mroeschke Apr 17, 2024
37a5044
Merge remote-tracking branch 'upstream/main' into drop/39
mroeschke Apr 22, 2024
68703e5
Merge remote-tracking branch 'upstream/main' into drop/39
mroeschke Apr 24, 2024
3f630be
Merge remote-tracking branch 'upstream/main' into drop/39
mroeschke Apr 24, 2024
0d8defc
Pyupgrade
mroeschke Apr 24, 2024
98a82dd
Merge branch 'main' into drop/39
mroeschke May 7, 2024
d1c53b3
Merge branch 'main' into drop/39
mroeschke May 10, 2024
70ad4a4
Merge remote-tracking branch 'upstream/main' into drop/39
mroeschke May 15, 2024
470ec04
Merge branch 'drop/39' of https://github.com/mroeschke/pandas into dr…
mroeschke May 15, 2024
330907e
Merge branch 'main' into drop/39
mroeschke May 17, 2024
8e38846
Merge remote-tracking branch 'upstream/main' into drop/39
mroeschke Jun 3, 2024
21f8038
Don't build 39 wheels
mroeschke Jun 3, 2024
f42c9f3
Merge branch 'drop/39' of https://github.com/mroeschke/pandas into dr…
mroeschke Jun 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/package-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']
python-version: ['3.10', '3.11']
twoertwein marked this conversation as resolved.
Show resolved Hide resolved
fail-fast: false
name: Test Conda Forge Recipe - Python ${{ matrix.python-version }}
concurrency:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
timeout-minutes: 90
strategy:
matrix:
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml, actions-312.yaml]
env_file: [actions-310.yaml, actions-311.yaml, actions-312.yaml]
# Prevent the include jobs from overriding other jobs
pattern: [""]
include:
Expand All @@ -35,7 +35,7 @@ jobs:
pattern: "not slow and not network and not single_cpu"
pytest_target: "pandas/tests/test_downstream.py"
- name: "Minimum Versions"
env_file: actions-39-minimum_versions.yaml
env_file: actions-310-minimum_versions.yaml
pattern: "not slow and not network and not single_cpu"
- name: "Locale: it_IT"
env_file: actions-311.yaml
Expand Down Expand Up @@ -146,6 +146,8 @@ jobs:
- name: Build Pandas
id: build
uses: ./.github/actions/build_pandas
# TODO: Re-enable once Pypy has Pypy 3.10 on conda-forge
if: ${{ matrix.name != 'Pypy' }}
with:
meson_args: ${{ matrix.meson_args }}
cflags_adds: ${{ matrix.cflags_adds }}
Expand All @@ -170,7 +172,7 @@ jobs:
matrix:
# Note: Don't use macOS latest since macos 14 appears to be arm64 only
os: [macos-13, macos-14, windows-latest]
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml, actions-312.yaml]
env_file: [actions-310.yaml, actions-311.yaml, actions-312.yaml]
fail-fast: false
runs-on: ${{ matrix.os }}
name: ${{ format('{0} {1}', matrix.os, matrix.env_file) }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
- [macos-14, macosx_arm64]
- [windows-2022, win_amd64]
# TODO: support PyPy?
python: [["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"], ["cp312", "3.12"]]
python: [["cp310", "3.10"], ["cp311", "3.11"], ["cp312", "3.12"]]
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ repos:
rev: v3.15.2
hooks:
- id: pyupgrade
args: [--py39-plus]
args: [--py310-plus]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
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.9
- python=3.10

# build dependencies
- versioneer[toml]
Expand Down
63 changes: 0 additions & 63 deletions ci/deps/actions-39.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion doc/source/development/contributing_environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Consult the docs for setting up pyenv `here <https://github.com/pyenv/pyenv>`__.
pyenv virtualenv <version> <name-to-give-it>

# For instance:
pyenv virtualenv 3.9.10 pandas-dev
pyenv virtualenv 3.10 pandas-dev

# Activate the virtualenv
pyenv activate pandas-dev
Expand Down
4 changes: 2 additions & 2 deletions doc/source/getting_started/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Instructions for installing :ref:`from source <install.source>`,
Python version support
----------------------

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

Installing pandas
-----------------
Expand Down Expand Up @@ -161,7 +161,7 @@ Python terminal.

>>> import pandas as pd
>>> pd.test()
running: pytest -m "not slow and not network and not db" /home/user/anaconda3/lib/python3.9/site-packages/pandas
running: pytest -m "not slow and not network and not db" /home/user/anaconda3/lib/python3.10/site-packages/pandas

============================= test session starts ==============================
platform linux -- Python 3.9.7, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
Expand Down
5 changes: 5 additions & 0 deletions doc/source/whatsnew/v3.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ Backwards incompatible API changes

.. _whatsnew_300.api_breaking.deps:

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

pandas 3.0.0 supports Python 3.10 and higher.

Increased minimum versions for dependencies
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Some minimum supported versions of dependencies were updated.
Expand Down
2 changes: 1 addition & 1 deletion pandas/_config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
from typing import (
TYPE_CHECKING,
Any,
Callable,
NamedTuple,
cast,
)
Expand All @@ -66,6 +65,7 @@

if TYPE_CHECKING:
from collections.abc import (
Callable,
Generator,
Sequence,
)
Expand Down
3 changes: 2 additions & 1 deletion pandas/_testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from sys import byteorder
from typing import (
TYPE_CHECKING,
Callable,
ContextManager,
cast,
)
Expand Down Expand Up @@ -87,6 +86,8 @@
from pandas.core.construction import extract_array

if TYPE_CHECKING:
from collections.abc import Callable

from pandas._typing import (
Dtype,
NpDtype,
Expand Down
15 changes: 8 additions & 7 deletions pandas/_testing/_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,18 @@
from typing import (
TYPE_CHECKING,
Any,
Callable,
)
import uuid
import zipfile

from pandas.compat import (
get_bz2_file,
get_lzma_file,
)
from pandas.compat._optional import import_optional_dependency

import pandas as pd
from pandas._testing.contexts import ensure_clean

if TYPE_CHECKING:
from collections.abc import Callable

from pandas._typing import (
FilePath,
ReadPickleBuffer,
Expand Down Expand Up @@ -129,11 +126,15 @@ def write_to_compressed(compression, path, data, dest: str = "test") -> None:
elif compression == "gzip":
compress_method = gzip.GzipFile
elif compression == "bz2":
compress_method = get_bz2_file()
import bz2

compress_method = bz2.BZ2File
elif compression == "zstd":
compress_method = import_optional_dependency("zstandard").open
elif compression == "xz":
compress_method = get_lzma_file()
import lzma

compress_method = lzma.LZMAFile
else:
raise ValueError(f"Unrecognized compression type: {compression}")

Expand Down
20 changes: 7 additions & 13 deletions pandas/_typing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

from collections.abc import (
Callable,
Hashable,
Iterator,
Mapping,
Expand All @@ -18,7 +19,6 @@
from typing import (
TYPE_CHECKING,
Any,
Callable,
Literal,
Optional,
Protocol,
Expand Down Expand Up @@ -90,18 +90,12 @@
# Name "npt._ArrayLikeInt_co" is not defined [name-defined]
NumpySorter = Optional[npt._ArrayLikeInt_co] # type: ignore[name-defined]

from typing import SupportsIndex

if sys.version_info >= (3, 10):
from typing import Concatenate # pyright: ignore[reportUnusedImport]
from typing import ParamSpec
from typing import TypeGuard # pyright: ignore[reportUnusedImport]
else:
from typing_extensions import ( # pyright: ignore[reportUnusedImport]
Concatenate,
ParamSpec,
TypeGuard,
)
from typing import (
ParamSpec,
SupportsIndex,
)
from typing import Concatenate # pyright: ignore[reportUnusedImport]
from typing import TypeGuard # pyright: ignore[reportUnusedImport]
Dr-Irv marked this conversation as resolved.
Show resolved Hide resolved

P = ParamSpec("P")

Expand Down
2 changes: 1 addition & 1 deletion pandas/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@

"""Git implementation of _version.py."""

from collections.abc import Callable
import errno
import functools
import os
import re
import subprocess
import sys
from typing import Callable


def get_keywords():
Expand Down
49 changes: 0 additions & 49 deletions pandas/compat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@
from pandas.compat._constants import (
IS64,
ISMUSL,
PY310,
PY311,
PY312,
PYPY,
)
import pandas.compat.compressors
from pandas.compat.numpy import is_numpy_dev
from pandas.compat.pyarrow import (
pa_version_under10p1,
Expand Down Expand Up @@ -135,52 +133,6 @@ def is_ci_environment() -> bool:
return os.environ.get("PANDAS_CI", "0") == "1"


def get_lzma_file() -> type[pandas.compat.compressors.LZMAFile]:
"""
Importing the `LZMAFile` class from the `lzma` module.

Returns
-------
class
The `LZMAFile` class from the `lzma` module.

Raises
------
RuntimeError
If the `lzma` module was not imported correctly, or didn't exist.
"""
if not pandas.compat.compressors.has_lzma:
raise RuntimeError(
"lzma module not available. "
"A Python re-install with the proper dependencies, "
"might be required to solve this issue."
)
return pandas.compat.compressors.LZMAFile


def get_bz2_file() -> type[pandas.compat.compressors.BZ2File]:
"""
Importing the `BZ2File` class from the `bz2` module.

Returns
-------
class
The `BZ2File` class from the `bz2` module.

Raises
------
RuntimeError
If the `bz2` module was not imported correctly, or didn't exist.
"""
if not pandas.compat.compressors.has_bz2:
raise RuntimeError(
"bz2 module not available. "
"A Python re-install with the proper dependencies, "
"might be required to solve this issue."
)
return pandas.compat.compressors.BZ2File


__all__ = [
"is_numpy_dev",
"pa_version_under10p1",
Expand All @@ -191,7 +143,6 @@ def get_bz2_file() -> type[pandas.compat.compressors.BZ2File]:
"pa_version_under16p0",
"IS64",
"ISMUSL",
"PY310",
"PY311",
"PY312",
"PYPY",
Expand Down
2 changes: 0 additions & 2 deletions pandas/compat/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

IS64 = sys.maxsize > 2**32

PY310 = sys.version_info >= (3, 10)
PY311 = sys.version_info >= (3, 11)
PY312 = sys.version_info >= (3, 12)
PYPY = platform.python_implementation() == "PyPy"
Expand All @@ -23,7 +22,6 @@
__all__ = [
"IS64",
"ISMUSL",
"PY310",
"PY311",
"PY312",
"PYPY",
Expand Down