Skip to content

Commit 4b0a948

Browse files
committed
Merge remote-tracking branch 'upstream/main' into python-db-dtypes-pandas-issue28
2 parents 8876b9a + a614b7a commit 4b0a948

File tree

955 files changed

+27256
-31257
lines changed

Some content is hidden

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

955 files changed

+27256
-31257
lines changed

.circleci/setup_env.sh

Lines changed: 12 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,16 @@
11
#!/bin/bash -e
22

3-
# edit the locale file if needed
4-
if [[ "$(uname)" == "Linux" && -n "$LC_ALL" ]]; then
5-
echo "Adding locale to the first line of pandas/__init__.py"
6-
rm -f pandas/__init__.pyc
7-
SEDC="3iimport locale\nlocale.setlocale(locale.LC_ALL, '$LC_ALL')\n"
8-
sed -i "$SEDC" pandas/__init__.py
9-
10-
echo "[head -4 pandas/__init__.py]"
11-
head -4 pandas/__init__.py
12-
echo
13-
fi
3+
echo "Install Mambaforge"
4+
MAMBA_URL="https://github.com/conda-forge/miniforge/releases/download/4.14.0-0/Mambaforge-4.14.0-0-Linux-aarch64.sh"
5+
echo "Downloading $MAMBA_URL"
6+
wget -q $MAMBA_URL -O minimamba.sh
7+
chmod +x minimamba.sh
148

9+
MAMBA_DIR="$HOME/miniconda3"
10+
rm -rf $MAMBA_DIR
11+
./minimamba.sh -b -p $MAMBA_DIR
1512

16-
MINICONDA_DIR=/usr/local/miniconda
17-
if [ -e $MINICONDA_DIR ] && [ "$BITS32" != yes ]; then
18-
echo "Found Miniconda installation at $MINICONDA_DIR"
19-
else
20-
echo "Install Miniconda"
21-
DEFAULT_CONDA_URL="https://repo.continuum.io/miniconda/Miniconda3-latest"
22-
if [[ "$(uname -m)" == 'aarch64' ]]; then
23-
CONDA_URL="https://github.com/conda-forge/miniforge/releases/download/4.10.1-4/Miniforge3-4.10.1-4-Linux-aarch64.sh"
24-
elif [[ "$(uname)" == 'Linux' ]]; then
25-
if [[ "$BITS32" == "yes" ]]; then
26-
CONDA_URL="$DEFAULT_CONDA_URL-Linux-x86.sh"
27-
else
28-
CONDA_URL="$DEFAULT_CONDA_URL-Linux-x86_64.sh"
29-
fi
30-
elif [[ "$(uname)" == 'Darwin' ]]; then
31-
CONDA_URL="$DEFAULT_CONDA_URL-MacOSX-x86_64.sh"
32-
else
33-
echo "OS $(uname) not supported"
34-
exit 1
35-
fi
36-
echo "Downloading $CONDA_URL"
37-
wget -q $CONDA_URL -O miniconda.sh
38-
chmod +x miniconda.sh
39-
40-
MINICONDA_DIR="$HOME/miniconda3"
41-
rm -rf $MINICONDA_DIR
42-
./miniconda.sh -b -p $MINICONDA_DIR
43-
fi
44-
export PATH=$MINICONDA_DIR/bin:$PATH
13+
export PATH=$MAMBA_DIR/bin:$PATH
4514

4615
echo
4716
echo "which conda"
@@ -51,7 +20,7 @@ echo
5120
echo "update conda"
5221
conda config --set ssl_verify false
5322
conda config --set quiet true --set always_yes true --set changeps1 false
54-
conda install -y -c conda-forge -n base 'mamba>=0.21.2' pip setuptools
23+
mamba install -y -c conda-forge -n base pip setuptools
5524

5625
echo "conda info -a"
5726
conda info -a
@@ -70,11 +39,6 @@ time mamba env update -n pandas-dev --file="${ENV_FILE}"
7039
echo "conda list -n pandas-dev"
7140
conda list -n pandas-dev
7241

73-
if [[ "$BITS32" == "yes" ]]; then
74-
# activate 32-bit compiler
75-
export CONDA_BUILD=1
76-
fi
77-
7842
echo "activate pandas-dev"
7943
source activate pandas-dev
8044

@@ -90,15 +54,9 @@ if pip list | grep -q ^pandas; then
9054
pip uninstall -y pandas || true
9155
fi
9256

93-
if [ "$(conda list -f qt --json)" != [] ]; then
94-
echo
95-
echo "remove qt"
96-
echo "causes problems with the clipboard, we use xsel for that"
97-
conda remove qt -y --force || true
98-
fi
99-
10057
echo "Build extensions"
101-
python setup.py build_ext -q -j3
58+
# GH 47305: Parallel build can causes flaky ImportError from pandas/_libs/tslibs
59+
python setup.py build_ext -q -j1
10260

10361
echo "Install pandas"
10462
python -m pip install --no-build-isolation --no-use-pep517 -e .

.github/ISSUE_TEMPLATE/feature_request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,5 @@ body:
6868
attributes:
6969
label: Additional Context
7070
description: >
71-
Please provide any relevant Github issues, code examples or references that help describe and support
71+
Please provide any relevant GitHub issues, code examples or references that help describe and support
7272
the feature request.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- [ ] closes #xxxx (Replace xxxx with the Github issue number)
1+
- [ ] 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).
44
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ on:
55
branches:
66
- main
77
- 1.5.x
8-
- 1.4.x
98
pull_request:
109
branches:
1110
- main
1211
- 1.5.x
13-
- 1.4.x
1412
paths-ignore:
1513
- "doc/**"
1614

.github/workflows/code-checks.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ on:
55
branches:
66
- main
77
- 1.5.x
8-
- 1.4.x
98
pull_request:
109
branches:
1110
- main
1211
- 1.5.x
13-
- 1.4.x
1412

1513
env:
1614
ENV_FILE: environment.yml
@@ -88,7 +86,7 @@ jobs:
8886
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
8987
if: ${{ steps.build.outcome == 'success' && always() }}
9088

91-
- name: Typing
89+
- name: Typing + pylint
9290
uses: pre-commit/action@v2.0.3
9391
with:
9492
extra_args: --hook-stage manual --all-files
@@ -153,6 +151,9 @@ jobs:
153151
- name: Build image
154152
run: docker build --pull --no-cache --tag pandas-dev-env .
155153

154+
- name: Show environment
155+
run: docker run -w /home/pandas pandas-dev-env mamba run -n pandas-dev python -c "import pandas as pd; print(pd.show_versions())"
156+
156157
requirements-dev-text-installable:
157158
name: Test install requirements-dev.txt
158159
runs-on: ubuntu-latest

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ on:
55
branches:
66
- main
77
- 1.5.x
8-
- 1.4.x
98
tags:
109
- '*'
1110
pull_request:
1211
branches:
1312
- main
1413
- 1.5.x
15-
- 1.4.x
1614

1715
env:
1816
ENV_FILE: environment.yml
@@ -66,22 +64,22 @@ jobs:
6664
mkdir -m 700 -p ~/.ssh
6765
echo "${{ secrets.server_ssh_key }}" > ~/.ssh/id_rsa
6866
chmod 600 ~/.ssh/id_rsa
69-
echo "${{ secrets.server_ip }} ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBE1Kkopomm7FHG5enATf7SgnpICZ4W2bw+Ho+afqin+w7sMcrsa0je7sbztFAV8YchDkiBKnWTG4cRT+KZgZCaY=" > ~/.ssh/known_hosts
70-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
67+
echo "${{ secrets.server_ip }} ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFjYkJBk7sos+r7yATODogQc3jUdW1aascGpyOD4bohj8dWjzwLJv/OJ/fyOQ5lmj81WKDk67tGtqNJYGL9acII=" > ~/.ssh/known_hosts
68+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
7169

7270
- name: Copy cheatsheets into site directory
7371
run: cp doc/cheatsheet/Pandas_Cheat_Sheet* web/build/
7472

7573
- name: Upload web
76-
run: rsync -az --delete --exclude='pandas-docs' --exclude='docs' web/build/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas
74+
run: rsync -az --delete --exclude='pandas-docs' --exclude='docs' web/build/ web@${{ secrets.server_ip }}:/var/www/html
7775
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
7876

7977
- name: Upload dev docs
80-
run: rsync -az --delete doc/build/html/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas/pandas-docs/dev
78+
run: rsync -az --delete doc/build/html/ web@${{ secrets.server_ip }}:/var/www/html/pandas-docs/dev
8179
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
8280

8381
- name: Upload prod docs
84-
run: rsync -az --delete doc/build/html/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas/pandas-docs/version/${GITHUB_REF_NAME}
82+
run: rsync -az --delete doc/build/html/ web@${{ secrets.server_ip }}:/var/www/html/pandas-docs/version/${GITHUB_REF_NAME:1}
8583
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
8684

8785
- name: Move docs into site directory

.github/workflows/macos-windows.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
name: Windows-MacOS
1+
name: Windows-macOS
22

33
on:
44
push:
55
branches:
66
- main
77
- 1.5.x
8-
- 1.4.x
98
pull_request:
109
branches:
1110
- main
1211
- 1.5.x
13-
- 1.4.x
1412
paths-ignore:
1513
- "doc/**"
1614

@@ -28,7 +26,7 @@ jobs:
2826
defaults:
2927
run:
3028
shell: bash -el {0}
31-
timeout-minutes: 120
29+
timeout-minutes: 180
3230
strategy:
3331
matrix:
3432
os: [macos-latest, windows-latest]
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Package Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 1.5.x
8+
pull_request:
9+
branches:
10+
- main
11+
- 1.5.x
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
pip:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
extra: ["test", "performance", "timezone", "computation", "fss", "aws", "gcp", "excel", "parquet", "feather", "hdf5", "spss", "postgresql", "mysql", "sql-other", "html", "xml", "plot", "output_formatting", "clipboard", "compression", "all"]
22+
fail-fast: false
23+
name: Install Extras - ${{ matrix.extra }}
24+
concurrency:
25+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
26+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-pip-extras-${{ matrix.extra }}
27+
cancel-in-progress: true
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v3
32+
with:
33+
fetch-depth: 0
34+
35+
- name: Setup Python
36+
id: setup_python
37+
uses: actions/setup-python@v3
38+
with:
39+
python-version: '3.8'
40+
41+
# Hacky patch to disable building cython extensions.
42+
# This job should only check that the extras successfully install.
43+
- name: Disable building ext_modules
44+
run: |
45+
sed -i '/ext_modules=/d' setup.py
46+
shell: bash -el {0}
47+
48+
- name: Install required dependencies
49+
run: |
50+
python -m pip install --upgrade pip setuptools wheel python-dateutil pytz numpy cython
51+
shell: bash -el {0}
52+
53+
- name: Pip install with extra
54+
run: |
55+
python -m pip install -e .[${{ matrix.extra }}] --no-build-isolation
56+
shell: bash -el {0}

.github/workflows/python-dev.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# In general, this file will remain frozen(present, but not running) until:
55
# - The next unreleased Python version has released beta 1
6-
# - This version should be available on Github Actions.
6+
# - This version should be available on GitHub Actions.
77
# - Our required build/runtime dependencies(numpy, pytz, Cython, python-dateutil)
88
# support that unreleased Python version.
99
# To unfreeze, comment out the ``if: false`` condition, and make sure you update
@@ -25,12 +25,10 @@ on:
2525
branches:
2626
- main
2727
- 1.5.x
28-
- 1.4.x
2928
pull_request:
3029
branches:
3130
- main
3231
- 1.5.x
33-
- 1.4.x
3432
paths-ignore:
3533
- "doc/**"
3634

@@ -54,7 +52,7 @@ jobs:
5452
os: [ubuntu-latest, macOS-latest, windows-latest]
5553

5654
name: actions-311-dev
57-
timeout-minutes: 80
55+
timeout-minutes: 120
5856

5957
concurrency:
6058
#https://github.community/t/concurrecy-not-work-for-push/183068/7
@@ -75,15 +73,16 @@ jobs:
7573
run: |
7674
python --version
7775
python -m pip install --upgrade pip setuptools wheel
78-
python -m pip install git+https://github.com/numpy/numpy.git
76+
python -m pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy
7977
python -m pip install git+https://github.com/nedbat/coveragepy.git
8078
python -m pip install python-dateutil pytz cython hypothesis==6.52.1 pytest>=6.2.5 pytest-xdist pytest-cov pytest-asyncio>=0.17
8179
python -m pip list
8280
81+
# GH 47305: Parallel build can cause flaky ImportError from pandas/_libs/tslibs
8382
- name: Build Pandas
8483
run: |
85-
python setup.py build_ext -q -j2
86-
python -m pip install -e . --no-build-isolation --no-use-pep517
84+
python setup.py build_ext -q -j1
85+
python -m pip install -e . --no-build-isolation --no-use-pep517 --no-index
8786
8887
- name: Build Version
8988
run: |

.github/workflows/scorecards.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Scorecards supply-chain security
2+
on:
3+
# Only the default branch is supported.
4+
branch_protection_rule:
5+
schedule:
6+
- cron: '27 19 * * 4'
7+
push:
8+
branches: [ "main" ]
9+
10+
# Declare default permissions as read only.
11+
permissions: read-all
12+
13+
jobs:
14+
analysis:
15+
name: Scorecards analysis
16+
runs-on: ubuntu-latest
17+
permissions:
18+
# Needed to upload the results to code-scanning dashboard.
19+
security-events: write
20+
# Used to receive a badge.
21+
id-token: write
22+
23+
if: github.repository == 'pandas-dev/pandas' # don't run on forks
24+
25+
steps:
26+
- name: "Checkout code"
27+
uses: actions/checkout@v3
28+
with:
29+
persist-credentials: false
30+
31+
- name: "Run analysis"
32+
uses: ossf/scorecard-action@v2.0.6
33+
with:
34+
results_file: results.sarif
35+
results_format: sarif
36+
37+
# Publish the results for public repositories to enable scorecard badges. For more details, see
38+
# https://github.com/ossf/scorecard-action#publishing-results.
39+
publish_results: true
40+
41+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
42+
# format to the repository Actions tab.
43+
- name: "Upload artifact"
44+
uses: actions/upload-artifact@v3
45+
with:
46+
name: SARIF file
47+
path: results.sarif
48+
retention-days: 5
49+
50+
# Upload the results to GitHub's code scanning dashboard.
51+
- name: "Upload to code-scanning"
52+
uses: github/codeql-action/upload-sarif@v1
53+
with:
54+
sarif_file: results.sarif

0 commit comments

Comments
 (0)