Skip to content

Commit 6ea6d61

Browse files
authored
Merge branch 'main' into tinycss2
2 parents 04d91c4 + 944ee5e commit 6ea6d61

File tree

395 files changed

+8088
-3492
lines changed

Some content is hidden

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

395 files changed

+8088
-3492
lines changed

.github/workflows/code-checks.yml

+3
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ jobs:
153153
- name: Build image
154154
run: docker build --pull --no-cache --tag pandas-dev-env .
155155

156+
- name: Show environment
157+
run: docker run -w /home/pandas pandas-dev-env mamba run -n pandas-dev python -c "import pandas as pd; print(pd.show_versions())"
158+
156159
requirements-dev-text-installable:
157160
name: Test install requirements-dev.txt
158161
runs-on: ubuntu-latest

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
echo "${{ secrets.server_ssh_key }}" > ~/.ssh/id_rsa
6868
chmod 600 ~/.ssh/id_rsa
6969
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'
70+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
7171

7272
- name: Copy cheatsheets into site directory
7373
run: cp doc/cheatsheet/Pandas_Cheat_Sheet* web/build/
@@ -81,7 +81,7 @@ jobs:
8181
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
8282

8383
- 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}
84+
run: rsync -az --delete doc/build/html/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas/pandas-docs/version/${GITHUB_REF_NAME:1}
8585
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
8686

8787
- name: Move docs into site directory

.github/workflows/macos-windows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
defaults:
2929
run:
3030
shell: bash -el {0}
31-
timeout-minutes: 120
31+
timeout-minutes: 180
3232
strategy:
3333
matrix:
3434
os: [macos-latest, windows-latest]

.github/workflows/python-dev.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@ jobs:
8080
python -m pip install python-dateutil pytz cython hypothesis==6.52.1 pytest>=6.2.5 pytest-xdist pytest-cov pytest-asyncio>=0.17
8181
python -m pip list
8282
83+
# GH 47305: Parallel build can cause flaky ImportError from pandas/_libs/tslibs
8384
- name: Build Pandas
8485
run: |
85-
python setup.py build_ext -q -j2
86+
python setup.py build_ext -q -j1
8687
python -m pip install -e . --no-build-isolation --no-use-pep517
8788
8889
- name: Build Version

.github/workflows/scorecards.yml

+54
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/[email protected]
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

.github/workflows/ubuntu.yml

+17-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
defaults:
2727
run:
2828
shell: bash -el {0}
29-
timeout-minutes: 120
29+
timeout-minutes: 180
3030
strategy:
3131
matrix:
3232
env_file: [actions-38.yaml, actions-39.yaml, actions-310.yaml]
@@ -42,18 +42,26 @@ jobs:
4242
- name: "Minimum Versions"
4343
env_file: actions-38-minimum_versions.yaml
4444
pattern: "not slow and not network and not single_cpu"
45-
- name: "Locale: it_IT.utf8"
45+
- name: "Locale: it_IT"
4646
env_file: actions-38.yaml
4747
pattern: "not slow and not network and not single_cpu"
4848
extra_apt: "language-pack-it"
49+
# Use the utf8 version as the default, it has no bad side-effect.
4950
lang: "it_IT.utf8"
5051
lc_all: "it_IT.utf8"
51-
- name: "Locale: zh_CN.utf8"
52+
# Also install it_IT (its encoding is ISO8859-1) but do not activate it.
53+
# It will be temporarily activated during tests with locale.setlocale
54+
extra_loc: "it_IT"
55+
- name: "Locale: zh_CN"
5256
env_file: actions-38.yaml
5357
pattern: "not slow and not network and not single_cpu"
5458
extra_apt: "language-pack-zh-hans"
59+
# Use the utf8 version as the default, it has no bad side-effect.
5560
lang: "zh_CN.utf8"
5661
lc_all: "zh_CN.utf8"
62+
# Also install zh_CN (its encoding is gb2312) but do not activate it.
63+
# It will be temporarily activated during tests with locale.setlocale
64+
extra_loc: "zh_CN"
5765
- name: "Copy-on-Write"
5866
env_file: actions-310.yaml
5967
pattern: "not slow and not network and not single_cpu"
@@ -148,6 +156,12 @@ jobs:
148156
# xsel for clipboard tests
149157
run: sudo apt-get update && sudo apt-get install -y xsel ${{ env.EXTRA_APT }}
150158

159+
- name: Generate extra locales
160+
# These extra locales will be available for locale.setlocale() calls in tests
161+
run: |
162+
sudo locale-gen ${{ matrix.extra_loc }}
163+
if: ${{ matrix.extra_loc }}
164+
151165
- name: Set up Conda
152166
uses: ./.github/actions/setup-conda
153167
with:

.github/workflows/wheels.yml

+211
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
# Workflow to build wheels for upload to PyPI.
2+
# Inspired by numpy's cibuildwheel config https://github.com/numpy/numpy/blob/main/.github/workflows/wheels.yml
3+
#
4+
# In an attempt to save CI resources, wheel builds do
5+
# not run on each push but only weekly and for releases.
6+
# Wheel builds can be triggered from the Actions page
7+
# (if you have the perms) on a commit to master.
8+
#
9+
# Alternatively, you can add labels to the pull request in order to trigger wheel
10+
# builds.
11+
# The label(s) that trigger builds are:
12+
# - Build
13+
name: Wheel builder
14+
15+
on:
16+
schedule:
17+
# ┌───────────── minute (0 - 59)
18+
# │ ┌───────────── hour (0 - 23)
19+
# │ │ ┌───────────── day of the month (1 - 31)
20+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
21+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
22+
# │ │ │ │ │
23+
- cron: "27 3 */1 * *"
24+
push:
25+
pull_request:
26+
types: [labeled, opened, synchronize, reopened]
27+
workflow_dispatch:
28+
29+
concurrency:
30+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
31+
cancel-in-progress: true
32+
33+
jobs:
34+
build_wheels:
35+
name: Build wheel for ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
36+
if: >-
37+
github.event_name == 'schedule' ||
38+
github.event_name == 'workflow_dispatch' ||
39+
(github.event_name == 'pull_request' &&
40+
contains(github.event.pull_request.labels.*.name, 'Build')) ||
41+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')))
42+
runs-on: ${{ matrix.buildplat[0] }}
43+
strategy:
44+
# Ensure that a wheel builder finishes even if another fails
45+
fail-fast: false
46+
matrix:
47+
# Github Actions doesn't support pairing matrix values together, let's improvise
48+
# https://github.com/github/feedback/discussions/7835#discussioncomment-1769026
49+
buildplat:
50+
- [ubuntu-20.04, manylinux_x86_64]
51+
- [macos-11, macosx_*]
52+
- [windows-2019, win_amd64]
53+
- [windows-2019, win32]
54+
# TODO: support PyPy?
55+
python: [["cp38", "3.8"], ["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11-dev"]]# "pp38", "pp39"]
56+
env:
57+
IS_32_BIT: ${{ matrix.buildplat[1] == 'win32' }}
58+
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
59+
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
60+
steps:
61+
- name: Checkout pandas
62+
uses: actions/checkout@v3
63+
with:
64+
submodules: true
65+
# versioneer.py requires the latest tag to be reachable. Here we
66+
# fetch the complete history to get access to the tags.
67+
# A shallow clone can work when the following issue is resolved:
68+
# https://github.com/actions/checkout/issues/338
69+
fetch-depth: 0
70+
71+
- name: Build wheels
72+
uses: pypa/[email protected]
73+
env:
74+
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
75+
CIBW_ENVIRONMENT: IS_32_BIT='${{ env.IS_32_BIT }}'
76+
# We can't test directly with cibuildwheel, since we need to have to wheel location
77+
# to mount into the docker image
78+
CIBW_TEST_COMMAND_LINUX: "python {project}/ci/test_wheels.py"
79+
CIBW_TEST_COMMAND_MACOS: "python {project}/ci/test_wheels.py"
80+
CIBW_TEST_REQUIRES: hypothesis==6.52.1 pytest>=6.2.5 pytest-xdist pytest-asyncio>=0.17
81+
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "python ci/fix_wheels.py {wheel} {dest_dir}"
82+
CIBW_ARCHS_MACOS: x86_64 universal2
83+
CIBW_BUILD_VERBOSITY: 3
84+
85+
# Used to test the built wheels
86+
- uses: actions/setup-python@v3
87+
with:
88+
python-version: ${{ matrix.python[1] }}
89+
90+
- name: Test wheels (Windows 64-bit only)
91+
if: ${{ matrix.buildplat[1] == 'win_amd64' }}
92+
shell: cmd
93+
run: |
94+
python ci/test_wheels.py wheelhouse
95+
96+
- uses: actions/upload-artifact@v3
97+
with:
98+
name: ${{ matrix.python[0] }}-${{ startsWith(matrix.buildplat[1], 'macosx') && 'macosx' || matrix.buildplat[1] }}
99+
path: ./wheelhouse/*.whl
100+
101+
# Used to push the built wheels
102+
# TODO: once Python 3.11 is available on conda, de-dup with
103+
# setup python above
104+
- uses: conda-incubator/setup-miniconda@v2
105+
with:
106+
auto-update-conda: true
107+
# Really doesn't matter what version we upload with
108+
# just the version we test with
109+
python-version: '3.8'
110+
channels: conda-forge
111+
channel-priority: true
112+
mamba-version: "*"
113+
114+
- name: Install anaconda client
115+
if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
116+
run: conda install -q -y anaconda-client
117+
118+
119+
- name: Upload wheels
120+
if: success()
121+
shell: bash
122+
env:
123+
PANDAS_STAGING_UPLOAD_TOKEN: ${{ secrets.PANDAS_STAGING_UPLOAD_TOKEN }}
124+
PANDAS_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN }}
125+
run: |
126+
source ci/upload_wheels.sh
127+
set_upload_vars
128+
# trigger an upload to
129+
# https://anaconda.org/scipy-wheels-nightly/pandas
130+
# for cron jobs or "Run workflow" (restricted to main branch).
131+
# Tags will upload to
132+
# https://anaconda.org/multibuild-wheels-staging/pandas
133+
# The tokens were originally generated at anaconda.org
134+
upload_wheels
135+
build_sdist:
136+
name: Build sdist
137+
if: >-
138+
github.event_name == 'schedule' ||
139+
github.event_name == 'workflow_dispatch' ||
140+
(github.event_name == 'pull_request' &&
141+
contains(github.event.pull_request.labels.*.name, 'Build')) ||
142+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')))
143+
runs-on: ubuntu-latest
144+
env:
145+
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
146+
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
147+
steps:
148+
- name: Checkout pandas
149+
uses: actions/checkout@v3
150+
with:
151+
submodules: true
152+
# versioneer.py requires the latest tag to be reachable. Here we
153+
# fetch the complete history to get access to the tags.
154+
# A shallow clone can work when the following issue is resolved:
155+
# https://github.com/actions/checkout/issues/338
156+
fetch-depth: 0
157+
158+
# Used to push the built sdist
159+
- uses: conda-incubator/setup-miniconda@v2
160+
with:
161+
auto-update-conda: true
162+
# Really doesn't matter what version we upload with
163+
# just the version we test with
164+
python-version: '3.8'
165+
channels: conda-forge
166+
channel-priority: true
167+
mamba-version: "*"
168+
169+
- name: Build sdist
170+
run: |
171+
pip install build
172+
python -m build --sdist
173+
- name: Test the sdist
174+
shell: bash -el {0}
175+
run: |
176+
# TODO: Don't run test suite, and instead build wheels from sdist
177+
# by splitting the wheel builders into a two stage job
178+
# (1. Generate sdist 2. Build wheels from sdist)
179+
# This tests the sdists, and saves some build time
180+
python -m pip install dist/*.gz
181+
pip install hypothesis==6.52.1 pytest>=6.2.5 pytest-xdist pytest-asyncio>=0.17
182+
cd .. # Not a good idea to test within the src tree
183+
python -c "import pandas; print(pandas.__version__);
184+
pandas.test(extra_args=['-m not clipboard and not single_cpu', '--skip-slow', '--skip-network', '--skip-db', '-n=2']);
185+
pandas.test(extra_args=['-m not clipboard and single_cpu', '--skip-slow', '--skip-network', '--skip-db'])"
186+
- uses: actions/upload-artifact@v3
187+
with:
188+
name: sdist
189+
path: ./dist/*
190+
191+
- name: Install anaconda client
192+
if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
193+
run: |
194+
conda install -q -y anaconda-client
195+
196+
- name: Upload sdist
197+
if: success()
198+
shell: bash
199+
env:
200+
PANDAS_STAGING_UPLOAD_TOKEN: ${{ secrets.PANDAS_STAGING_UPLOAD_TOKEN }}
201+
PANDAS_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN }}
202+
run: |
203+
source ci/upload_wheels.sh
204+
set_upload_vars
205+
# trigger an upload to
206+
# https://anaconda.org/scipy-wheels-nightly/pandas
207+
# for cron jobs or "Run workflow" (restricted to main branch).
208+
# Tags will upload to
209+
# https://anaconda.org/multibuild-wheels-staging/pandas
210+
# The tokens were originally generated at anaconda.org
211+
upload_wheels

.libcst.codemod.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# String that LibCST should look for in code which indicates that the
2+
# module is generated code.
3+
generated_code_marker: '@generated'
4+
# Command line and arguments for invoking a code formatter. Anything
5+
# specified here must be capable of taking code via stdin and returning
6+
# formatted code via stdout.
7+
formatter: ['black', '-']
8+
# List of regex patterns which LibCST will evaluate against filenames to
9+
# determine if the module should be touched.
10+
blacklist_patterns: []
11+
# List of modules that contain codemods inside of them.
12+
modules:
13+
- 'libcst.codemod.commands'
14+
- 'autotyping'
15+
# Absolute or relative path of the repository root, used for providing
16+
# full-repo metadata. Relative paths should be specified with this file
17+
# location as the base.
18+
repo_root: '.'

0 commit comments

Comments
 (0)