Skip to content

Commit 9e09243

Browse files
authored
Merge branch 'main' into c-shared-library
2 parents 9128cd5 + 18124f9 commit 9e09243

File tree

442 files changed

+10460
-4389
lines changed

Some content is hidden

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

442 files changed

+10460
-4389
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 4 deletions
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,8 +66,6 @@ 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

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ runs:
1616
python -m pip install -e . --no-build-isolation --no-use-pep517 --no-index
1717
shell: bash -el {0}
1818
env:
19-
N_JOBS: 4
19+
N_JOBS: 4

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

Lines changed: 27 additions & 0 deletions
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()
Lines changed: 37 additions & 0 deletions
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

Lines changed: 0 additions & 12 deletions
This file was deleted.

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,15 @@ jobs:
2323

2424
- name: Run 32-bit manylinux2014 Docker Build / Tests
2525
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
2631
docker pull quay.io/pypa/manylinux2014_i686
2732
docker run --platform linux/386 -v $(pwd):/pandas quay.io/pypa/manylinux2014_i686 \
2833
/bin/bash -xc "cd pandas && \
34+
git config --global --add safe.directory /pandas && \
2935
/opt/python/cp38-cp38/bin/python -m venv ~/virtualenvs/pandas-dev && \
3036
. ~/virtualenvs/pandas-dev/bin/activate && \
3137
python -m pip install --no-deps -U pip wheel 'setuptools<60.0.0' && \

.github/workflows/asv-bot.yml

Lines changed: 2 additions & 6 deletions
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

Lines changed: 14 additions & 27 deletions
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

Lines changed: 14 additions & 11 deletions
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

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -43,42 +43,14 @@ jobs:
4343
with:
4444
fetch-depth: 0
4545

46-
- name: Install Dependencies
47-
uses: conda-incubator/setup-[email protected]
46+
- name: Set up Conda
47+
uses: ./.github/actions/setup-conda
4848
with:
49-
mamba-version: "*"
50-
channels: conda-forge
51-
activate-environment: pandas-dev
52-
channel-priority: ${{ matrix.os == 'macos-latest' && 'flexible' || 'strict' }}
5349
environment-file: ci/deps/${{ matrix.env_file }}
54-
use-only-tar-bz2: true
55-
56-
# ImportError: 2): Library not loaded: @rpath/libssl.1.1.dylib
57-
# Referenced from: /Users/runner/miniconda3/envs/pandas-dev/lib/libthrift.0.13.0.dylib
58-
# Reason: image not found
59-
- name: Upgrade pyarrow on MacOS
60-
run: conda install -n pandas-dev -c conda-forge --no-update-deps pyarrow=6
61-
if: ${{ matrix.os == 'macos-latest' }}
50+
pyarrow-version: ${{ matrix.os == 'macos-latest' && '6' || '' }}
6251

6352
- name: Build Pandas
6453
uses: ./.github/actions/build_pandas
6554

6655
- name: Test
67-
run: ci/run_tests.sh
68-
69-
- name: Build Version
70-
run: conda list
71-
72-
- name: Publish test results
73-
uses: actions/upload-artifact@v3
74-
with:
75-
name: Test results
76-
path: test-data.xml
77-
if: failure()
78-
79-
- name: Upload coverage to Codecov
80-
uses: codecov/codecov-action@v2
81-
with:
82-
flags: unittests
83-
name: codecov-pandas
84-
fail_ci_if_error: false
56+
uses: ./.github/actions/run-tests

.github/workflows/posix.yml

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -147,40 +147,16 @@ jobs:
147147
# xsel for clipboard tests
148148
run: sudo apt-get update && sudo apt-get install -y libc6-dev-i386 xsel ${{ env.EXTRA_APT }}
149149

150-
- uses: conda-incubator/[email protected]
150+
- name: Set up Conda
151+
uses: ./.github/actions/setup-conda
151152
with:
152-
mamba-version: "*"
153-
channels: conda-forge
154-
activate-environment: pandas-dev
155-
channel-priority: flexible
156153
environment-file: ${{ env.ENV_FILE }}
157-
use-only-tar-bz2: true
158-
159-
- name: Upgrade Arrow version
160-
run: conda install -n pandas-dev -c conda-forge --no-update-deps pyarrow=${{ matrix.pyarrow_version }}
161-
if: ${{ matrix.pyarrow_version }}
154+
pyarrow-version: ${{ matrix.pyarrow_version }}
162155

163156
- name: Build Pandas
164157
uses: ./.github/actions/build_pandas
165158

166159
- name: Test
167-
run: ci/run_tests.sh
160+
uses: ./.github/actions/run-tests
168161
# TODO: Don't continue on error for PyPy
169162
continue-on-error: ${{ env.IS_PYPY == 'true' }}
170-
171-
- name: Build Version
172-
run: conda list
173-
174-
- name: Publish test results
175-
uses: actions/upload-artifact@v3
176-
with:
177-
name: Test results
178-
path: test-data.xml
179-
if: failure()
180-
181-
- name: Upload coverage to Codecov
182-
uses: codecov/codecov-action@v2
183-
with:
184-
flags: unittests
185-
name: codecov-pandas
186-
fail_ci_if_error: false

0 commit comments

Comments
 (0)