Skip to content

Commit 806fd20

Browse files
author
MarcoGorelli
committed
xfail
2 parents 344a7d7 + fabdd5d commit 806fd20

39 files changed

+3482
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
/opt/python/cp38-cp38/bin/python -m venv ~/virtualenvs/pandas-dev && \
3939
. ~/virtualenvs/pandas-dev/bin/activate && \
4040
python -m pip install --no-deps -U pip wheel 'setuptools<60.0.0' && \
41-
pip install cython 'numpy<1.24.0' python-dateutil pytz pytest pytest-xdist pytest-asyncio>=0.17 hypothesis && \
41+
pip install cython numpy python-dateutil pytz pytest pytest-xdist pytest-asyncio>=0.17 hypothesis && \
4242
python setup.py build_ext -q -j1 && \
4343
python -m pip install --no-build-isolation --no-use-pep517 -e . && \
4444
python -m pip list && \

.github/workflows/package-checks.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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+
types: [ labeled, opened, synchronize, reopened ]
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
pip:
19+
if: ${{ github.event.label.name == 'Build' || contains(github.event.pull_request.labels.*.name, 'Build') || github.event_name == 'push'}}
20+
runs-on: ubuntu-22.04
21+
strategy:
22+
matrix:
23+
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"]
24+
fail-fast: false
25+
name: Install Extras - ${{ matrix.extra }}
26+
concurrency:
27+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
28+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-pip-extras-${{ matrix.extra }}
29+
cancel-in-progress: true
30+
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v3
34+
with:
35+
fetch-depth: 0
36+
37+
- name: Setup Python
38+
id: setup_python
39+
uses: actions/setup-python@v4
40+
with:
41+
python-version: '3.8'
42+
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+
49+
- name: Pip install with extra
50+
run: |
51+
python -m pip install -e .[${{ matrix.extra }}] --no-build-isolation
52+
shell: bash -el {0}

.github/workflows/wheels.yml

+199
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
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"]]# "pp38", "pp39"]
56+
env:
57+
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
58+
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
59+
steps:
60+
- name: Checkout pandas
61+
uses: actions/checkout@v3
62+
with:
63+
submodules: true
64+
# versioneer.py requires the latest tag to be reachable. Here we
65+
# fetch the complete history to get access to the tags.
66+
# A shallow clone can work when the following issue is resolved:
67+
# https://github.com/actions/checkout/issues/338
68+
fetch-depth: 0
69+
70+
- name: Build wheels
71+
uses: pypa/[email protected]
72+
env:
73+
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
74+
75+
# Used to test(Windows-only) and push the built wheels
76+
# You might need to use setup-python separately
77+
# if the new Python-dev version
78+
# is unavailable on conda-forge.
79+
- uses: conda-incubator/setup-miniconda@v2
80+
with:
81+
auto-update-conda: true
82+
python-version: ${{ matrix.python[1] }}
83+
activate-environment: test
84+
channels: conda-forge, anaconda
85+
channel-priority: true
86+
mamba-version: "*"
87+
88+
- name: Test wheels (Windows 64-bit only)
89+
if: ${{ matrix.buildplat[1] == 'win_amd64' }}
90+
shell: cmd /C CALL {0}
91+
run: |
92+
python ci/test_wheels.py wheelhouse
93+
94+
- uses: actions/upload-artifact@v3
95+
with:
96+
name: ${{ matrix.python[0] }}-${{ startsWith(matrix.buildplat[1], 'macosx') && 'macosx' || matrix.buildplat[1] }}
97+
path: ./wheelhouse/*.whl
98+
99+
100+
- name: Install anaconda client
101+
if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
102+
shell: bash -el {0}
103+
run: conda install -q -y anaconda-client
104+
105+
106+
- name: Upload wheels
107+
if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
108+
shell: bash -el {0}
109+
env:
110+
PANDAS_STAGING_UPLOAD_TOKEN: ${{ secrets.PANDAS_STAGING_UPLOAD_TOKEN }}
111+
PANDAS_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN }}
112+
run: |
113+
source ci/upload_wheels.sh
114+
set_upload_vars
115+
# trigger an upload to
116+
# https://anaconda.org/scipy-wheels-nightly/pandas
117+
# for cron jobs or "Run workflow" (restricted to main branch).
118+
# Tags will upload to
119+
# https://anaconda.org/multibuild-wheels-staging/pandas
120+
# The tokens were originally generated at anaconda.org
121+
upload_wheels
122+
build_sdist:
123+
name: Build sdist
124+
if: >-
125+
github.event_name == 'schedule' ||
126+
github.event_name == 'workflow_dispatch' ||
127+
(github.event_name == 'pull_request' &&
128+
contains(github.event.pull_request.labels.*.name, 'Build')) ||
129+
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')))
130+
runs-on: ubuntu-22.04
131+
env:
132+
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
133+
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
134+
steps:
135+
- name: Checkout pandas
136+
uses: actions/checkout@v3
137+
with:
138+
submodules: true
139+
# versioneer.py requires the latest tag to be reachable. Here we
140+
# fetch the complete history to get access to the tags.
141+
# A shallow clone can work when the following issue is resolved:
142+
# https://github.com/actions/checkout/issues/338
143+
fetch-depth: 0
144+
145+
# Used to push the built sdist
146+
- uses: conda-incubator/setup-miniconda@v2
147+
with:
148+
auto-update-conda: true
149+
# Really doesn't matter what version we upload with
150+
# just the version we test with
151+
python-version: '3.8'
152+
channels: conda-forge
153+
channel-priority: true
154+
mamba-version: "*"
155+
156+
- name: Build sdist
157+
run: |
158+
pip install build
159+
python -m build --sdist
160+
- name: Test the sdist
161+
shell: bash -el {0}
162+
run: |
163+
# TODO: Don't run test suite, and instead build wheels from sdist
164+
# by splitting the wheel builders into a two stage job
165+
# (1. Generate sdist 2. Build wheels from sdist)
166+
# This tests the sdists, and saves some build time
167+
python -m pip install dist/*.gz
168+
pip install hypothesis==6.52.1 pytest>=6.2.5 pytest-xdist pytest-asyncio>=0.17
169+
cd .. # Not a good idea to test within the src tree
170+
python -c "import pandas; print(pandas.__version__);
171+
pandas.test(extra_args=['-m not clipboard and not single_cpu', '--skip-slow', '--skip-network', '--skip-db', '-n=2']);
172+
pandas.test(extra_args=['-m not clipboard and single_cpu', '--skip-slow', '--skip-network', '--skip-db'])"
173+
- uses: actions/upload-artifact@v3
174+
with:
175+
name: sdist
176+
path: ./dist/*
177+
178+
- name: Install anaconda client
179+
if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
180+
shell: bash -el {0}
181+
run: |
182+
conda install -q -y anaconda-client
183+
184+
- name: Upload sdist
185+
if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
186+
shell: bash -el {0}
187+
env:
188+
PANDAS_STAGING_UPLOAD_TOKEN: ${{ secrets.PANDAS_STAGING_UPLOAD_TOKEN }}
189+
PANDAS_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN }}
190+
run: |
191+
source ci/upload_wheels.sh
192+
set_upload_vars
193+
# trigger an upload to
194+
# https://anaconda.org/scipy-wheels-nightly/pandas
195+
# for cron jobs or "Run workflow" (restricted to main branch).
196+
# Tags will upload to
197+
# https://anaconda.org/multibuild-wheels-staging/pandas
198+
# The tokens were originally generated at anaconda.org
199+
upload_wheels

.gitpod.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Building pandas on init
2+
# Might delegate this later to prebuild with Q2 improvements on gitpod
3+
# https://www.gitpod.io/docs/config-start-tasks/#configuring-the-terminal
4+
# -------------------------------------------------------------------------
5+
6+
# assuming we use dockerhub: name of the docker user, docker image, tag, e.g. https://hub.docker.com/r/pandas/pandas-gitpod/tags
7+
image: pythonpandas/pandas-gitpod:latest
8+
tasks:
9+
- name: Prepare development environment
10+
init: |
11+
mkdir -p .vscode
12+
cp gitpod/settings.json .vscode/settings.json
13+
conda activate pandas-dev
14+
git pull --unshallow # need to force this else the prebuild fails
15+
git fetch --tags
16+
python setup.py build_ext -j 4
17+
python -m pip install -e . --no-build-isolation
18+
echo "🛠 Completed rebuilding Pandas!! 🛠 "
19+
echo "✨ Pre-build complete! You can close this terminal ✨ "
20+
21+
# --------------------------------------------------------
22+
# exposing ports for liveserve
23+
ports:
24+
- port: 5500
25+
onOpen: notify
26+
27+
# --------------------------------------------------------
28+
# some useful extensions to have
29+
vscode:
30+
extensions:
31+
- ms-python.python
32+
- yzhang.markdown-all-in-one
33+
- eamodio.gitlens
34+
- lextudio.restructuredtext
35+
- ritwickdey.liveserver
36+
# add or remove what you think is generally useful to most contributors
37+
# avoid adding too many. they each open a pop-up window
38+
39+
# --------------------------------------------------------
40+
# using prebuilds for the container
41+
# With this configuration the prebuild will happen on push to main
42+
github:
43+
prebuilds:
44+
# enable for main/default branch
45+
main: true
46+
# enable for other branches (defaults to false)
47+
branches: false
48+
# enable for pull requests coming from this repo (defaults to true)
49+
pullRequests: false
50+
# enable for pull requests coming from forks (defaults to false)
51+
pullRequestsFromForks: false
52+
# add a check to pull requests (defaults to true)
53+
addCheck: false
54+
# add a "Review in Gitpod" button as a comment to pull requests (defaults to false)
55+
addComment: false
56+
# add a "Review in Gitpod" button to the pull request's description (defaults to false)
57+
addBadge: false
58+
# add a label once the prebuild is ready to pull requests (defaults to false)
59+
addLabel: false

.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: '.'

ci/fix_wheels.py

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import os
2+
import shutil
3+
import sys
4+
import zipfile
5+
6+
try:
7+
if len(sys.argv) != 3:
8+
raise ValueError(
9+
"User must pass the path to the wheel and the destination directory."
10+
)
11+
wheel_path = sys.argv[1]
12+
dest_dir = sys.argv[2]
13+
# Figure out whether we are building on 32 or 64 bit python
14+
is_32 = sys.maxsize <= 2**32
15+
PYTHON_ARCH = "x86" if is_32 else "x64"
16+
except ValueError:
17+
# Too many/little values to unpack
18+
raise ValueError(
19+
"User must pass the path to the wheel and the destination directory."
20+
)
21+
# Wheels are zip files
22+
if not os.path.isdir(dest_dir):
23+
print(f"Created directory {dest_dir}")
24+
os.mkdir(dest_dir)
25+
shutil.copy(wheel_path, dest_dir) # Remember to delete if process fails
26+
wheel_name = os.path.basename(wheel_path)
27+
success = True
28+
exception = None
29+
repaired_wheel_path = os.path.join(dest_dir, wheel_name)
30+
with zipfile.ZipFile(repaired_wheel_path, "a") as zipf:
31+
try:
32+
# TODO: figure out how licensing works for the redistributables
33+
base_redist_dir = (
34+
f"C:/Program Files (x86)/Microsoft Visual Studio/2019/"
35+
f"Enterprise/VC/Redist/MSVC/14.29.30133/{PYTHON_ARCH}/"
36+
f"Microsoft.VC142.CRT/"
37+
)
38+
zipf.write(
39+
os.path.join(base_redist_dir, "msvcp140.dll"),
40+
"pandas/_libs/window/msvcp140.dll",
41+
)
42+
zipf.write(
43+
os.path.join(base_redist_dir, "concrt140.dll"),
44+
"pandas/_libs/window/concrt140.dll",
45+
)
46+
if not is_32:
47+
zipf.write(
48+
os.path.join(base_redist_dir, "vcruntime140_1.dll"),
49+
"pandas/_libs/window/vcruntime140_1.dll",
50+
)
51+
except Exception as e:
52+
success = False
53+
exception = e
54+
55+
if not success:
56+
os.remove(repaired_wheel_path)
57+
raise exception
58+
print(f"Successfully repaired wheel was written to {repaired_wheel_path}")

0 commit comments

Comments
 (0)