Skip to content

Commit 11b09d7

Browse files
committed
Merge remote-tracking branch 'upstream/main' into fix_string_formatting
2 parents 0a0d0fc + 49851bb commit 11b09d7

File tree

695 files changed

+20389
-11356
lines changed

Some content is hidden

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

695 files changed

+20389
-11356
lines changed

.circleci/config.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
image: ubuntu-2004:2022.04.1
77
resource_class: arm.large
88
environment:
9-
ENV_FILE: ci/deps/circle-39-arm64.yaml
9+
ENV_FILE: ci/deps/circle-310-arm64.yaml
1010
PYTEST_WORKERS: auto
1111
PATTERN: "not single_cpu and not slow and not network and not clipboard and not arm_slow and not db"
1212
PYTEST_TARGET: "pandas"
@@ -26,7 +26,6 @@ jobs:
2626
image: ubuntu-2004:2022.04.1
2727
resource_class: arm.large
2828
environment:
29-
ENV_FILE: ci/deps/circle-38-arm64.yaml
3029
TRIGGER_SOURCE: << pipeline.trigger_source >>
3130
steps:
3231
- checkout

.circleci/setup_env.sh

+1-4
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@ if pip list | grep -q ^pandas; then
5454
pip uninstall -y pandas || true
5555
fi
5656

57-
echo "Build extensions"
58-
python setup.py build_ext -q -j4
59-
6057
echo "Install pandas"
61-
python -m pip install --no-build-isolation --no-use-pep517 -e .
58+
python -m pip install --no-build-isolation -ve .
6259

6360
echo "done"

.github/CODEOWNERS

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# github
2+
.github/ @mroeschke
3+
4+
# ci
5+
ci/ @mroeschke
6+
7+
# web
8+
web/ @datapythonista
9+
10+
# docs
11+
doc/cheatsheet @Dr-Irv
12+
13+
# pandas
14+
pandas/_libs/ @WillAyd
15+
pandas/_libs/tslibs/* @MarcoGorelli
16+
pandas/_typing.py @Dr-Irv
17+
pandas/core/groupby/* @rhshadrach
18+
pandas/core/tools/datetimes.py @MarcoGorelli
19+
pandas/io/excel/* @rhshadrach
20+
pandas/io/formats/style.py @attack68
21+
pandas/io/formats/style_render.py @attack68
22+
pandas/io/formats/templates @attack68

.github/actions/build_pandas/action.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Build pandas
22
description: Rebuilds the C extensions and installs pandas
3+
inputs:
4+
editable:
5+
description: Whether to build pandas in editable mode (default true)
6+
default: true
37
runs:
48
using: composite
59
steps:
@@ -12,9 +16,9 @@ runs:
1216

1317
- name: Build Pandas
1418
run: |
15-
python setup.py build_ext -j $N_JOBS
16-
python -m pip install -e . --no-build-isolation --no-use-pep517 --no-index
19+
if [[ ${{ inputs.editable }} == "true" ]]; then
20+
pip install -e . --no-build-isolation -v
21+
else
22+
pip install . --no-build-isolation -v
23+
fi
1724
shell: bash -el {0}
18-
env:
19-
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
20-
N_JOBS: ${{ runner.os == 'macOS' && 3 || 2 }}

.github/actions/setup-conda/action.yml

+3-12
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,14 @@ inputs:
33
environment-file:
44
description: Conda environment file to use.
55
default: environment.yml
6-
environment-name:
7-
description: Name to use for the Conda environment
8-
default: test
9-
extra-specs:
10-
description: Extra packages to install
11-
required: false
126
runs:
137
using: composite
148
steps:
159
- name: Install ${{ inputs.environment-file }}
16-
uses: mamba-org/provision-with-micromamba@v15
10+
uses: mamba-org/setup-micromamba@v1
1711
with:
1812
environment-file: ${{ inputs.environment-file }}
19-
environment-name: ${{ inputs.environment-name }}
20-
extra-specs: ${{ inputs.extra-specs }}
21-
channels: conda-forge
22-
channel-priority: 'strict'
13+
environment-name: test
2314
condarc-file: ci/condarc.yml
24-
cache-env: true
15+
cache-environment: true
2516
cache-downloads: true

.github/workflows/cache-cleanup.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Clean closed branch caches
2+
on:
3+
pull_request:
4+
types:
5+
- closed
6+
7+
jobs:
8+
cleanup:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Clean Cache
12+
run: |
13+
gh extension install actions/gh-actions-cache
14+
15+
REPO=${{ github.repository }}
16+
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
17+
18+
echo "Fetching list of cache key"
19+
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
20+
21+
## Setting this to not fail the workflow while deleting cache keys.
22+
set +e
23+
echo "Deleting caches..."
24+
for cacheKey in $cacheKeysForPR
25+
do
26+
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
27+
done
28+
echo "Done"
29+
env:
30+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/code-checks.yml

+17-4
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,25 @@ jobs:
6363
- name: Build Pandas
6464
id: build
6565
uses: ./.github/actions/build_pandas
66+
with:
67+
editable: false
6668

6769
# The following checks are independent of each other and should still be run if one fails
70+
71+
# TODO: The doctests have to be run first right now, since the Cython doctests only work
72+
# with pandas installed in non-editable mode
73+
# This can be removed once pytest-cython doesn't require C extensions to be installed inplace
74+
- name: Run doctests
75+
run: cd ci && ./code_checks.sh doctests
76+
if: ${{ steps.build.outcome == 'success' && always() }}
77+
78+
- name: Install pandas in editable mode
79+
id: build-editable
80+
if: ${{ steps.build.outcome == 'success' && always() }}
81+
uses: ./.github/actions/build_pandas
82+
with:
83+
editable: true
84+
6885
- name: Check for no warnings when building single-page docs
6986
run: ci/code_checks.sh single-docs
7087
if: ${{ steps.build.outcome == 'success' && always() }}
@@ -73,10 +90,6 @@ jobs:
7390
run: ci/code_checks.sh code
7491
if: ${{ steps.build.outcome == 'success' && always() }}
7592

76-
- name: Run doctests
77-
run: ci/code_checks.sh doctests
78-
if: ${{ steps.build.outcome == 'success' && always() }}
79-
8093
- name: Run docstring validation
8194
run: ci/code_checks.sh docstrings
8295
if: ${{ steps.build.outcome == 'success' && always() }}

.github/workflows/codeql.yml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
actions: read
1919
contents: read
2020
security-events: write
21+
if: github.repository_owner == 'pandas-dev'
2122

2223
strategy:
2324
fail-fast: false
+47-13
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
# This bot updates the issue with number DEPRECATION_TRACKER_ISSUE
2+
# with the PR number that issued the deprecation.
3+
4+
# It runs on commits to main, and will trigger if the PR linked to a merged commit has the "Deprecate" label
15
name: Deprecations Bot
26

37
on:
4-
pull_request:
8+
push:
59
branches:
610
- main
7-
types:
8-
[closed]
911

1012

1113
permissions:
@@ -15,17 +17,49 @@ jobs:
1517
deprecation_update:
1618
permissions:
1719
issues: write
18-
if: >-
19-
contains(github.event.pull_request.labels.*.name, 'Deprecate') && github.event.pull_request.merged == true
2020
runs-on: ubuntu-22.04
2121
env:
2222
DEPRECATION_TRACKER_ISSUE: 50578
2323
steps:
24-
- name: Checkout
25-
run: |
26-
echo "Adding deprecation PR number to deprecation tracking issue"
27-
export PR=${{ github.event.pull_request.number }}
28-
BODY=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/issues/${DEPRECATION_TRACKER_ISSUE} |
29-
python3 -c "import sys, json, os; x = {'body': json.load(sys.stdin)['body']}; pr = os.environ['PR']; x['body'] += f'\n- [ ] #{pr}'; print(json.dumps(x))")
30-
echo ${BODY}
31-
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -X PATCH -d "${BODY}" https://api.github.com/repos/${{ github.repository }}/issues/${DEPRECATION_TRACKER_ISSUE}
24+
- uses: actions/github-script@v6
25+
id: update-deprecation-issue
26+
with:
27+
script: |
28+
body = await github.rest.issues.get({
29+
owner: context.repo.owner,
30+
repo: context.repo.repo,
31+
issue_number: ${{ env.DEPRECATION_TRACKER_ISSUE }},
32+
})
33+
body = body["data"]["body"];
34+
linkedPRs = await github.rest.repos.listPullRequestsAssociatedWithCommit({
35+
owner: context.repo.owner,
36+
repo: context.repo.repo,
37+
commit_sha: '${{ github.sha }}'
38+
})
39+
linkedPRs = linkedPRs["data"];
40+
console.log(linkedPRs);
41+
if (linkedPRs.length > 0) {
42+
console.log("Found linked PR");
43+
linkedPR = linkedPRs[0]
44+
isDeprecation = false
45+
for (label of linkedPR["labels"]) {
46+
if (label["name"] == "Deprecate") {
47+
isDeprecation = true;
48+
break;
49+
}
50+
}
51+
52+
PR_NUMBER = linkedPR["number"];
53+
54+
body += ("\n- [ ] #" + PR_NUMBER);
55+
if (isDeprecation) {
56+
console.log("PR is a deprecation PR. Printing new body of issue");
57+
console.log(body);
58+
github.rest.issues.update({
59+
owner: context.repo.owner,
60+
repo: context.repo.repo,
61+
issue_number: ${{ env.DEPRECATION_TRACKER_ISSUE }},
62+
body: body
63+
})
64+
}
65+
}

.github/workflows/package-checks.yml

+36-7
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ on:
1414
permissions:
1515
contents: read
1616

17+
defaults:
18+
run:
19+
shell: bash -el {0}
20+
1721
jobs:
1822
pip:
1923
if: ${{ github.event.label.name == 'Build' || contains(github.event.pull_request.labels.*.name, 'Build') || github.event_name == 'push'}}
@@ -40,13 +44,38 @@ jobs:
4044
with:
4145
python-version: '3.10'
4246

43-
- name: Install required dependencies
44-
run: |
45-
python -m pip install --upgrade pip setuptools wheel python-dateutil pytz numpy cython
46-
python -m pip install versioneer[toml]
47-
shell: bash -el {0}
48-
4947
- name: Pip install with extra
5048
run: |
51-
python -m pip install -e .[${{ matrix.extra }}] --no-build-isolation
49+
python -m pip install .[${{ matrix.extra }}] -v
5250
shell: bash -el {0}
51+
conda_forge_recipe:
52+
if: ${{ github.event.label.name == 'Build' || contains(github.event.pull_request.labels.*.name, 'Build') || github.event_name == 'push'}}
53+
runs-on: ubuntu-22.04
54+
strategy:
55+
matrix:
56+
python-version: ['3.9', '3.10', '3.11']
57+
fail-fast: false
58+
name: Test Conda Forge Recipe - Python ${{ matrix.python-version }}
59+
concurrency:
60+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
61+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-conda-forge-recipe-${{ matrix.python-version }}
62+
cancel-in-progress: true
63+
steps:
64+
- name: Checkout
65+
uses: actions/checkout@v3
66+
with:
67+
fetch-depth: 0
68+
69+
- name: Set up Python
70+
uses: mamba-org/setup-micromamba@v1
71+
with:
72+
environment-name: recipe-test
73+
create-args: >-
74+
python=${{ matrix.python-version }}
75+
boa
76+
conda-verify
77+
cache-downloads: true
78+
cache-environment: true
79+
80+
- name: Build conda package
81+
run: conda mambabuild ci --no-anaconda-upload --verify --strict-verify --output --output-folder .

.github/workflows/stale-pr.yml

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
stale:
1212
permissions:
1313
pull-requests: write
14+
if: github.repository_owner == 'pandas-dev'
1415
runs-on: ubuntu-22.04
1516
steps:
1617
- uses: actions/stale@v8

0 commit comments

Comments
 (0)