Skip to content

Commit 130d85b

Browse files
authored
Merge branch 'main' into pdep-17
2 parents 7c5be2a + 0cdc6a4 commit 130d85b

File tree

469 files changed

+5930
-3460
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

469 files changed

+5930
-3460
lines changed

.circleci/config.yml

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@ jobs:
1515
- checkout
1616
- run:
1717
name: Install Environment and Run Tests
18-
shell: /bin/bash -exuo pipefail
18+
shell: /bin/bash -exo pipefail
19+
# https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions-azure-pipelines-travis-ci-and-gitlab-ci-cd
1920
command: |
20-
MAMBA_URL="https://github.com/conda-forge/miniforge/releases/download/24.3.0-0/Mambaforge-24.3.0-0-Linux-aarch64.sh"
21-
wget -q $MAMBA_URL -O minimamba.sh
22-
chmod +x minimamba.sh
23-
MAMBA_DIR="$HOME/miniconda3"
24-
rm -rf $MAMBA_DIR
25-
./minimamba.sh -b -p $MAMBA_DIR
26-
export PATH=$MAMBA_DIR/bin:$PATH
21+
MINI_URL="https://github.com/conda-forge/miniforge/releases/download/24.3.0-0/Miniforge3-24.3.0-0-Linux-aarch64.sh"
22+
wget -q $MINI_URL -O Miniforge3.sh
23+
chmod +x Miniforge3.sh
24+
MINI_DIR="$HOME/miniconda3"
25+
rm -rf $MINI_DIR
26+
./Miniforge3.sh -b -p $MINI_DIR
27+
export PATH=$MINI_DIR/bin:$PATH
2728
conda info -a
2829
conda env create -q -n pandas-dev -f $ENV_FILE
2930
conda list -n pandas-dev
@@ -33,6 +34,7 @@ jobs:
3334
fi
3435
python -m pip install --no-build-isolation -ve . --config-settings=setup-args="--werror"
3536
PATH=$HOME/miniconda3/envs/pandas-dev/bin:$HOME/miniconda3/condabin:$PATH
37+
sudo apt-get update && sudo apt-get install -y libegl1 libopengl0
3638
ci/run_tests.sh
3739
test-linux-musl:
3840
docker:
@@ -54,7 +56,7 @@ jobs:
5456
/opt/python/cp311-cp311/bin/python -m venv ~/virtualenvs/pandas-dev
5557
. ~/virtualenvs/pandas-dev/bin/activate
5658
python -m pip install --no-cache-dir -U pip wheel setuptools meson-python==0.13.1 meson[ninja]==1.2.1
57-
python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytz pytest>=7.3.2 pytest-xdist>=2.2.0 hypothesis>=6.46.1
59+
python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytz pytest>=7.3.2 pytest-xdist>=3.4.0 hypothesis>=6.84.0
5860
python -m pip install --no-cache-dir --no-build-isolation -e . --config-settings=setup-args="--werror"
5961
python -m pip list --no-cache-dir
6062
export PANDAS_CI=1
@@ -89,29 +91,24 @@ jobs:
8991
name: Build aarch64 wheels
9092
no_output_timeout: 30m # Sometimes the tests won't generate any output, make sure the job doesn't get killed by that
9193
command: |
92-
pip3 install cibuildwheel==2.18.1
93-
cibuildwheel --prerelease-pythons --output-dir wheelhouse
94+
pip3 install cibuildwheel==2.20.0
95+
cibuildwheel --output-dir wheelhouse
9496
9597
environment:
9698
CIBW_BUILD: << parameters.cibw-build >>
9799

98100
- run:
99101
name: Install Anaconda Client & Upload Wheels
102+
shell: /bin/bash -exo pipefail
100103
command: |
101-
echo "Install Mambaforge"
102-
MAMBA_URL="https://github.com/conda-forge/miniforge/releases/download/24.3.0-0/Mambaforge-24.3.0-0-Linux-aarch64.sh"
103-
echo "Downloading $MAMBA_URL"
104-
wget -q $MAMBA_URL -O minimamba.sh
105-
chmod +x minimamba.sh
106-
107-
MAMBA_DIR="$HOME/miniconda3"
108-
rm -rf $MAMBA_DIR
109-
./minimamba.sh -b -p $MAMBA_DIR
110-
111-
export PATH=$MAMBA_DIR/bin:$PATH
112-
113-
mamba install -y -c conda-forge anaconda-client
114-
104+
MINI_URL="https://github.com/conda-forge/miniforge/releases/download/24.3.0-0/Miniforge3-24.3.0-0-Linux-aarch64.sh"
105+
wget -q $MINI_URL -O Miniforge3.sh
106+
chmod +x Miniforge3.sh
107+
MINI_DIR="$HOME/miniconda3"
108+
rm -rf $MINI_DIR
109+
./Miniforge3.sh -b -p $MINI_DIR
110+
export PATH=$MINI_DIR/bin:$PATH
111+
conda install -y -c conda-forge anaconda-client
115112
source ci/upload_wheels.sh
116113
set_upload_vars
117114
upload_wheels

.gitattributes

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ ci export-ignore
6868
doc export-ignore
6969
gitpod export-ignore
7070
MANIFEST.in export-ignore
71-
scripts export-ignore
71+
scripts/** export-ignore
7272
typings export-ignore
7373
web export-ignore
7474
CITATION.cff export-ignore
@@ -82,3 +82,7 @@ setup.py export-ignore
8282
# csv_dir_path fixture checks the existence of the directory
8383
# exclude the whole directory to avoid running related tests in sdist
8484
pandas/tests/io/parser/data export-ignore
85+
86+
# Include cibw script in sdist since it's needed for building wheels
87+
scripts/cibw_before_build.sh -export-ignore
88+
scripts/cibw_before_test.sh -export-ignore

.github/workflows/code-checks.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ jobs:
5151
# TODO: The doctests have to be run first right now, since the Cython doctests only work
5252
# with pandas installed in non-editable mode
5353
# This can be removed once pytest-cython doesn't require C extensions to be installed inplace
54+
55+
- name: Extra installs
56+
# https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions-azure-pipelines-travis-ci-and-gitlab-ci-cd
57+
run: sudo apt-get update && sudo apt-get install -y libegl1 libopengl0
58+
5459
- name: Run doctests
5560
run: cd ci && ./code_checks.sh doctests
5661
if: ${{ steps.build.outcome == 'success' && always() }}

.github/workflows/docbuild-and-upload.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ jobs:
4646
- name: Build Pandas
4747
uses: ./.github/actions/build_pandas
4848

49+
- name: Extra installs
50+
# https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions-azure-pipelines-travis-ci-and-gitlab-ci-cd
51+
run: sudo apt-get update && sudo apt-get install -y libegl1 libopengl0
52+
4953
- name: Test website
5054
run: python -m pytest web/
5155

.github/workflows/unit-tests.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ jobs:
5757
# Also install zh_CN (its encoding is gb2312) but do not activate it.
5858
# It will be temporarily activated during tests with locale.setlocale
5959
extra_loc: "zh_CN"
60+
- name: "Future infer strings"
61+
env_file: actions-311.yaml
62+
pandas_future_infer_string: "1"
6063
- name: "Pypy"
6164
env_file: actions-pypy-39.yaml
6265
pattern: "not slow and not network and not single_cpu"
@@ -75,6 +78,7 @@ jobs:
7578
LANG: ${{ matrix.lang || 'C.UTF-8' }}
7679
LC_ALL: ${{ matrix.lc_all || '' }}
7780
PANDAS_CI: '1'
81+
PANDAS_FUTURE_INFER_STRING: ${{ matrix.pandas_future_infer_string || '0' }}
7882
TEST_ARGS: ${{ matrix.test_args || '' }}
7983
PYTEST_WORKERS: 'auto'
8084
PYTEST_TARGET: ${{ matrix.pytest_target || 'pandas' }}
@@ -130,8 +134,8 @@ jobs:
130134
fetch-depth: 0
131135

132136
- name: Extra installs
133-
run: sudo apt-get update && sudo apt-get install -y ${{ matrix.extra_apt }}
134-
if: ${{ matrix.extra_apt }}
137+
# https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#github-actions-azure-pipelines-travis-ci-and-gitlab-ci-cd
138+
run: sudo apt-get update && sudo apt-get install -y libegl1 libopengl0 ${{ matrix.extra_apt || ''}}
135139

136140
- name: Generate extra locales
137141
# These extra locales will be available for locale.setlocale() calls in tests
@@ -227,7 +231,7 @@ jobs:
227231
. ~/virtualenvs/pandas-dev/bin/activate
228232
python -m pip install --no-cache-dir -U pip wheel setuptools meson[ninja]==1.2.1 meson-python==0.13.1
229233
python -m pip install numpy --config-settings=setup-args="-Dallow-noblas=true"
230-
python -m pip install --no-cache-dir versioneer[toml] cython python-dateutil pytz pytest>=7.3.2 pytest-xdist>=2.2.0 hypothesis>=6.46.1
234+
python -m pip install --no-cache-dir versioneer[toml] cython python-dateutil pytz pytest>=7.3.2 pytest-xdist>=3.4.0 hypothesis>=6.84.0
231235
python -m pip install --no-cache-dir --no-build-isolation -e . --config-settings=setup-args="--werror"
232236
python -m pip list --no-cache-dir
233237
export PANDAS_CI=1
@@ -265,7 +269,7 @@ jobs:
265269
/opt/python/cp311-cp311/bin/python -m venv ~/virtualenvs/pandas-dev
266270
. ~/virtualenvs/pandas-dev/bin/activate
267271
python -m pip install --no-cache-dir -U pip wheel setuptools meson-python==0.13.1 meson[ninja]==1.2.1
268-
python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytz pytest>=7.3.2 pytest-xdist>=2.2.0 hypothesis>=6.46.1
272+
python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytz pytest>=7.3.2 pytest-xdist>=3.4.0 hypothesis>=6.84.0
269273
python -m pip install --no-cache-dir --no-build-isolation -e . --config-settings=setup-args="--werror"
270274
python -m pip list --no-cache-dir
271275
@@ -339,7 +343,7 @@ jobs:
339343
python -m pip install --upgrade pip setuptools wheel meson[ninja]==1.2.1 meson-python==0.13.1
340344
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
341345
python -m pip install versioneer[toml]
342-
python -m pip install python-dateutil pytz tzdata cython hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-cov
346+
python -m pip install python-dateutil pytz tzdata cython hypothesis>=6.84.0 pytest>=7.3.2 pytest-xdist>=3.4.0 pytest-cov
343347
python -m pip install -ve . --no-build-isolation --no-index --no-deps --config-settings=setup-args="--werror"
344348
python -m pip list
345349
@@ -382,15 +386,14 @@ jobs:
382386
python -m pip install --upgrade pip setuptools wheel meson[ninja]==1.2.1 meson-python==0.13.1
383387
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy cython
384388
python -m pip install versioneer[toml]
385-
python -m pip install python-dateutil pytz tzdata hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-cov
389+
python -m pip install python-dateutil pytz tzdata hypothesis>=6.84.0 pytest>=7.3.2 pytest-xdist>=3.4.0 pytest-cov
386390
python -m pip install -ve . --no-build-isolation --no-index --no-deps --config-settings=setup-args="--werror"
387391
python -m pip list
388392
389393
- name: Run Tests
390394
uses: ./.github/actions/run-tests
391-
env:
392-
PYTHON_GIL: 0
393395

396+
# NOTE: this job must be kept in sync with the Pyodide build job in wheels.yml
394397
emscripten:
395398
# Note: the Python version, Emscripten toolchain version are determined
396399
# by the Pyodide version. The appropriate versions can be found in the

.github/workflows/wheels.yml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,25 @@ jobs:
9999
- [macos-14, macosx_arm64]
100100
- [windows-2022, win_amd64]
101101
# TODO: support PyPy?
102-
python: [["cp310", "3.10"], ["cp311", "3.11"], ["cp312", "3.12"]]
102+
python: [["cp310", "3.10"], ["cp311", "3.11"], ["cp312", "3.12"], ["cp313", "3.13"], ["cp313t", "3.13"]]
103+
include:
104+
# TODO: Remove this plus installing build deps in cibw_before_build.sh
105+
# and test deps in cibw_before_test.sh after pandas can be built with a released NumPy/Cython
106+
- python: ["cp313", "3.13"]
107+
cibw_build_frontend: 'pip; args: --no-build-isolation'
108+
- python: ["cp313t", "3.13"]
109+
cibw_build_frontend: 'pip; args: --no-build-isolation'
110+
# Build Pyodide wheels and upload them to Anaconda.org
111+
# NOTE: this job is similar to the one in unit-tests.yml except for the fact
112+
# that it uses cibuildwheel instead of a standard Pyodide xbuildenv setup.
113+
- buildplat: [ubuntu-22.04, pyodide_wasm32]
114+
python: ["cp312", "3.12"]
115+
cibw_build_frontend: 'build'
116+
# TODO: Build free-threaded wheels for Windows
117+
exclude:
118+
- buildplat: [windows-2022, win_amd64]
119+
python: ["cp313t", "3.13"]
120+
103121
env:
104122
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
105123
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
@@ -140,12 +158,13 @@ jobs:
140158
run: echo "sdist_name=$(cd ./dist && ls -d */)" >> "$GITHUB_ENV"
141159

142160
- name: Build wheels
143-
uses: pypa/cibuildwheel@v2.19.1
161+
uses: pypa/cibuildwheel@v2.20.0
144162
with:
145163
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
146164
env:
147-
CIBW_PRERELEASE_PYTHONS: True
148165
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
166+
CIBW_BUILD_FRONTEND: ${{ matrix.cibw_build_frontend || 'pip' }}
167+
CIBW_PLATFORM: ${{ matrix.buildplat[1] == 'pyodide_wasm32' && 'pyodide' || 'auto' }}
149168

150169
- name: Set up Python
151170
uses: mamba-org/setup-micromamba@v1
@@ -168,15 +187,17 @@ jobs:
168187
- name: Test Windows Wheels
169188
if: ${{ matrix.buildplat[1] == 'win_amd64' }}
170189
shell: pwsh
190+
# TODO: Remove NumPy nightly install when there's a 3.13 wheel on PyPI
171191
run: |
172192
$TST_CMD = @"
173-
python -m pip install hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0;
193+
python -m pip install hypothesis>=6.84.0 pytest>=7.3.2 pytest-xdist>=3.4.0;
194+
${{ matrix.python[1] == '3.13' && 'python -m pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy;' }}
174195
python -m pip install `$(Get-Item pandas\wheelhouse\*.whl);
175196
python -c `'import pandas as pd; pd.test(extra_args=[`\"--no-strict-data-files`\", `\"-m not clipboard and not single_cpu and not slow and not network and not db`\"])`';
176197
"@
177198
# add rc to the end of the image name if the Python version is unreleased
178-
docker pull python:${{ matrix.python[1] == '3.12' && '3.12-rc' || format('{0}-windowsservercore', matrix.python[1]) }}
179-
docker run --env PANDAS_CI='1' -v ${PWD}:C:\pandas python:${{ matrix.python[1] == '3.12' && '3.12-rc' || format('{0}-windowsservercore', matrix.python[1]) }} powershell -Command $TST_CMD
199+
docker pull python:${{ matrix.python[1] == '3.13' && '3.13-rc' || format('{0}-windowsservercore', matrix.python[1]) }}
200+
docker run --env PANDAS_CI='1' -v ${PWD}:C:\pandas python:${{ matrix.python[1] == '3.13' && '3.13-rc' || format('{0}-windowsservercore', matrix.python[1]) }} powershell -Command $TST_CMD
180201
181202
- uses: actions/upload-artifact@v4
182203
with:

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ci:
1919
skip: [pyright, mypy]
2020
repos:
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.4.7
22+
rev: v0.5.0
2323
hooks:
2424
- id: ruff
2525
args: [--exit-non-zero-on-fix]
@@ -73,7 +73,7 @@ repos:
7373
hooks:
7474
- id: isort
7575
- repo: https://github.com/asottile/pyupgrade
76-
rev: v3.15.2
76+
rev: v3.16.0
7777
hooks:
7878
- id: pyupgrade
7979
args: [--py310-plus]
@@ -93,7 +93,7 @@ repos:
9393
- id: sphinx-lint
9494
args: ["--enable", "all", "--disable", "line-too-long"]
9595
- repo: https://github.com/pre-commit/mirrors-clang-format
96-
rev: v18.1.5
96+
rev: v18.1.8
9797
hooks:
9898
- id: clang-format
9999
files: ^pandas/_libs/src|^pandas/_libs/include

MANIFEST.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,7 @@ prune pandas/tests/io/parser/data
6262
# Selectively re-add *.cxx files that were excluded above
6363
graft pandas/_libs/src
6464
graft pandas/_libs/include
65+
66+
# Include cibw script in sdist since it's needed for building wheels
67+
include scripts/cibw_before_build.sh
68+
include scripts/cibw_before_test.sh

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ The source code is currently hosted on GitHub at:
9696
https://github.com/pandas-dev/pandas
9797

9898
Binary installers for the latest released version are available at the [Python
99-
Package Index (PyPI)](https://pypi.org/project/pandas) and on [Conda](https://docs.conda.io/en/latest/).
99+
Package Index (PyPI)](https://pypi.org/project/pandas) and on [Conda](https://anaconda.org/conda-forge/pandas).
100100

101101
```sh
102102
# conda

asv_bench/benchmarks/indexing.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -546,24 +546,17 @@ def time_chained_indexing(self, mode):
546546

547547

548548
class Block:
549-
params = [
550-
(True, "True"),
551-
(np.array(True), "np.array(True)"),
552-
]
553-
554-
def setup(self, true_value, mode):
549+
def setup(self):
555550
self.df = DataFrame(
556551
False,
557552
columns=np.arange(500).astype(str),
558553
index=date_range("2010-01-01", "2011-01-01"),
559554
)
560555

561-
self.true_value = true_value
562-
563-
def time_test(self, true_value, mode):
556+
def time_test(self):
564557
start = datetime(2010, 5, 1)
565558
end = datetime(2010, 9, 1)
566-
self.df.loc[start:end, :] = true_value
559+
self.df.loc[start:end, :] = True
567560

568561

569562
from .pandas_vb_common import setup # noqa: F401 isort:skip

0 commit comments

Comments
 (0)