Skip to content

Commit e036ff8

Browse files
authored
Merge branch 'pandas-dev:main' into pandas-dev#46471
2 parents b365793 + 2517b92 commit e036ff8

File tree

513 files changed

+13076
-5427
lines changed

Some content is hidden

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

513 files changed

+13076
-5427
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
PANDAS_CI: "1"
1414
steps:
1515
- checkout
16-
- run: ci/setup_env.sh
16+
- run: .circleci/setup_env.sh
1717
- run: PATH=$HOME/miniconda3/envs/pandas-dev/bin:$HOME/miniconda3/condabin:$PATH ci/run_tests.sh
1818

1919
workflows:

ci/setup_env.sh renamed to .circleci/setup_env.sh

+2-14
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ echo
5151
echo "update conda"
5252
conda config --set ssl_verify false
5353
conda config --set quiet true --set always_yes true --set changeps1 false
54-
# TODO: GH#44980 https://github.com/pypa/setuptools/issues/2941
55-
conda install -y -c conda-forge -n base 'mamba>=0.21.2' pip
54+
conda install -y -c conda-forge -n base 'mamba>=0.21.2' pip setuptools
5655

5756
echo "conda info -a"
5857
conda info -a
@@ -67,21 +66,10 @@ echo "mamba env update --file=${ENV_FILE}"
6766
# See https://github.com/mamba-org/mamba/issues/633
6867
mamba create -q -n pandas-dev
6968
time mamba env update -n pandas-dev --file="${ENV_FILE}"
70-
# TODO: GH#44980 https://github.com/pypa/setuptools/issues/2941
71-
mamba install -n pandas-dev 'setuptools<60'
7269

7370
echo "conda list -n pandas-dev"
7471
conda list -n pandas-dev
7572

76-
# From pyarrow on MacOS
77-
# ImportError: 2): Library not loaded: @rpath/libssl.1.1.dylib
78-
# Referenced from: /Users/runner/miniconda3/envs/pandas-dev/lib/libthrift.0.13.0.dylib
79-
# Reason: image not found
80-
if [[ "$(uname)" == 'Darwin' ]]; then
81-
echo "Update pyarrow for pyarrow on MacOS"
82-
conda install -n pandas-dev -c conda-forge --no-update-deps pyarrow=6
83-
fi
84-
8573
if [[ "$BITS32" == "yes" ]]; then
8674
# activate 32-bit compiler
8775
export CONDA_BUILD=1
@@ -113,6 +101,6 @@ echo "Build extensions"
113101
python setup.py build_ext -q -j3
114102

115103
echo "Install pandas"
116-
python -m pip install --no-build-isolation -e .
104+
python -m pip install --no-build-isolation --no-use-pep517 -e .
117105

118106
echo "done"

.github/PULL_REQUEST_TEMPLATE.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
- [ ] closes #xxxx (Replace xxxx with the Github issue number)
22
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
33
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
4+
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
45
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

.github/actions/build_pandas/action.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ runs:
1212

1313
- name: Build Pandas
1414
run: |
15-
python setup.py build_ext -j 2
15+
python setup.py build_ext -j $N_JOBS
1616
python -m pip install -e . --no-build-isolation --no-use-pep517 --no-index
1717
shell: bash -el {0}
18+
env:
19+
# Cannot use parallel compilation on Windows, see https://github.com/pandas-dev/pandas/issues/30873
20+
# GH 47305: Parallel build causes flaky ImportError: /home/runner/work/pandas/pandas/pandas/_libs/tslibs/timestamps.cpython-38-x86_64-linux-gnu.so: undefined symbol: pandas_datetime_to_datetimestruct
21+
N_JOBS: 1
22+
#N_JOBS: ${{ runner.os == 'Windows' && 1 || 2 }}

.github/actions/run-tests/action.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Run tests and report results
2+
runs:
3+
using: composite
4+
steps:
5+
- name: Test
6+
run: ci/run_tests.sh
7+
shell: bash -el {0}
8+
9+
- name: Publish test results
10+
uses: actions/upload-artifact@v2
11+
with:
12+
name: Test results
13+
path: test-data.xml
14+
if: failure()
15+
16+
- name: Report Coverage
17+
run: coverage report -m
18+
shell: bash -el {0}
19+
if: failure()
20+
21+
- name: Upload coverage to Codecov
22+
uses: codecov/codecov-action@v2
23+
with:
24+
flags: unittests
25+
name: codecov-pandas
26+
fail_ci_if_error: false
27+
if: failure()
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Set up Conda environment
2+
inputs:
3+
environment-file:
4+
description: Conda environment file to use.
5+
default: environment.yml
6+
environment-name:
7+
description: Name to use for the Conda environment
8+
default: test
9+
python-version:
10+
description: Python version to install
11+
required: false
12+
pyarrow-version:
13+
description: If set, overrides the PyArrow version in the Conda environment to the given string.
14+
required: false
15+
runs:
16+
using: composite
17+
steps:
18+
- name: Set Arrow version in ${{ inputs.environment-file }} to ${{ inputs.pyarrow-version }}
19+
run: |
20+
grep -q ' - pyarrow' ${{ inputs.environment-file }}
21+
sed -i"" -e "s/ - pyarrow/ - pyarrow=${{ inputs.pyarrow-version }}/" ${{ inputs.environment-file }}
22+
cat ${{ inputs.environment-file }}
23+
shell: bash
24+
if: ${{ inputs.pyarrow-version }}
25+
26+
- name: Install ${{ inputs.environment-file }}
27+
uses: conda-incubator/[email protected]
28+
with:
29+
environment-file: ${{ inputs.environment-file }}
30+
activate-environment: ${{ inputs.environment-name }}
31+
python-version: ${{ inputs.python-version }}
32+
channel-priority: ${{ runner.os == 'macOS' && 'flexible' || 'strict' }}
33+
channels: conda-forge
34+
mamba-version: "0.24"
35+
use-mamba: true
36+
use-only-tar-bz2: true
37+
condarc-file: ci/condarc.yml

.github/actions/setup/action.yml

-12
This file was deleted.

.github/workflows/32-bit-linux.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: 32 Bit Linux
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 1.4.x
8+
pull_request:
9+
branches:
10+
- main
11+
- 1.4.x
12+
paths-ignore:
13+
- "doc/**"
14+
15+
jobs:
16+
pytest:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Run 32-bit manylinux2014 Docker Build / Tests
25+
run: |
26+
# Without this (line 34), versioneer will not be able to determine the pandas version.
27+
# This is because of a security update to git that blocks it from reading the config folder if
28+
# it is not owned by the current user. We hit this since the "mounted" folder is not hit by the
29+
# Docker container.
30+
# xref https://github.com/pypa/manylinux/issues/1309
31+
docker pull quay.io/pypa/manylinux2014_i686
32+
docker run --platform linux/386 -v $(pwd):/pandas quay.io/pypa/manylinux2014_i686 \
33+
/bin/bash -xc "cd pandas && \
34+
git config --global --add safe.directory /pandas && \
35+
/opt/python/cp38-cp38/bin/python -m venv ~/virtualenvs/pandas-dev && \
36+
. ~/virtualenvs/pandas-dev/bin/activate && \
37+
python -m pip install --no-deps -U pip wheel 'setuptools<60.0.0' && \
38+
pip install cython numpy python-dateutil pytz pytest pytest-xdist pytest-asyncio>=0.17 hypothesis && \
39+
python setup.py build_ext -q -j2 && \
40+
python -m pip install --no-build-isolation --no-use-pep517 -e . && \
41+
export PANDAS_CI=1 && \
42+
pytest -m 'not slow and not network and not clipboard and not single_cpu' pandas --junitxml=test-data.xml"
43+
44+
- name: Publish test results for Python 3.8-32 bit full Linux
45+
uses: actions/upload-artifact@v3
46+
with:
47+
name: Test results
48+
path: test-data.xml
49+
if: failure()

.github/workflows/asv-bot.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,8 @@ jobs:
4141

4242
# Although asv sets up its own env, deps are still needed
4343
# during discovery process
44-
- uses: conda-incubator/[email protected]
45-
with:
46-
activate-environment: pandas-dev
47-
channel-priority: strict
48-
environment-file: ${{ env.ENV_FILE }}
49-
use-only-tar-bz2: true
44+
- name: Set up Conda
45+
uses: ./.github/actions/setup-conda
5046

5147
- name: Run benchmarks
5248
id: bench

.github/workflows/code-checks.yml

+14-27
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,8 @@ jobs:
5858
path: ~/conda_pkgs_dir
5959
key: ${{ runner.os }}-conda-${{ hashFiles('${{ env.ENV_FILE }}') }}
6060

61-
- uses: conda-incubator/[email protected]
62-
with:
63-
mamba-version: "*"
64-
channels: conda-forge
65-
activate-environment: pandas-dev
66-
channel-priority: strict
67-
environment-file: ${{ env.ENV_FILE }}
68-
use-only-tar-bz2: true
69-
70-
- name: Install node.js (for pyright)
71-
uses: actions/setup-node@v3
72-
with:
73-
node-version: "16"
74-
75-
- name: Install pyright
76-
# note: keep version in sync with .pre-commit-config.yaml
77-
run: npm install -g [email protected]
61+
- name: Set up Conda
62+
uses: ./.github/actions/setup-conda
7863

7964
- name: Build Pandas
8065
id: build
@@ -96,8 +81,16 @@ jobs:
9681
run: ci/code_checks.sh docstrings
9782
if: ${{ steps.build.outcome == 'success' }}
9883

99-
- name: Run typing validation
100-
run: ci/code_checks.sh typing
84+
- name: Use existing environment for type checking
85+
run: |
86+
echo $PATH >> $GITHUB_PATH
87+
echo "PYTHONHOME=$PYTHONHOME" >> $GITHUB_ENV
88+
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
89+
90+
- name: Typing
91+
uses: pre-commit/[email protected]
92+
with:
93+
extra_args: --hook-stage manual --all-files
10194
if: ${{ steps.build.outcome == 'success' }}
10295

10396
- name: Run docstring validation script tests
@@ -128,14 +121,8 @@ jobs:
128121
path: ~/conda_pkgs_dir
129122
key: ${{ runner.os }}-conda-${{ hashFiles('${{ env.ENV_FILE }}') }}
130123

131-
- uses: conda-incubator/[email protected]
132-
with:
133-
mamba-version: "*"
134-
channels: conda-forge
135-
activate-environment: pandas-dev
136-
channel-priority: strict
137-
environment-file: ${{ env.ENV_FILE }}
138-
use-only-tar-bz2: true
124+
- name: Set up Conda
125+
uses: ./.github/actions/setup-conda
139126

140127
- name: Build Pandas
141128
id: build

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

+14-11
Original file line numberDiff line numberDiff line change
@@ -24,43 +24,46 @@ jobs:
2424
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-web-docs
2525
cancel-in-progress: true
2626

27+
defaults:
28+
run:
29+
shell: bash -el {0}
30+
2731
steps:
2832
- name: Checkout
2933
uses: actions/checkout@v3
3034
with:
3135
fetch-depth: 0
3236

33-
- name: Set up pandas
34-
uses: ./.github/actions/setup
37+
- name: Set up Conda
38+
uses: ./.github/actions/setup-conda
39+
40+
- name: Build Pandas
41+
uses: ./.github/actions/build_pandas
3542

3643
- name: Build website
37-
run: |
38-
source activate pandas-dev
39-
python web/pandas_web.py web/pandas --target-path=web/build
44+
run: python web/pandas_web.py web/pandas --target-path=web/build
4045

4146
- name: Build documentation
42-
run: |
43-
source activate pandas-dev
44-
doc/make.py --warnings-are-errors
47+
run: doc/make.py --warnings-are-errors
4548

4649
- name: Install ssh key
4750
run: |
4851
mkdir -m 700 -p ~/.ssh
4952
echo "${{ secrets.server_ssh_key }}" > ~/.ssh/id_rsa
5053
chmod 600 ~/.ssh/id_rsa
5154
echo "${{ secrets.server_ip }} ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBE1Kkopomm7FHG5enATf7SgnpICZ4W2bw+Ho+afqin+w7sMcrsa0je7sbztFAV8YchDkiBKnWTG4cRT+KZgZCaY=" > ~/.ssh/known_hosts
52-
if: ${{github.event_name == 'push' && github.ref == 'refs/heads/main'}}
55+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
5356

5457
- name: Copy cheatsheets into site directory
5558
run: cp doc/cheatsheet/Pandas_Cheat_Sheet* web/build/
5659

5760
- name: Upload web
5861
run: rsync -az --delete --exclude='pandas-docs' --exclude='docs' web/build/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas
59-
if: ${{github.event_name == 'push' && github.ref == 'refs/heads/main'}}
62+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
6063

6164
- name: Upload dev docs
6265
run: rsync -az --delete doc/build/html/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas/pandas-docs/dev
63-
if: ${{github.event_name == 'push' && github.ref == 'refs/heads/main'}}
66+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
6467

6568
- name: Move docs into site directory
6669
run: mv doc/build/html web/build/docs

.github/workflows/macos-windows.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Windows-MacOS
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 1.4.x
8+
pull_request:
9+
branches:
10+
- main
11+
- 1.4.x
12+
paths-ignore:
13+
- "doc/**"
14+
15+
env:
16+
PANDAS_CI: 1
17+
PYTEST_TARGET: pandas
18+
PYTEST_WORKERS: auto
19+
PATTERN: "not slow and not db and not network and not single_cpu"
20+
21+
22+
jobs:
23+
pytest:
24+
defaults:
25+
run:
26+
shell: bash -el {0}
27+
timeout-minutes: 90
28+
strategy:
29+
matrix:
30+
os: [macos-latest, windows-latest]
31+
env_file: [actions-38.yaml, actions-39.yaml, actions-310.yaml]
32+
fail-fast: false
33+
runs-on: ${{ matrix.os }}
34+
name: ${{ format('{0} {1}', matrix.os, matrix.env_file) }}
35+
concurrency:
36+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
37+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.env_file }}-${{ matrix.os }}
38+
cancel-in-progress: true
39+
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v3
43+
with:
44+
fetch-depth: 0
45+
46+
- name: Set up Conda
47+
uses: ./.github/actions/setup-conda
48+
with:
49+
environment-file: ci/deps/${{ matrix.env_file }}
50+
pyarrow-version: ${{ matrix.os == 'macos-latest' && '6' || '' }}
51+
52+
- name: Build Pandas
53+
uses: ./.github/actions/build_pandas
54+
55+
- name: Test
56+
uses: ./.github/actions/run-tests

0 commit comments

Comments
 (0)