From 638b57875424cc2beba2a01e8a3fe8b82e69849d Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Fri, 3 Feb 2023 00:12:47 +0100 Subject: [PATCH 01/30] CI: Change development python version to 3.10 --- .circleci/config.yml | 2 +- .github/workflows/ubuntu.yml | 2 +- ...mpat.yaml => actions-310-downstream_compat.yaml} | 2 +- .../{circle-38-arm64.yaml => circle-10-arm64.yaml} | 2 +- environment.yml | 2 +- pandas/_libs/tslibs/timestamps.pyi | 4 +++- pandas/core/generic.py | 7 +++---- pandas/plotting/_core.py | 13 ++++++++++--- pandas/tests/arrays/test_datetimes.py | 11 ++++++++--- pandas/tests/indexes/datetimes/test_constructors.py | 1 + pandas/tests/indexes/datetimes/test_timezones.py | 5 +++-- pandas/tests/scalar/timestamp/test_timezones.py | 3 ++- pyproject.toml | 8 ++++---- 13 files changed, 39 insertions(+), 23 deletions(-) rename ci/deps/{actions-38-downstream_compat.yaml => actions-310-downstream_compat.yaml} (98%) rename ci/deps/{circle-38-arm64.yaml => circle-10-arm64.yaml} (98%) diff --git a/.circleci/config.yml b/.circleci/config.yml index e7beb78cf6e6d..1f8d9d89ffe2e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ jobs: image: ubuntu-2004:202101-01 resource_class: arm.large environment: - ENV_FILE: ci/deps/circle-38-arm64.yaml + ENV_FILE: ci/deps/circle-310-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" diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 6726139ed5fa4..6cbc552d61acf 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -32,7 +32,7 @@ jobs: pyarrow_version: ["7", "8", "9", "10"] include: - name: "Downstream Compat" - env_file: actions-38-downstream_compat.yaml + env_file: actions-310-downstream_compat.yaml pattern: "not slow and not network and not single_cpu" pytest_target: "pandas/tests/test_downstream.py" - name: "Minimum Versions" diff --git a/ci/deps/actions-38-downstream_compat.yaml b/ci/deps/actions-310-downstream_compat.yaml similarity index 98% rename from ci/deps/actions-38-downstream_compat.yaml rename to ci/deps/actions-310-downstream_compat.yaml index 1de392a9cc277..8b1288ce5e84b 100644 --- a/ci/deps/actions-38-downstream_compat.yaml +++ b/ci/deps/actions-310-downstream_compat.yaml @@ -3,7 +3,7 @@ name: pandas-dev channels: - conda-forge dependencies: - - python=3.8 + - python=3.10 # build dependencies - versioneer[toml] diff --git a/ci/deps/circle-38-arm64.yaml b/ci/deps/circle-10-arm64.yaml similarity index 98% rename from ci/deps/circle-38-arm64.yaml rename to ci/deps/circle-10-arm64.yaml index 7dcb84dc8874c..3d829460b300e 100644 --- a/ci/deps/circle-38-arm64.yaml +++ b/ci/deps/circle-10-arm64.yaml @@ -2,7 +2,7 @@ name: pandas-dev channels: - conda-forge dependencies: - - python=3.8 + - python=3.10 # build dependencies - versioneer[toml] diff --git a/environment.yml b/environment.yml index 076e6fa727332..036761ce8431d 100644 --- a/environment.yml +++ b/environment.yml @@ -3,7 +3,7 @@ name: pandas-dev channels: - conda-forge dependencies: - - python=3.8 + - python=3.10 - pip # build dependencies diff --git a/pandas/_libs/tslibs/timestamps.pyi b/pandas/_libs/tslibs/timestamps.pyi index e6a36b69a8d47..2154ed943bb3d 100644 --- a/pandas/_libs/tslibs/timestamps.pyi +++ b/pandas/_libs/tslibs/timestamps.pyi @@ -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 diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 8fa86e80e1a44..40c922cc7a395 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -7178,7 +7178,7 @@ def replace( items = list(to_replace.items()) if items: - keys, values = zip(*items) + keys, values = zip(*items, strict=False) else: keys, values = ([], []) @@ -7195,7 +7195,7 @@ def replace( value_dict = {} for k, v in items: - keys, values = list(zip(*v.items())) or ([], []) + keys, values = list(zip(*v.items(), strict=False)) or ([], []) to_rep_dict[k] = list(keys) value_dict[k] = list(values) @@ -11729,8 +11729,7 @@ def __iand__(self: NDFrameT, other) -> NDFrameT: return self._inplace_method(other, type(self).__and__) # type: ignore[operator] def __ior__(self: NDFrameT, other) -> NDFrameT: - # 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__) def __ixor__(self: NDFrameT, other) -> NDFrameT: # error: Unsupported left operand type for ^ ("Type[NDFrame]") diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index fbd1eef138792..e34a1cfcb051a 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -882,7 +882,10 @@ def _get_call_args(backend_name, data, args, kwargs): if args and isinstance(data, ABCSeries): positional_args = str(args)[1:-1] keyword_args = ", ".join( - [f"{name}={repr(value)}" for (name, _), value in zip(arg_def, args)] + [ + f"{name}={repr(value)}" + for (name, _), value in zip(arg_def, args, strict=False) + ] ) msg = ( "`Series.plot()` should not be called with positional " @@ -893,7 +896,9 @@ def _get_call_args(backend_name, data, args, kwargs): ) raise TypeError(msg) - pos_args = {name: value for (name, _), value in zip(arg_def, args)} + pos_args = { + name: value for (name, _), value in zip(arg_def, args, strict=False) + } if backend_name == "pandas.plotting._matplotlib": kwargs = dict(arg_def, **pos_args, **kwargs) else: @@ -1819,7 +1824,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: diff --git a/pandas/tests/arrays/test_datetimes.py b/pandas/tests/arrays/test_datetimes.py index 53c9b3d174967..75f3c0ebb6d7e 100644 --- a/pandas/tests/arrays/test_datetimes.py +++ b/pandas/tests/arrays/test_datetimes.py @@ -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 @@ -139,7 +142,7 @@ def test_iter(self, dta): def test_astype_object(self, dta): result = dta.astype(object) assert all(x._creso == dta._creso for x in result) - assert all(x == y for x, y in zip(result, dta)) + assert all(x == y for x, y in zip(result, dta, strict=False)) def test_to_pydatetime(self, dta_dti): dta, dti = dta_dti @@ -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): diff --git a/pandas/tests/indexes/datetimes/test_constructors.py b/pandas/tests/indexes/datetimes/test_constructors.py index 1d82d3d9c5b9d..5fa92093b56e4 100644 --- a/pandas/tests/indexes/datetimes/test_constructors.py +++ b/pandas/tests/indexes/datetimes/test_constructors.py @@ -1156,6 +1156,7 @@ def test_timestamp_constructor_retain_fold(tz, fold): assert result == expected +_tzs: list[str | zoneinfo.ZoneInfo] _tzs = ["dateutil/Europe/London"] if PY39: try: diff --git a/pandas/tests/indexes/datetimes/test_timezones.py b/pandas/tests/indexes/datetimes/test_timezones.py index 65207a4d7a60f..5e5e8dac5b6f1 100644 --- a/pandas/tests/indexes/datetimes/test_timezones.py +++ b/pandas/tests/indexes/datetimes/test_timezones.py @@ -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, @@ -963,7 +964,7 @@ def test_timestamp_equality_different_timezones(self): eastern_range = utc_range.tz_convert("US/Eastern") berlin_range = utc_range.tz_convert("Europe/Berlin") - for a, b, c in zip(utc_range, eastern_range, berlin_range): + for a, b, c in zip(utc_range, eastern_range, berlin_range, strict=False): assert a == b assert b == c assert a == c diff --git a/pandas/tests/scalar/timestamp/test_timezones.py b/pandas/tests/scalar/timestamp/test_timezones.py index e2df4d23bd858..347a4b19e42d1 100644 --- a/pandas/tests/scalar/timestamp/test_timezones.py +++ b/pandas/tests/scalar/timestamp/test_timezones.py @@ -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: diff --git a/pyproject.toml b/pyproject.toml index 3ddc247292ca9..85c43d909b923 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -165,7 +165,7 @@ select = "*-win32" environment = { IS_32_BIT="true" } [tool.black] -target-version = ['py38', 'py39'] +target-version = ['py39', 'py310'] exclude = ''' ( asv_bench/env @@ -187,7 +187,7 @@ exclude = ''' [tool.ruff] line-length = 88 update-check = false -target-version = "py38" +target-version = "py310" select = [ # pyflakes @@ -401,7 +401,7 @@ follow_imports_for_stubs = false no_site_packages = false no_silence_site_packages = false # Platform configuration -python_version = "3.8" +python_version = "3.10" platform = "linux-64" # Disallow dynamic typing disallow_any_unimported = false # TODO @@ -479,7 +479,7 @@ skip_glob = "env" skip = "pandas/__init__.py" [tool.pyright] -pythonVersion = "3.8" +pythonVersion = "3.10" typeCheckingMode = "basic" include = ["pandas", "typings"] exclude = ["pandas/tests", "pandas/io/clipboard", "pandas/util/version"] From 9c9b3adcac3596767ae65106720458734187548f Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Fri, 3 Feb 2023 00:15:56 +0100 Subject: [PATCH 02/30] Update checks --- .github/workflows/code-checks.yml | 2 +- .github/workflows/package-checks.yml | 2 +- .github/workflows/wheels.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/code-checks.yml b/.github/workflows/code-checks.yml index 280b6ed601f08..9693c9bb79d26 100644 --- a/.github/workflows/code-checks.yml +++ b/.github/workflows/code-checks.yml @@ -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' diff --git a/.github/workflows/package-checks.yml b/.github/workflows/package-checks.yml index eb065c6e2e87d..01431fa5e2b0e 100644 --- a/.github/workflows/package-checks.yml +++ b/.github/workflows/package-checks.yml @@ -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: | diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 665aeb6bc7f87..e78b0fc37009d 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -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 From 7fb6db9c29a5bd156a6d728a76bd41835fe11763 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Fri, 3 Feb 2023 00:23:07 +0100 Subject: [PATCH 03/30] Remove strict --- pandas/core/generic.py | 4 ++-- pandas/plotting/_core.py | 4 +--- pandas/tests/arrays/test_datetimes.py | 2 +- pandas/tests/indexes/datetimes/test_timezones.py | 2 +- pyproject.toml | 2 ++ 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 40c922cc7a395..ee5bc93545ffc 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -7178,7 +7178,7 @@ def replace( items = list(to_replace.items()) if items: - keys, values = zip(*items, strict=False) + keys, values = zip(*items) else: keys, values = ([], []) @@ -7195,7 +7195,7 @@ def replace( value_dict = {} for k, v in items: - keys, values = list(zip(*v.items(), strict=False)) or ([], []) + keys, values = list(zip(*v.items())) or ([], []) to_rep_dict[k] = list(keys) value_dict[k] = list(values) diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index e34a1cfcb051a..9e272c75335ff 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -896,9 +896,7 @@ def _get_call_args(backend_name, data, args, kwargs): ) raise TypeError(msg) - pos_args = { - name: value for (name, _), value in zip(arg_def, args, strict=False) - } + pos_args = {name: value for (name, _), value in zip(arg_def, args)} if backend_name == "pandas.plotting._matplotlib": kwargs = dict(arg_def, **pos_args, **kwargs) else: diff --git a/pandas/tests/arrays/test_datetimes.py b/pandas/tests/arrays/test_datetimes.py index 75f3c0ebb6d7e..b10ba31ed1e4a 100644 --- a/pandas/tests/arrays/test_datetimes.py +++ b/pandas/tests/arrays/test_datetimes.py @@ -142,7 +142,7 @@ def test_iter(self, dta): def test_astype_object(self, dta): result = dta.astype(object) assert all(x._creso == dta._creso for x in result) - assert all(x == y for x, y in zip(result, dta, strict=False)) + assert all(x == y for x, y in zip(result, dta)) def test_to_pydatetime(self, dta_dti): dta, dti = dta_dti diff --git a/pandas/tests/indexes/datetimes/test_timezones.py b/pandas/tests/indexes/datetimes/test_timezones.py index 5e5e8dac5b6f1..92356f2722cdb 100644 --- a/pandas/tests/indexes/datetimes/test_timezones.py +++ b/pandas/tests/indexes/datetimes/test_timezones.py @@ -964,7 +964,7 @@ def test_timestamp_equality_different_timezones(self): eastern_range = utc_range.tz_convert("US/Eastern") berlin_range = utc_range.tz_convert("Europe/Berlin") - for a, b, c in zip(utc_range, eastern_range, berlin_range, strict=False): + for a, b, c in zip(utc_range, eastern_range, berlin_range): assert a == b assert b == c assert a == c diff --git a/pyproject.toml b/pyproject.toml index 85c43d909b923..ee8bbcb9b2465 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -242,6 +242,8 @@ ignore = [ # Additional checks that don't pass yet # Within an except clause, raise exceptions with ... "B904", + # Only works with python >=3.10 + "B905", ] exclude = [ From e67c34c3bd9e5eee00096efde23a102bc985fcbb Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Fri, 3 Feb 2023 00:24:03 +0100 Subject: [PATCH 04/30] Remove strict --- pandas/plotting/_core.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index 9e272c75335ff..a4167d86e38c3 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -882,10 +882,7 @@ def _get_call_args(backend_name, data, args, kwargs): if args and isinstance(data, ABCSeries): positional_args = str(args)[1:-1] keyword_args = ", ".join( - [ - f"{name}={repr(value)}" - for (name, _), value in zip(arg_def, args, strict=False) - ] + [f"{name}={repr(value)}" for (name, _), value in zip(arg_def, args)] ) msg = ( "`Series.plot()` should not be called with positional " From 20751917c95d12c7ceb8f9cbf0c76d87b3bd36b9 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Fri, 3 Feb 2023 10:19:25 +0100 Subject: [PATCH 05/30] Fixes --- ci/deps/{circle-10-arm64.yaml => circle-310-arm64.yaml} | 0 pandas/conftest.py | 4 +++- pandas/tests/indexes/datetimes/test_constructors.py | 2 ++ scripts/run_stubtest.py | 3 ++- 4 files changed, 7 insertions(+), 2 deletions(-) rename ci/deps/{circle-10-arm64.yaml => circle-310-arm64.yaml} (100%) diff --git a/ci/deps/circle-10-arm64.yaml b/ci/deps/circle-310-arm64.yaml similarity index 100% rename from ci/deps/circle-10-arm64.yaml rename to ci/deps/circle-310-arm64.yaml diff --git a/pandas/conftest.py b/pandas/conftest.py index 64a8f0f9efc1d..11cfd2adbe32c 100644 --- a/pandas/conftest.py +++ b/pandas/conftest.py @@ -1938,7 +1938,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) diff --git a/pandas/tests/indexes/datetimes/test_constructors.py b/pandas/tests/indexes/datetimes/test_constructors.py index 5fa92093b56e4..8d4dc07fac994 100644 --- a/pandas/tests/indexes/datetimes/test_constructors.py +++ b/pandas/tests/indexes/datetimes/test_constructors.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from datetime import ( datetime, timedelta, diff --git a/scripts/run_stubtest.py b/scripts/run_stubtest.py index db7a327f231b5..0a4f98129bbbf 100644 --- a/scripts/run_stubtest.py +++ b/scripts/run_stubtest.py @@ -49,8 +49,9 @@ "pandas._libs.lib._NoDefault.no_default", # internal type alias (should probably be private) "pandas._libs.lib.ndarray_obj_2d", + # runtime argument "owner" has a default value but stub argument does not + "pandas._libs.properties.AxisProperty.__get__", # workaround for mypy (cache_readonly = property) - "pandas._libs.properties.cache_readonly.__get__", "pandas._libs.properties.cache_readonly.deleter", "pandas._libs.properties.cache_readonly.getter", "pandas._libs.properties.cache_readonly.setter", From 1ad202f34f2820526b3cb05a23bba1235fb4289f Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Fri, 3 Feb 2023 18:51:25 +0100 Subject: [PATCH 06/30] Add dt --- doc/source/reference/series.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/reference/series.rst b/doc/source/reference/series.rst index 659385c611ff0..667eca49ef77f 100644 --- a/doc/source/reference/series.rst +++ b/doc/source/reference/series.rst @@ -298,6 +298,7 @@ Datetime properties :toctree: api/ :template: autosummary/accessor_attribute.rst + Series.dt Series.dt.date Series.dt.time Series.dt.timetz From 2301bd5326c3ff51db524cc0ad2e440aa7a4262c Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Sat, 4 Feb 2023 23:09:43 +0100 Subject: [PATCH 07/30] Switch python to 3.9 --- .circleci/config.yml | 2 +- .github/workflows/ubuntu.yml | 2 +- ...downstream_compat.yaml => actions-39-downstream_compat.yaml} | 2 +- ci/deps/{circle-310-arm64.yaml => circle-39-arm64.yaml} | 2 +- environment.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename ci/deps/{actions-310-downstream_compat.yaml => actions-39-downstream_compat.yaml} (98%) rename ci/deps/{circle-310-arm64.yaml => circle-39-arm64.yaml} (98%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1f8d9d89ffe2e..1c4a92d8a3543 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ jobs: image: ubuntu-2004:202101-01 resource_class: arm.large environment: - ENV_FILE: ci/deps/circle-310-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" diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 6cbc552d61acf..8fc041821aadf 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -32,7 +32,7 @@ jobs: pyarrow_version: ["7", "8", "9", "10"] include: - name: "Downstream Compat" - env_file: actions-310-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" diff --git a/ci/deps/actions-310-downstream_compat.yaml b/ci/deps/actions-39-downstream_compat.yaml similarity index 98% rename from ci/deps/actions-310-downstream_compat.yaml rename to ci/deps/actions-39-downstream_compat.yaml index 8b1288ce5e84b..9ae3bcdcbe07d 100644 --- a/ci/deps/actions-310-downstream_compat.yaml +++ b/ci/deps/actions-39-downstream_compat.yaml @@ -3,7 +3,7 @@ name: pandas-dev channels: - conda-forge dependencies: - - python=3.10 + - python=3.9 # build dependencies - versioneer[toml] diff --git a/ci/deps/circle-310-arm64.yaml b/ci/deps/circle-39-arm64.yaml similarity index 98% rename from ci/deps/circle-310-arm64.yaml rename to ci/deps/circle-39-arm64.yaml index 3d829460b300e..5418c567cf532 100644 --- a/ci/deps/circle-310-arm64.yaml +++ b/ci/deps/circle-39-arm64.yaml @@ -2,7 +2,7 @@ name: pandas-dev channels: - conda-forge dependencies: - - python=3.10 + - python=3.9 # build dependencies - versioneer[toml] diff --git a/environment.yml b/environment.yml index 036761ce8431d..b4ed3cf246dfa 100644 --- a/environment.yml +++ b/environment.yml @@ -3,7 +3,7 @@ name: pandas-dev channels: - conda-forge dependencies: - - python=3.10 + - python=3.9 - pip # build dependencies From bec8bbbcd9560fbda20b59121a7d636e20bba19e Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Sun, 5 Feb 2023 00:38:14 +0100 Subject: [PATCH 08/30] Remove --- doc/source/reference/series.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/source/reference/series.rst b/doc/source/reference/series.rst index 667eca49ef77f..659385c611ff0 100644 --- a/doc/source/reference/series.rst +++ b/doc/source/reference/series.rst @@ -298,7 +298,6 @@ Datetime properties :toctree: api/ :template: autosummary/accessor_attribute.rst - Series.dt Series.dt.date Series.dt.time Series.dt.timetz From 3779b0128fbc81b1a2dc6ba4527d479918570c4e Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Sun, 5 Feb 2023 00:39:16 +0100 Subject: [PATCH 09/30] Fix --- scripts/run_stubtest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run_stubtest.py b/scripts/run_stubtest.py index 0a4f98129bbbf..7986179e07ad4 100644 --- a/scripts/run_stubtest.py +++ b/scripts/run_stubtest.py @@ -50,8 +50,8 @@ # internal type alias (should probably be private) "pandas._libs.lib.ndarray_obj_2d", # runtime argument "owner" has a default value but stub argument does not - "pandas._libs.properties.AxisProperty.__get__", # workaround for mypy (cache_readonly = property) + "pandas._libs.properties.cache_readonly.__get__", "pandas._libs.properties.cache_readonly.deleter", "pandas._libs.properties.cache_readonly.getter", "pandas._libs.properties.cache_readonly.setter", From c0bf94539c5672796ca8c20fcf0f2ca33d4c1413 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Mon, 6 Feb 2023 14:10:06 +0100 Subject: [PATCH 10/30] Try attribute --- doc/source/reference/series.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/reference/series.rst b/doc/source/reference/series.rst index 659385c611ff0..bd64b8753cda2 100644 --- a/doc/source/reference/series.rst +++ b/doc/source/reference/series.rst @@ -14,6 +14,8 @@ Constructor Series +.. autoaccessorattribute:: Series.dt + Attributes ---------- **Axes** From 19e22f6230d4ec14c27e0ccf01a5d52677c2939a Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Fri, 7 Apr 2023 17:35:58 +0200 Subject: [PATCH 11/30] Adjust --- doc/source/reference/series.rst | 2 -- environment.yml | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/doc/source/reference/series.rst b/doc/source/reference/series.rst index c53e44810ce7b..5a43e5796d1d9 100644 --- a/doc/source/reference/series.rst +++ b/doc/source/reference/series.rst @@ -14,8 +14,6 @@ Constructor Series -.. autoaccessorattribute:: Series.dt - Attributes ---------- **Axes** diff --git a/environment.yml b/environment.yml index 4bd78532d1ad8..b915fd9a6798c 100644 --- a/environment.yml +++ b/environment.yml @@ -3,7 +3,7 @@ name: pandas-dev channels: - conda-forge dependencies: - - python=3.9 + - python=3.10 - pip # build dependencies From 93d475ebcb0096db0d354710554eea7394a98971 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Sun, 9 Apr 2023 17:53:01 +0200 Subject: [PATCH 12/30] Fix mypy --- pandas/conftest.py | 2 +- pandas/tests/scalar/timestamp/test_constructors.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pandas/conftest.py b/pandas/conftest.py index 7120093872670..8fd514a3e7546 100644 --- a/pandas/conftest.py +++ b/pandas/conftest.py @@ -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. diff --git a/pandas/tests/scalar/timestamp/test_constructors.py b/pandas/tests/scalar/timestamp/test_constructors.py index b855232179b51..4fb13ff6453a3 100644 --- a/pandas/tests/scalar/timestamp/test_constructors.py +++ b/pandas/tests/scalar/timestamp/test_constructors.py @@ -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 = [ # type: ignore[list-item] + "dateutil/Europe/London", + zoneinfo.ZoneInfo("Europe/London"), + ] except zoneinfo.ZoneInfoNotFoundError: pass From 60a6ad52038f828e862f0cb84021118e3d60b39e Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Sun, 9 Apr 2023 17:55:43 +0200 Subject: [PATCH 13/30] Try fixing doc build --- doc/source/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index c73a91aa90365..d808d60b1ac95 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -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 From f0d47ac7fa9bb4fe1162a5463da2ff79c4d552a4 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Sun, 9 Apr 2023 22:22:51 +0200 Subject: [PATCH 14/30] Fix mypy --- pandas/tests/scalar/timestamp/test_constructors.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/tests/scalar/timestamp/test_constructors.py b/pandas/tests/scalar/timestamp/test_constructors.py index 4fb13ff6453a3..4851612392e68 100644 --- a/pandas/tests/scalar/timestamp/test_constructors.py +++ b/pandas/tests/scalar/timestamp/test_constructors.py @@ -848,9 +848,9 @@ def test_timestamp_constructor_retain_fold(tz, fold): _tzs = ["dateutil/Europe/London"] if PY39: try: - _tzs = [ # type: ignore[list-item] + _tzs = [ "dateutil/Europe/London", - zoneinfo.ZoneInfo("Europe/London"), + zoneinfo.ZoneInfo("Europe/London"), # type: ignore[list-item] ] except zoneinfo.ZoneInfoNotFoundError: pass From 4e819a752023e1fc041a37b19f71d186296ff56e Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Thu, 13 Apr 2023 01:12:56 +0200 Subject: [PATCH 15/30] Fix stubtest --- scripts/run_stubtest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/run_stubtest.py b/scripts/run_stubtest.py index 7986179e07ad4..23e044ab447e4 100644 --- a/scripts/run_stubtest.py +++ b/scripts/run_stubtest.py @@ -50,6 +50,7 @@ # internal type alias (should probably be private) "pandas._libs.lib.ndarray_obj_2d", # runtime argument "owner" has a default value but stub argument does not + "pandas._libs.properties.AxisProperty.__get__", # workaround for mypy (cache_readonly = property) "pandas._libs.properties.cache_readonly.__get__", "pandas._libs.properties.cache_readonly.deleter", From 3813ee1c08029a856668fb271ac5ee1e9aed4314 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Thu, 13 Apr 2023 01:26:12 +0200 Subject: [PATCH 16/30] Remove workflow file --- .github/workflows/macos-windows.yml | 2 +- .github/workflows/sdist.yml | 4 +- .github/workflows/ubuntu.yml | 12 ++-- .github/workflows/wheels.yml | 2 +- .pre-commit-config.yaml | 2 +- ci/deps/actions-38.yaml | 60 ------------------- ....yaml => actions-39-minimum_versions.yaml} | 2 +- ...ions-pypy-38.yaml => actions-pypy-39.yaml} | 0 pyproject.toml | 3 +- 9 files changed, 12 insertions(+), 75 deletions(-) delete mode 100644 ci/deps/actions-38.yaml rename ci/deps/{actions-38-minimum_versions.yaml => actions-39-minimum_versions.yaml} (98%) rename ci/deps/{actions-pypy-38.yaml => actions-pypy-39.yaml} (100%) diff --git a/.github/workflows/macos-windows.yml b/.github/workflows/macos-windows.yml index 7ed5f5b90b959..cc38531a4e2a8 100644 --- a/.github/workflows/macos-windows.yml +++ b/.github/workflows/macos-windows.yml @@ -30,7 +30,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) }} diff --git a/.github/workflows/sdist.yml b/.github/workflows/sdist.yml index cd99a1e3e805c..ed325dc7195b7 100644 --- a/.github/workflows/sdist.yml +++ b/.github/workflows/sdist.yml @@ -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.community/t/concurrecy-not-work-for-push/183068/7 group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{matrix.python-version}}-sdist @@ -80,8 +80,6 @@ jobs: - name: Force oldest supported NumPy run: | case "${{matrix.python-version}}" in - 3.8) - pip install numpy==1.20.3 ;; 3.9) pip install numpy==1.20.3 ;; 3.10) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 2206ab631abad..e52555cd78987 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -25,7 +25,7 @@ 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: @@ -34,10 +34,10 @@ jobs: 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. @@ -47,7 +47,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. @@ -61,11 +61,11 @@ jobs: pattern: "not slow and not network and not single_cpu" pandas_copy_on_write: "1" - name: "Data Manager" - env_file: actions-38.yaml + env_file: actions-310.yaml pattern: "not slow and not network and not single_cpu" pandas_data_manager: "array" - 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" diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index eb30608afd0b7..29c2448bedcff 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -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"]]# "pp38", "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' }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index de36bf2d441c5..2063a3d97396e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -107,7 +107,7 @@ repos: rev: v3.3.1 hooks: - id: pyupgrade - args: [--py38-plus] + args: [--py39-plus] - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.10.0 hooks: diff --git a/ci/deps/actions-38.yaml b/ci/deps/actions-38.yaml deleted file mode 100644 index 86877c5f1c263..0000000000000 --- a/ci/deps/actions-38.yaml +++ /dev/null @@ -1,60 +0,0 @@ -name: pandas-dev -channels: - - conda-forge -dependencies: - - python=3.8 - - # build dependencies - - versioneer[toml] - - cython>=0.29.33 - - # test dependencies - - pytest>=7.0.0 - - pytest-cov - - pytest-xdist>=2.2.0 - - pytest-asyncio>=0.17.0 - - boto3 - - # required dependencies - - python-dateutil - - numpy - - pytz - - # optional dependencies - - beautifulsoup4>=4.11.1 - - blosc>=1.21.0 - - bottleneck>=1.3.4 - - brotlipy>=0.7.0 - - fastparquet>=0.8.1 - - fsspec>=2022.05.0 - - html5lib>=1.1 - - hypothesis>=6.46.1 - - gcsfs>=2022.05.0 - - jinja2>=3.1.2 - - lxml>=4.8.0 - - matplotlib>=3.6.1, <3.7.0 - - numba>=0.55.2 - - numexpr>=2.8.0 - - odfpy>=1.4.1 - - qtpy>=2.2.0 - - openpyxl<3.1.1, >=3.0.10 - - pandas-gbq>=0.17.5 - - psycopg2>=2.9.3 - - pyarrow>=7.0.0 - - pymysql>=1.0.2 - - pyreadstat>=1.1.5 - - pytables>=3.7.0 - - python-snappy>=0.6.1 - - pyxlsb>=1.0.9 - - s3fs>=2022.05.0 - - scipy>=1.8.1 - - sqlalchemy>=1.4.36 - - tabulate>=0.8.10 - - xarray>=2022.03.0 - - xlrd>=2.0.1 - - xlsxwriter>=3.0.3 - - zstandard>=0.17.0 - - - pip: - - pyqt5>=5.15.6 - - tzdata>=2022.1 diff --git a/ci/deps/actions-38-minimum_versions.yaml b/ci/deps/actions-39-minimum_versions.yaml similarity index 98% rename from ci/deps/actions-38-minimum_versions.yaml rename to ci/deps/actions-39-minimum_versions.yaml index c0b4870ebe9e6..9200a8c56e3bb 100644 --- a/ci/deps/actions-38-minimum_versions.yaml +++ b/ci/deps/actions-39-minimum_versions.yaml @@ -4,7 +4,7 @@ name: pandas-dev channels: - conda-forge dependencies: - - python=3.8.0 + - python=3.9.0 # build dependencies - versioneer[toml] diff --git a/ci/deps/actions-pypy-38.yaml b/ci/deps/actions-pypy-39.yaml similarity index 100% rename from ci/deps/actions-pypy-38.yaml rename to ci/deps/actions-pypy-39.yaml diff --git a/pyproject.toml b/pyproject.toml index 84fdb06a5ad5b..0c47dc3a7be1b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ authors = [ { name = 'The Pandas Development Team', email='pandas-dev@python.org' }, ] license = {file = 'LICENSE'} -requires-python = '>=3.8' +requires-python = '>=3.9' dependencies = [ "numpy>=1.20.3; python_version<'3.10'", "numpy>=1.21.0; python_version>='3.10'", @@ -40,7 +40,6 @@ classifiers = [ 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3 :: Only', - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', From 932c3d77f85ddc048cbe4ec4cf9d6399e9506da1 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Thu, 13 Apr 2023 11:05:37 +0200 Subject: [PATCH 17/30] Rename back --- .github/workflows/ubuntu.yml | 2 +- .pre-commit-config.yaml | 2 +- ci/deps/{actions-pypy-39.yaml => actions-pypy-38.yaml} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename ci/deps/{actions-pypy-39.yaml => actions-pypy-38.yaml} (100%) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index e52555cd78987..da8d46fb17bf0 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -65,7 +65,7 @@ jobs: pattern: "not slow and not network and not single_cpu" pandas_data_manager: "array" - name: "Pypy" - env_file: actions-pypy-39.yaml + env_file: actions-pypy-38.yaml pattern: "not slow and not network and not single_cpu" test_args: "--max-worker-restart 0" - name: "Numpy Dev" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2063a3d97396e..de36bf2d441c5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -107,7 +107,7 @@ repos: rev: v3.3.1 hooks: - id: pyupgrade - args: [--py39-plus] + args: [--py38-plus] - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.10.0 hooks: diff --git a/ci/deps/actions-pypy-39.yaml b/ci/deps/actions-pypy-38.yaml similarity index 100% rename from ci/deps/actions-pypy-39.yaml rename to ci/deps/actions-pypy-38.yaml From 824ccbfe242b828c7543e62852e2e4b4339e83ed Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Thu, 13 Apr 2023 23:20:02 +0200 Subject: [PATCH 18/30] Update --- ci/deps/actions-39-minimum_versions.yaml | 4 ++-- ci/deps/{actions-pypy-38.yaml => actions-pypy-39.yaml} | 2 +- environment.yml | 4 ++-- requirements-dev.txt | 4 ++-- scripts/validate_min_versions_in_sync.py | 5 +++++ 5 files changed, 12 insertions(+), 7 deletions(-) rename ci/deps/{actions-pypy-38.yaml => actions-pypy-39.yaml} (86%) diff --git a/ci/deps/actions-39-minimum_versions.yaml b/ci/deps/actions-39-minimum_versions.yaml index 9200a8c56e3bb..87f5ab240d135 100644 --- a/ci/deps/actions-39-minimum_versions.yaml +++ b/ci/deps/actions-39-minimum_versions.yaml @@ -1,6 +1,6 @@ # Minimum version of required + optional dependencies # Aligned with getting_started/install.rst and compat/_optional.py -name: pandas-dev +name: pandas-dev1 channels: - conda-forge dependencies: @@ -19,7 +19,7 @@ dependencies: # required dependencies - python-dateutil=2.8.2 - - numpy=1.20.3 + - numpy=1.21.6 - pytz=2020.1 # optional dependencies diff --git a/ci/deps/actions-pypy-38.yaml b/ci/deps/actions-pypy-39.yaml similarity index 86% rename from ci/deps/actions-pypy-38.yaml rename to ci/deps/actions-pypy-39.yaml index 981399dcd4b7c..1f035d5dbfc8b 100644 --- a/ci/deps/actions-pypy-38.yaml +++ b/ci/deps/actions-pypy-39.yaml @@ -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.0[build=*_pypy] # TODO: use this once pypy3.8 is available # build dependencies - versioneer[toml] diff --git a/environment.yml b/environment.yml index a44305983f738..1e30c51537fa0 100644 --- a/environment.yml +++ b/environment.yml @@ -35,10 +35,10 @@ dependencies: - ipython - jinja2>=3.1.2 - lxml>=4.8.0 - - matplotlib>=3.6.1, <3.7.0 + - 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 diff --git a/requirements-dev.txt b/requirements-dev.txt index 8a79f911265a3..d2f024886a129 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -24,10 +24,10 @@ gcsfs>=2022.05.0 ipython jinja2>=3.1.2 lxml>=4.8.0 -matplotlib>=3.6.1, <3.7.0 +matplotlib>=3.6.1 numba>=0.55.2 numexpr>=2.8.0 -openpyxl<3.1.1, >=3.0.7 +openpyxl>=3.0.10 odfpy>=1.4.1 py psycopg2-binary>=2.9.3 diff --git a/scripts/validate_min_versions_in_sync.py b/scripts/validate_min_versions_in_sync.py index e0182ebaaee60..9a6d97a222000 100755 --- a/scripts/validate_min_versions_in_sync.py +++ b/scripts/validate_min_versions_in_sync.py @@ -124,6 +124,11 @@ def get_yaml_map_from( yaml_package, yaml_version2 = yaml_dependency.split(operator) yaml_version2 = operator + yaml_version2 yaml_map[yaml_package] = [yaml_version1, yaml_version2] + elif "[build=*_pypy]" in dependency: + search_text = search_text.replace("[build=*_pypy]", "") + yaml_package, yaml_version = search_text.split(operator) + yaml_version = operator + yaml_version + yaml_map[yaml_package] = [yaml_version] elif operator is not None: yaml_package, yaml_version = search_text.split(operator) yaml_version = operator + yaml_version From 72daabe69a9c6e8b220d7799e2ec14ad6b4061fb Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Thu, 13 Apr 2023 23:21:33 +0200 Subject: [PATCH 19/30] Rename --- ci/deps/actions-39-minimum_versions.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/deps/actions-39-minimum_versions.yaml b/ci/deps/actions-39-minimum_versions.yaml index 87f5ab240d135..2e7f734b8f8be 100644 --- a/ci/deps/actions-39-minimum_versions.yaml +++ b/ci/deps/actions-39-minimum_versions.yaml @@ -1,6 +1,6 @@ # Minimum version of required + optional dependencies # Aligned with getting_started/install.rst and compat/_optional.py -name: pandas-dev1 +name: pandas-dev channels: - conda-forge dependencies: From 7d67a3f74e7b7a2650f8ba0afe0af5e54591949a Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Thu, 13 Apr 2023 23:22:27 +0200 Subject: [PATCH 20/30] Rename --- .github/workflows/ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 9d7c60f3e2326..438a86d4dee16 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -61,7 +61,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" From 6939d2ad9e6051aa6063b746f1cea8fbd4aa4a51 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Fri, 14 Apr 2023 11:35:44 +0200 Subject: [PATCH 21/30] Change python version --- ci/deps/actions-39-minimum_versions.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/deps/actions-39-minimum_versions.yaml b/ci/deps/actions-39-minimum_versions.yaml index 2e7f734b8f8be..61752cbfa54b2 100644 --- a/ci/deps/actions-39-minimum_versions.yaml +++ b/ci/deps/actions-39-minimum_versions.yaml @@ -4,7 +4,7 @@ name: pandas-dev channels: - conda-forge dependencies: - - python=3.9.0 + - python=3.9 # build dependencies - versioneer[toml] From af5ce5cdd318a91afef35f6ef81813503b5e7906 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Fri, 21 Apr 2023 18:05:10 +0200 Subject: [PATCH 22/30] Remove --- scripts/run_stubtest.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/run_stubtest.py b/scripts/run_stubtest.py index 23e044ab447e4..dedcdb5532593 100644 --- a/scripts/run_stubtest.py +++ b/scripts/run_stubtest.py @@ -51,8 +51,6 @@ "pandas._libs.lib.ndarray_obj_2d", # runtime argument "owner" has a default value but stub argument does not "pandas._libs.properties.AxisProperty.__get__", - # workaround for mypy (cache_readonly = property) - "pandas._libs.properties.cache_readonly.__get__", "pandas._libs.properties.cache_readonly.deleter", "pandas._libs.properties.cache_readonly.getter", "pandas._libs.properties.cache_readonly.setter", From e4911ee01b1a951498379444a141261dab921355 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Sat, 22 Apr 2023 20:41:37 +0200 Subject: [PATCH 23/30] Fix doc errors --- pandas/plotting/_core.py | 2 +- pandas/plotting/_misc.py | 27 ++++++++++----------------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index 9eba946dd4415..8dd3e4385a383 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -393,7 +393,7 @@ def hist_frame( >>> boxplot = df.boxplot(column=['Col1', 'Col2'], return_type='axes') >>> type(boxplot) - + When grouping with ``by``, a Series mapping columns to ``return_type`` is returned: diff --git a/pandas/plotting/_misc.py b/pandas/plotting/_misc.py index cbfdbc10ad71c..f8f9a584f0563 100644 --- a/pandas/plotting/_misc.py +++ b/pandas/plotting/_misc.py @@ -143,22 +143,15 @@ def scatter_matrix( >>> df = pd.DataFrame(np.random.randn(1000, 4), columns=['A','B','C','D']) >>> pd.plotting.scatter_matrix(df, alpha=0.2) - array([[, - , - , - ], - [, - , - , - ], - [, - , - , - ], - [, - , - , - ]], dtype=object) + array([[, , + , ], + [, , + , ], + [, , + , ], + [, , + , ]], + dtype=object) """ plot_backend = _get_plot_backend("matplotlib") return plot_backend.scatter_matrix( @@ -509,7 +502,7 @@ def lag_plot(series: Series, lag: int = 1, ax: Axes | None = None, **kwds) -> Ax :context: close-figs >>> pd.plotting.lag_plot(s, lag=1) - + """ plot_backend = _get_plot_backend("matplotlib") return plot_backend.lag_plot(series=series, lag=lag, ax=ax, **kwds) From a2d4a59554deb443dc9163da96915159421a9e49 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Sat, 22 Apr 2023 20:42:01 +0200 Subject: [PATCH 24/30] Remove pypy --- .github/workflows/ubuntu.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 31e5bd5526548..8c9d08c673071 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -60,10 +60,6 @@ jobs: env_file: actions-310.yaml pattern: "not slow and not network and not single_cpu" pandas_copy_on_write: "1" - - name: "Pypy" - 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" env_file: actions-310-numpydev.yaml pattern: "not slow and not network and not single_cpu" From ecead1792211fa7b08236195d835a98e47dc9dc5 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Sat, 22 Apr 2023 22:25:29 +0200 Subject: [PATCH 25/30] Update ci/deps/actions-pypy-39.yaml Co-authored-by: Thomas Li <47963215+lithomas1@users.noreply.github.com> --- ci/deps/actions-pypy-39.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/deps/actions-pypy-39.yaml b/ci/deps/actions-pypy-39.yaml index 1f035d5dbfc8b..64774e776056f 100644 --- a/ci/deps/actions-pypy-39.yaml +++ b/ci/deps/actions-pypy-39.yaml @@ -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.9.0[build=*_pypy] # TODO: use this once pypy3.8 is available + - python=3.9[build=*_pypy] # build dependencies - versioneer[toml] From e83832a7f2099a151d3ba7730e05dac651ddcc29 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Sat, 22 Apr 2023 22:26:06 +0200 Subject: [PATCH 26/30] Revert pypy removal --- .github/workflows/ubuntu.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 8c9d08c673071..31e5bd5526548 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -60,6 +60,10 @@ jobs: env_file: actions-310.yaml pattern: "not slow and not network and not single_cpu" pandas_copy_on_write: "1" + - name: "Pypy" + 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" env_file: actions-310-numpydev.yaml pattern: "not slow and not network and not single_cpu" From 9ad3cf4cc6626d1476fc54f82c5bd29cb8fb3ec2 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Sun, 23 Apr 2023 12:04:27 +0200 Subject: [PATCH 27/30] Remove again --- ci/deps/actions-38.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 ci/deps/actions-38.yaml diff --git a/ci/deps/actions-38.yaml b/ci/deps/actions-38.yaml deleted file mode 100644 index e69de29bb2d1d..0000000000000 From 9b2c7f74a97f58b6ef960d5e13cdae4d5fa6e21f Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Sun, 23 Apr 2023 21:35:25 +0200 Subject: [PATCH 28/30] Fix --- .github/workflows/macos-windows.yml | 0 .github/workflows/ubuntu.yml | 0 .github/workflows/unit-tests.yml | 14 +++++++------- 3 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 .github/workflows/macos-windows.yml delete mode 100644 .github/workflows/ubuntu.yml diff --git a/.github/workflows/macos-windows.yml b/.github/workflows/macos-windows.yml deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 31e2095624347..81d524022023b 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -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. @@ -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. @@ -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" @@ -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) }} From bb1b5b732aabf1c754934a4d98b3e4c1c95486cf Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Sun, 23 Apr 2023 22:21:20 +0200 Subject: [PATCH 29/30] Change to 3.9 --- .github/workflows/unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 81d524022023b..69baa3ccd6f34 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -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 From df5f01109ff8d0e70a2ca5da74796f3cf44bc317 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Tue, 25 Apr 2023 22:03:55 +0200 Subject: [PATCH 30/30] Address --- .github/workflows/wheels.yml | 2 +- doc/source/development/contributing_gitpod.rst | 2 +- doc/source/getting_started/install.rst | 2 +- doc/source/whatsnew/v2.1.0.rst | 5 +++++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 29c2448bedcff..8bab022b5904b 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -55,7 +55,7 @@ jobs: - [windows-2019, win_amd64] - [windows-2019, win32] # TODO: support PyPy? - python: [["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' }} diff --git a/doc/source/development/contributing_gitpod.rst b/doc/source/development/contributing_gitpod.rst index c591be5425db9..042a2f316cd42 100644 --- a/doc/source/development/contributing_gitpod.rst +++ b/doc/source/development/contributing_gitpod.rst @@ -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. diff --git a/doc/source/getting_started/install.rst b/doc/source/getting_started/install.rst index 49ec242f6bb96..1770d759dde4d 100644 --- a/doc/source/getting_started/install.rst +++ b/doc/source/getting_started/install.rst @@ -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 ----------------- diff --git a/doc/source/whatsnew/v2.1.0.rst b/doc/source/whatsnew/v2.1.0.rst index b0e9fa2cea0ee..fc6e4c696ccb1 100644 --- a/doc/source/whatsnew/v2.1.0.rst +++ b/doc/source/whatsnew/v2.1.0.rst @@ -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.