Skip to content

Commit 2b59e2b

Browse files
authored
Merge branch 'main' into deprecate_stacklevel
2 parents 30d97f0 + 5246d13 commit 2b59e2b

File tree

336 files changed

+6042
-3358
lines changed

Some content is hidden

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

336 files changed

+6042
-3358
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-5
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
@@ -104,6 +101,6 @@ echo "Build extensions"
104101
python setup.py build_ext -q -j3
105102

106103
echo "Install pandas"
107-
python -m pip install --no-build-isolation -e .
104+
python -m pip install --no-build-isolation --no-use-pep517 -e .
108105

109106
echo "done"
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Set up Conda environment
2+
inputs:
3+
environment-file:
4+
description: Conda environment file to use.
5+
default: environment.yml
6+
pyarrow-version:
7+
description: If set, overrides the PyArrow version in the Conda environment to the given string.
8+
required: false
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Set Arrow version in ${{ inputs.environment-file }} to ${{ inputs.pyarrow-version }}
13+
run: |
14+
grep -q ' - pyarrow' ${{ inputs.environment-file }}
15+
sed -i"" -e "s/ - pyarrow/ - pyarrow=${{ inputs.pyarrow-version }}/" ${{ inputs.environment-file }}
16+
cat ${{ inputs.environment-file }}
17+
shell: bash
18+
if: ${{ inputs.pyarrow-version }}
19+
20+
- name: Install ${{ inputs.environment-file }}
21+
uses: conda-incubator/setup-miniconda@v2
22+
with:
23+
environment-file: ${{ inputs.environment-file }}
24+
channel-priority: ${{ runner.os == 'macOS' && 'flexible' || 'strict' }}
25+
channels: conda-forge
26+
mamba-version: "0.23"
27+
use-mamba: true

.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/code-checks.yml

+10-11
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,6 @@ jobs:
6767
environment-file: ${{ env.ENV_FILE }}
6868
use-only-tar-bz2: true
6969

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]
78-
7970
- name: Build Pandas
8071
id: build
8172
uses: ./.github/actions/build_pandas
@@ -96,8 +87,16 @@ jobs:
9687
run: ci/code_checks.sh docstrings
9788
if: ${{ steps.build.outcome == 'success' }}
9889

99-
- name: Run typing validation
100-
run: ci/code_checks.sh typing
90+
- name: Use existing environment for type checking
91+
run: |
92+
echo $PATH >> $GITHUB_PATH
93+
echo "PYTHONHOME=$PYTHONHOME" >> $GITHUB_ENV
94+
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
95+
96+
- name: Typing
97+
uses: pre-commit/[email protected]
98+
with:
99+
extra_args: --hook-stage manual --all-files
101100
if: ${{ steps.build.outcome == 'success' }}
102101

103102
- name: Run docstring validation script tests

.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

+3-17
Original file line numberDiff line numberDiff line change
@@ -43,32 +43,18 @@ 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
6756
run: ci/run_tests.sh
6857

69-
- name: Build Version
70-
run: conda list
71-
7258
- name: Publish test results
7359
uses: actions/upload-artifact@v3
7460
with:

.github/workflows/posix.yml

-13
Original file line numberDiff line numberDiff line change
@@ -155,24 +155,11 @@ jobs:
155155
channel-priority: flexible
156156
environment-file: ${{ env.ENV_FILE }}
157157
use-only-tar-bz2: true
158-
if: ${{ env.IS_PYPY == 'false' }} # No pypy3.8 support
159158

160159
- name: Upgrade Arrow version
161160
run: conda install -n pandas-dev -c conda-forge --no-update-deps pyarrow=${{ matrix.pyarrow_version }}
162161
if: ${{ matrix.pyarrow_version }}
163162

164-
- name: Setup PyPy
165-
uses: actions/setup-python@v3
166-
with:
167-
python-version: "pypy-3.8"
168-
if: ${{ env.IS_PYPY == 'true' }}
169-
170-
- name: Setup PyPy dependencies
171-
run: |
172-
# TODO: re-enable cov, its slowing the tests down though
173-
pip install Cython numpy python-dateutil pytz pytest>=6.0 pytest-xdist>=1.31.0 pytest-asyncio>=0.17 hypothesis>=5.5.3
174-
if: ${{ env.IS_PYPY == 'true' }}
175-
176163
- name: Build Pandas
177164
uses: ./.github/actions/build_pandas
178165

.github/workflows/python-dev.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Unfreeze(by commentingthe if: false() condition) once the
33
# next Python Dev version has released beta 1 and both Cython and numpy support it
44
# After that Python has released, migrate the workflows to the
5-
# posix GHA workflows/Azure pipelines and "freeze" this file by
5+
# posix GHA workflows and "freeze" this file by
66
# uncommenting the if: false() condition
77
# Feel free to modify this comment as necessary.
88

@@ -54,11 +54,10 @@ jobs:
5454
with:
5555
python-version: '3.11-dev'
5656

57-
# TODO: GH#44980 https://github.com/pypa/setuptools/issues/2941
5857
- name: Install dependencies
5958
shell: bash -el {0}
6059
run: |
61-
python -m pip install --upgrade pip "setuptools<60.0.0" wheel
60+
python -m pip install --upgrade pip setuptools wheel
6261
pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy
6362
pip install git+https://github.com/nedbat/coveragepy.git
6463
pip install cython python-dateutil pytz hypothesis pytest>=6.2.5 pytest-xdist pytest-cov

.github/workflows/sdist.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ jobs:
4141
with:
4242
python-version: ${{ matrix.python-version }}
4343

44-
# TODO: GH#44980 https://github.com/pypa/setuptools/issues/2941
4544
- name: Install dependencies
4645
run: |
47-
python -m pip install --upgrade pip "setuptools<60.0.0" wheel
46+
python -m pip install --upgrade pip setuptools wheel
4847
4948
# GH 39416
5049
pip install numpy
@@ -66,10 +65,8 @@ jobs:
6665
channels: conda-forge
6766
python-version: '${{ matrix.python-version }}'
6867

69-
# TODO: GH#44980 https://github.com/pypa/setuptools/issues/2941
7068
- name: Install pandas from sdist
7169
run: |
72-
python -m pip install --upgrade "setuptools<60.0.0"
7370
pip list
7471
python -m pip install dist/*.gz
7572

.pre-commit-config.yaml

+20-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
minimum_pre_commit_version: 2.9.2
1+
minimum_pre_commit_version: 2.15.0
22
exclude: ^LICENSES/|\.(html|csv|svg)$
3+
# reserve "manual" for mypy and pyright
4+
default_stages: [commit, merge-commit, push, prepare-commit-msg, commit-msg, post-checkout, post-commit, post-merge, post-rewrite]
35
ci:
46
autofix_prs: false
57
repos:
@@ -9,7 +11,7 @@ repos:
911
- id: absolufy-imports
1012
files: ^pandas/
1113
- repo: https://github.com/jendrikseipp/vulture
12-
rev: 'v2.3'
14+
rev: 'v2.4'
1315
hooks:
1416
- id: vulture
1517
entry: python scripts/run_vulture.py
@@ -31,7 +33,9 @@ repos:
3133
- id: debug-statements
3234
- id: end-of-file-fixer
3335
exclude: \.txt$
36+
stages: [commit, merge-commit, push, prepare-commit-msg, commit-msg, post-checkout, post-commit, post-merge, post-rewrite]
3437
- id: trailing-whitespace
38+
stages: [commit, merge-commit, push, prepare-commit-msg, commit-msg, post-checkout, post-commit, post-merge, post-rewrite]
3539
- repo: https://github.com/cpplint/cpplint
3640
rev: 1.6.0
3741
hooks:
@@ -56,7 +60,7 @@ repos:
5660
hooks:
5761
- id: isort
5862
- repo: https://github.com/asottile/pyupgrade
59-
rev: v2.32.0
63+
rev: v2.32.1
6064
hooks:
6165
- id: pyupgrade
6266
args: [--py38-plus]
@@ -71,7 +75,7 @@ repos:
7175
types: [text] # overwrite types: [rst]
7276
types_or: [python, rst]
7377
- repo: https://github.com/sphinx-contrib/sphinx-lint
74-
rev: v0.4.1
78+
rev: v0.6
7579
hooks:
7680
- id: sphinx-lint
7781
- repo: https://github.com/asottile/yesqa
@@ -84,12 +88,22 @@ repos:
8488
- id: pyright
8589
name: pyright
8690
entry: pyright
91+
# note: assumes python env is setup and activated
8792
language: node
8893
pass_filenames: false
8994
types: [python]
9095
stages: [manual]
91-
# note: keep version in sync with .github/workflows/code-checks.yml
92-
additional_dependencies: ['[email protected]']
96+
additional_dependencies: ['[email protected]']
97+
- repo: local
98+
hooks:
99+
- id: mypy
100+
name: mypy
101+
entry: mypy
102+
# note: assumes python env is setup and activated
103+
language: system
104+
pass_filenames: false
105+
types: [python]
106+
stages: [manual]
93107
- repo: local
94108
hooks:
95109
- id: flake8-rst

0 commit comments

Comments
 (0)