Skip to content

Commit

Permalink
Merge branch 'main' into upload-emscripten-wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal authored Jul 10, 2024
2 parents e25d62d + d966462 commit 13d2f0e
Show file tree
Hide file tree
Showing 341 changed files with 4,311 additions and 3,845 deletions.
4 changes: 1 addition & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,9 @@ workflows:
only: /^v.*/
matrix:
parameters:
cibw-build: ["cp39-manylinux_aarch64",
"cp310-manylinux_aarch64",
cibw-build: ["cp310-manylinux_aarch64",
"cp311-manylinux_aarch64",
"cp312-manylinux_aarch64",
"cp39-musllinux_aarch64",
"cp310-musllinux_aarch64",
"cp311-musllinux_aarch64",
"cp312-musllinux_aarch64",]
11 changes: 2 additions & 9 deletions .github/actions/build_pandas/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ inputs:
editable:
description: Whether to build pandas in editable mode (default true)
default: true
meson_args:
description: Extra flags to pass to meson
required: false
cflags_adds:
description: Items to append to the CFLAGS variable
required: false
runs:
using: composite
steps:
Expand All @@ -30,12 +24,11 @@ runs:

- name: Build Pandas
run: |
export CFLAGS="$CFLAGS ${{ inputs.cflags_adds }}"
if [[ ${{ inputs.editable }} == "true" ]]; then
pip install -e . --no-build-isolation -v --no-deps ${{ inputs.meson_args }} \
pip install -e . --no-build-isolation -v --no-deps \
--config-settings=setup-args="--werror"
else
pip install . --no-build-isolation -v --no-deps ${{ inputs.meson_args }} \
pip install . --no-build-isolation -v --no-deps \
--config-settings=setup-args="--werror"
fi
shell: bash -el {0}
4 changes: 2 additions & 2 deletions .github/actions/run-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ runs:
shell: bash -el {0}

- name: Publish test results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Test results
path: test-data.xml
if: failure()

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
flags: unittests
name: codecov-pandas
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 @@ -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']
fail-fast: false
name: Test Conda Forge Recipe - Python ${{ matrix.python-version }}
concurrency:
Expand Down
72 changes: 58 additions & 14 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 @@ -74,9 +74,9 @@ jobs:
PATTERN: ${{ matrix.pattern }}
LANG: ${{ matrix.lang || 'C.UTF-8' }}
LC_ALL: ${{ matrix.lc_all || '' }}
PANDAS_CI: ${{ matrix.pandas_ci || '1' }}
PANDAS_CI: '1'
TEST_ARGS: ${{ matrix.test_args || '' }}
PYTEST_WORKERS: ${{ matrix.pytest_workers || 'auto' }}
PYTEST_WORKERS: 'auto'
PYTEST_TARGET: ${{ matrix.pytest_target || 'pandas' }}
NPY_PROMOTION_STATE: ${{ matrix.env_file == 'actions-311-numpydev.yaml' && 'weak' || 'legacy' }}
# Clipboard tests
Expand All @@ -88,7 +88,7 @@ jobs:

services:
mysql:
image: mysql:8.0.33
image: mysql:8
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: pandas
Expand All @@ -101,7 +101,7 @@ jobs:
- 3306:3306

postgres:
image: postgres:13
image: postgres:16
env:
PGUSER: postgres
POSTGRES_USER: postgres
Expand All @@ -116,7 +116,7 @@ jobs:
- 5432:5432

moto:
image: motoserver/moto:4.1.13
image: motoserver/moto:5.0.0
env:
AWS_ACCESS_KEY_ID: foobar_key
AWS_SECRET_ACCESS_KEY: foobar_secret
Expand Down Expand Up @@ -146,9 +146,8 @@ jobs:
- name: Build Pandas
id: build
uses: ./.github/actions/build_pandas
with:
meson_args: ${{ matrix.meson_args }}
cflags_adds: ${{ matrix.cflags_adds }}
# TODO: Re-enable once Pypy has Pypy 3.10 on conda-forge
if: ${{ matrix.name != 'Pypy' }}

- name: Test (not single_cpu)
uses: ./.github/actions/run-tests
Expand All @@ -170,7 +169,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 Expand Up @@ -300,7 +299,7 @@ jobs:
# To freeze this file, uncomment out the ``if: false`` condition, and migrate the jobs
# to the corresponding posix/windows-macos/sdist etc. workflows.
# Feel free to modify this comment as necessary.
if: false # Uncomment this to freeze the workflow, comment it to unfreeze
# if: false # Uncomment this to freeze the workflow, comment it to unfreeze
defaults:
run:
shell: bash -eou pipefail {0}
Expand All @@ -315,7 +314,7 @@ jobs:

concurrency:
# https://github.community/t/concurrecy-not-work-for-push/183068/7
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.os }}-${{ matrix.pytest_target }}-dev
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.os }}-python-dev
cancel-in-progress: true

env:
Expand All @@ -332,7 +331,7 @@ jobs:
- name: Set up Python Dev Version
uses: actions/setup-python@v5
with:
python-version: '3.12-dev'
python-version: '3.13-dev'

- name: Build Environment
run: |
Expand All @@ -347,6 +346,51 @@ jobs:
- name: Run Tests
uses: ./.github/actions/run-tests

python-freethreading:
defaults:
run:
shell: bash -eou pipefail {0}
runs-on: ubuntu-22.04

timeout-minutes: 90

concurrency:
# https://github.community/t/concurrecy-not-work-for-push/183068/7
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.os }}-python-freethreading-dev
cancel-in-progress: true

env:
PYTEST_WORKERS: "auto"
PANDAS_CI: 1
PATTERN: "not slow and not network and not clipboard and not single_cpu"
PYTEST_TARGET: pandas

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python Free-threading Version
uses: deadsnakes/action@v3.1.0
with:
python-version: 3.13-dev
nogil: true

- name: Build Environment
run: |
python --version
python -m pip install --upgrade pip setuptools wheel meson[ninja]==1.2.1 meson-python==0.13.1
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy cython
python -m pip install versioneer[toml]
python -m pip install python-dateutil pytz tzdata hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-cov
python -m pip install -ve . --no-build-isolation --no-index --no-deps --config-settings=setup-args="--werror"
python -m pip list
- name: Run Tests
uses: ./.github/actions/run-tests
env:
PYTHON_GIL: 0

# NOTE: this job must be kept in sync with the Pyodide build job in wheels.yml
emscripten:
# Note: the Python version, Emscripten toolchain version are determined
Expand Down
4 changes: 2 additions & 2 deletions .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 Expand Up @@ -140,7 +140,7 @@ jobs:
run: echo "sdist_name=$(cd ./dist && ls -d */)" >> "$GITHUB_ENV"

- name: Build wheels
uses: pypa/cibuildwheel@v2.18.1
uses: pypa/cibuildwheel@v2.19.2
with:
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
env:
Expand Down
9 changes: 5 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ci:
skip: [pyright, mypy]
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.7
rev: v0.5.0
hooks:
- id: ruff
args: [--exit-non-zero-on-fix]
Expand Down Expand Up @@ -67,15 +67,16 @@ repos:
- id: fix-encoding-pragma
args: [--remove]
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
rev: v3.16.0
hooks:
- id: pyupgrade
args: [--py39-plus]
args: [--py310-plus]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
Expand All @@ -92,7 +93,7 @@ repos:
- id: sphinx-lint
args: ["--enable", "all", "--disable", "line-too-long"]
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.5
rev: v18.1.8
hooks:
- id: clang-format
files: ^pandas/_libs/src|^pandas/_libs/include
Expand Down
13 changes: 3 additions & 10 deletions asv_bench/benchmarks/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,24 +546,17 @@ def time_chained_indexing(self, mode):


class Block:
params = [
(True, "True"),
(np.array(True), "np.array(True)"),
]

def setup(self, true_value, mode):
def setup(self):
self.df = DataFrame(
False,
columns=np.arange(500).astype(str),
index=date_range("2010-01-01", "2011-01-01"),
)

self.true_value = true_value

def time_test(self, true_value, mode):
def time_test(self):
start = datetime(2010, 5, 1)
end = datetime(2010, 9, 1)
self.df.loc[start:end, :] = true_value
self.df.loc[start:end, :] = True


from .pandas_vb_common import setup # noqa: F401 isort:skip
2 changes: 1 addition & 1 deletion asv_bench/benchmarks/tslibs/timedelta.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def time_from_int(self):
Timedelta(123456789)

def time_from_unit(self):
Timedelta(1, unit="d")
Timedelta(1, unit="D")

def time_from_components(self):
Timedelta(
Expand Down
15 changes: 9 additions & 6 deletions asv_bench/benchmarks/tslibs/timestamp.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from datetime import datetime
from datetime import (
datetime,
timezone,
)
import zoneinfo

import numpy as np
import pytz

from pandas import Timestamp

Expand All @@ -12,7 +15,7 @@ class TimestampConstruction:
def setup(self):
self.npdatetime64 = np.datetime64("2020-01-01 00:00:00")
self.dttime_unaware = datetime(2020, 1, 1, 0, 0, 0)
self.dttime_aware = datetime(2020, 1, 1, 0, 0, 0, 0, pytz.UTC)
self.dttime_aware = datetime(2020, 1, 1, 0, 0, 0, 0, timezone.utc)
self.ts = Timestamp("2020-01-01 00:00:00")

def time_parse_iso8601_no_tz(self):
Expand Down Expand Up @@ -113,7 +116,7 @@ def setup(self, tz):
self.ts = Timestamp("2017-08-25 08:16:14", tz=tz)

def time_replace_tz(self, tz):
self.ts.replace(tzinfo=pytz.timezone("US/Eastern"))
self.ts.replace(tzinfo=zoneinfo.ZoneInfo("US/Eastern"))

def time_replace_None(self, tz):
self.ts.replace(tzinfo=None)
Expand Down Expand Up @@ -144,8 +147,8 @@ def time_ceil(self, tz):

class TimestampAcrossDst:
def setup(self):
dt = datetime(2016, 3, 27, 1)
self.tzinfo = pytz.timezone("CET").localize(dt, is_dst=False).tzinfo
dt = datetime(2016, 3, 27, 1, fold=0)
self.tzinfo = dt.astimezone(zoneinfo.ZoneInfo("Europe/Berlin")).tzinfo
self.ts2 = Timestamp(dt)

def time_replace_across_dst(self):
Expand Down
4 changes: 2 additions & 2 deletions asv_bench/benchmarks/tslibs/tslib.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
timedelta,
timezone,
)
import zoneinfo

from dateutil.tz import (
gettz,
tzlocal,
)
import numpy as np
import pytz

try:
from pandas._libs.tslibs import ints_to_pydatetime
Expand All @@ -38,7 +38,7 @@
None,
timezone.utc,
timezone(timedelta(minutes=60)),
pytz.timezone("US/Pacific"),
zoneinfo.ZoneInfo("US/Pacific"),
gettz("Asia/Tokyo"),
tzlocal_obj,
]
Expand Down
5 changes: 3 additions & 2 deletions asv_bench/benchmarks/tslibs/tz_convert.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from datetime import timezone

import numpy as np
from pytz import UTC

from pandas._libs.tslibs.tzconversion import tz_localize_to_utc

Expand Down Expand Up @@ -41,7 +42,7 @@ def time_tz_convert_from_utc(self, size, tz):
# dti = DatetimeIndex(self.i8data, tz=tz)
# dti.tz_localize(None)
if old_sig:
tz_convert_from_utc(self.i8data, UTC, tz)
tz_convert_from_utc(self.i8data, timezone.utc, tz)
else:
tz_convert_from_utc(self.i8data, tz)

Expand Down
Loading

0 comments on commit 13d2f0e

Please sign in to comment.