Skip to content

CI: Build wheel from sdist #53087

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 85 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
03f3a53
CI: Build wheel from sdist
mroeschke May 4, 2023
875258e
Save sdist name to pass to ciwheelbuild
mroeschke May 4, 2023
71d0a5d
Fix typo
mroeschke May 4, 2023
578d251
fix typo
mroeschke May 4, 2023
cd467d7
Check dist
mroeschke May 4, 2023
4e75e00
Another typo
mroeschke May 4, 2023
fff3322
one more typo?
mroeschke May 4, 2023
d52d1f0
Remove missing files in Manifest, checkout project
mroeschke May 5, 2023
9cec291
try a different variable
mroeschke May 5, 2023
873c3ed
Merge remote-tracking branch 'upstream/main' into ci/ref/wheel
mroeschke May 5, 2023
b33fdf4
Try in the prior directory up
mroeschke May 5, 2023
bf07020
check project folder
mroeschke May 5, 2023
31c7ae2
Pull path
mroeschke May 5, 2023
e80a9a9
Exclude some data files
mroeschke May 5, 2023
f1473b2
Replace test command
mroeschke May 5, 2023
8aea373
Remove .data as well
mroeschke May 5, 2023
8da7b6d
Install locale on musl
mroeschke May 5, 2023
c2c49d9
Try delvewheel
mroeschke May 5, 2023
0d7a3e9
Run wheel unpack everywhere
mroeschke May 5, 2023
0e0ffe9
Skip in script
mroeschke May 5, 2023
037af2d
Wheel unpack separately
mroeschke May 6, 2023
c620df7
Invalid toml
mroeschke May 6, 2023
e789a0e
Run wheel unpack outside
mroeschke May 6, 2023
fd7edd9
dont create dir
mroeschke May 6, 2023
73bf0dc
Merge remote-tracking branch 'upstream/main' into ci/ref/wheel
mroeschke May 7, 2023
7003dc4
Debug mac unpack, try alternative test
mroeschke May 7, 2023
79f54d2
Align
mroeschke May 7, 2023
7b252f6
for loop validate, try to fix -v
mroeschke May 7, 2023
530774a
for loop validate, try to fix -v
mroeschke May 7, 2023
e473b84
Fix path
mroeschke May 7, 2023
9fe2bfa
Try pwd
mroeschke May 7, 2023
4c3e200
To root?
mroeschke May 7, 2023
42a90ab
Use another bash?
mroeschke May 7, 2023
637b7e8
try MSYS_NO_PATHCONV
mroeschke May 7, 2023
0403f69
Add backslash
mroeschke May 7, 2023
3ae62a2
Remove a slash
mroeschke May 7, 2023
35d3553
Merge remote-tracking branch 'upstream/main' into ci/ref/wheel
mroeschke May 7, 2023
81d4072
Merge remote-tracking branch 'upstream/main' into ci/ref/wheel
mroeschke May 8, 2023
ce16918
Use powershell
mroeschke May 8, 2023
4f33918
Use variable
mroeschke May 8, 2023
1a24871
Typo
mroeschke May 8, 2023
96a537b
Add other deps
mroeschke May 8, 2023
01260cd
Final cleanups
mroeschke May 8, 2023
72887fb
Remove unecessary select
mroeschke May 8, 2023
de2e631
Merge remote-tracking branch 'upstream/main' into ci/ref/wheel
mroeschke May 8, 2023
2bef564
Try no
mroeschke May 8, 2023
e96c00f
Make multiline comment
mroeschke May 9, 2023
38f438c
Put pack repo owner
mroeschke May 9, 2023
50cd94c
Merge remote-tracking branch 'upstream/main' into ci/ref/wheel
mroeschke May 9, 2023
163a929
Try single
mroeschke May 9, 2023
3db474e
clean step title
mroeschke May 9, 2023
cd9600f
Merge remote-tracking branch 'upstream/main' into ci/ref/wheel
mroeschke May 12, 2023
3971c67
Update to setup micromaba
mroeschke May 12, 2023
184a211
Use create-args
mroeschke May 12, 2023
4faf222
Use create args
mroeschke May 12, 2023
11149b6
Set PANDAS_CI
mroeschke May 12, 2023
130353f
Merge remote-tracking branch 'upstream/main' into ci/ref/wheel
mroeschke May 15, 2023
5328797
Merge remote-tracking branch 'upstream/main' into ci/ref/wheel
mroeschke May 19, 2023
03b98be
Merge remote-tracking branch 'upstream/main' into ci/ref/wheel
mroeschke May 23, 2023
a24ff26
Try running all on powershell
mroeschke May 23, 2023
d6b86fc
Merge remote-tracking branch 'upstream/main' into ci/ref/wheel
mroeschke May 23, 2023
ce6cbd5
Use ;
mroeschke May 23, 2023
a1b4813
Merge remote-tracking branch 'upstream/main' into ci/ref/wheel
mroeschke May 23, 2023
bcc1bcf
Try this command
mroeschke May 23, 2023
dfb17bb
Add double?
mroeschke May 23, 2023
af94126
Merge remote-tracking branch 'upstream/main' into ci/ref/wheel
mroeschke May 24, 2023
beded2c
Merge remote-tracking branch 'upstream/main' into ci/ref/wheel
mroeschke May 25, 2023
35b155e
try escpaing quotes
mroeschke May 25, 2023
8d3a77e
Merge remote-tracking branch 'upstream/main' into ci/ref/wheel
mroeschke May 25, 2023
0138a54
Escape brackets?
mroeschke May 25, 2023
20a9a64
remove comma
mroeschke May 25, 2023
29d6710
Single quotes
mroeschke May 26, 2023
e957a95
Other quotes
mroeschke May 26, 2023
04345d8
Merge remote-tracking branch 'upstream/main' into ci/ref/wheel
mroeschke May 27, 2023
ccd97a8
single?
mroeschke May 27, 2023
3274248
Merge remote-tracking branch 'upstream/main' into ci/ref/wheel
mroeschke May 30, 2023
7c4a95a
Backslash?
mroeschke May 30, 2023
9d2a033
Merge remote-tracking branch 'upstream/main' into ci/ref/wheel
mroeschke May 31, 2023
2a40c01
All the escapes
mroeschke May 31, 2023
9f92307
No marks
mroeschke May 31, 2023
77bc858
Fix quotes
mroeschke May 31, 2023
cc90ddb
Merge remote-tracking branch 'upstream/main' into ci/ref/wheel
mroeschke Jun 1, 2023
53c03b7
test don't repair windows wheel
mroeschke Jun 1, 2023
1fb638b
Merge remote-tracking branch 'upstream/main' into ci/ref/wheel
mroeschke Jun 1, 2023
954cd28
Uncomment delvewheel
mroeschke Jun 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
205 changes: 83 additions & 122 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# In an attempt to save CI resources, wheel builds do
# not run on each push but only weekly and for releases.
# Wheel builds can be triggered from the Actions page
# (if you have the perms) on a commit to master.
# (if you have the permissions) on a commit to main.
#
# Alternatively, you can add labels to the pull request in order to trigger wheel
# builds.
Expand All @@ -14,13 +14,8 @@ name: Wheel builder

on:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
- cron: "27 3 */1 * *"
# 3:27 UTC every day
- cron: "27 3 * * *"
push:
pull_request:
types: [labeled, opened, synchronize, reopened]
Expand All @@ -37,170 +32,136 @@ permissions:
contents: read

jobs:
build_wheels:
name: Build wheel for ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
build_sdist:
name: Build sdist
if: >-
(github.event_name == 'schedule' && github.repository_owner == 'pandas-dev') ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'Build')) ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')))
runs-on: ${{ matrix.buildplat[0] }}
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
# GitHub Actions doesn't support pairing matrix values together, let's improvise
# https://github.com/github/feedback/discussions/7835#discussioncomment-1769026
buildplat:
- [ubuntu-20.04, manylinux_x86_64]
- [macos-11, macosx_*]
- [windows-2019, win_amd64]
# TODO: support PyPy?
python: [["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"]]# "pp39"]
runs-on: ubuntu-22.04
env:
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
outputs:
sdist_file: ${{ steps.save-path.outputs.sdist_name }}
steps:
- name: Checkout pandas
uses: actions/checkout@v3
with:
submodules: true
# versioneer.py requires the latest tag to be reachable. Here we
# fetch the complete history to get access to the tags.
# A shallow clone can work when the following issue is resolved:
# https://github.com/actions/checkout/issues/338
fetch-depth: 0

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}

# Used to test(Windows-only) and push the built wheels
# You might need to use setup-python separately
# if the new Python-dev version
# is unavailable on conda-forge.
- uses: conda-incubator/setup-miniconda@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
auto-update-conda: true
python-version: ${{ matrix.python[1] }}
activate-environment: test
channels: conda-forge, anaconda
channel-priority: true
# mamba fails to solve, also we really don't need this since we're just installing python
# mamba-version: "*"

- name: Test wheels (Windows 64-bit only)
if: ${{ matrix.buildplat[1] == 'win_amd64' }}
shell: cmd /C CALL {0}
python-version: '3.11'

- name: Build sdist
run: |
python ci/test_wheels.py wheelhouse
python -m pip install build
python -m build --sdist

- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.python[0] }}-${{ startsWith(matrix.buildplat[1], 'macosx') && 'macosx' || matrix.buildplat[1] }}
path: ./wheelhouse/*.whl

name: sdist
path: ./dist/*

- name: Install anaconda client
if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
- name: Output sdist name
id: save-path
shell: bash -el {0}
run: conda install -q -y anaconda-client
run: echo "sdist_name=$(ls ./dist)" >> "$GITHUB_OUTPUT"


- name: Upload wheels
if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
shell: bash -el {0}
env:
PANDAS_STAGING_UPLOAD_TOKEN: ${{ secrets.PANDAS_STAGING_UPLOAD_TOKEN }}
PANDAS_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN }}
run: |
source ci/upload_wheels.sh
set_upload_vars
# trigger an upload to
# https://anaconda.org/scipy-wheels-nightly/pandas
# for cron jobs or "Run workflow" (restricted to main branch).
# Tags will upload to
# https://anaconda.org/multibuild-wheels-staging/pandas
# The tokens were originally generated at anaconda.org
upload_wheels
build_sdist:
name: Build sdist
build_wheels:
needs: build_sdist
name: Build wheel for ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
if: >-
github.event_name == 'schedule' ||
(github.event_name == 'schedule' && github.repository_owner == 'pandas-dev') ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'Build')) ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')))
runs-on: ubuntu-22.04
runs-on: ${{ matrix.buildplat[0] }}
strategy:
fail-fast: false
matrix:
# GitHub Actions doesn't support pairing matrix values together, let's improvise
# https://github.com/github/feedback/discussions/7835#discussioncomment-1769026
buildplat:
- [ubuntu-22.04, manylinux_x86_64]
- [ubuntu-22.04, musllinux_x86_64]
- [macos-12, macosx_*]
- [windows-2022, win_amd64]
# TODO: support PyPy?
python: [["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"]]
env:
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
steps:
- name: Checkout pandas
uses: actions/checkout@v3
with:
submodules: true
# versioneer.py requires the latest tag to be reachable. Here we
# fetch the complete history to get access to the tags.
# A shallow clone can work when the following issue is resolved:
# https://github.com/actions/checkout/issues/338
fetch-depth: 0

# Used to push the built sdist
- uses: conda-incubator/setup-miniconda@v2
- name: Download sdist
uses: actions/download-artifact@v3
with:
auto-update-conda: true
# Really doesn't matter what version we upload with
# just the version we test with
python-version: '3.10'
channels: conda-forge
channel-priority: true
# mamba fails to solve, also we really don't need this since we're just installing python
# mamba-version: "*"
name: sdist
path: ./dist

- name: Build sdist
run: |
pip install build
python -m build --sdist
- name: Test the sdist
shell: bash -el {0}
run: |
# TODO: Don't run test suite, and instead build wheels from sdist
# by splitting the wheel builders into a two stage job
# (1. Generate sdist 2. Build wheels from sdist)
# This tests the sdists, and saves some build time
python -m pip install dist/*.gz
pip install hypothesis>=6.46.1 pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17
cd .. # Not a good idea to test within the src tree
python -c "import pandas; print(pandas.__version__);
pandas.test(extra_args=['-m not clipboard and not single_cpu and not slow and not network and not db', '-n 2']);
pandas.test(extra_args=['-m not clipboard and single_cpu and not slow and not network and not db'])"
- uses: actions/upload-artifact@v3
- name: Build wheels
uses: pypa/[email protected]
with:
name: sdist
path: ./dist/*
package-dir: ./dist/${{ needs.build_sdist.outputs.sdist_file }}
env:
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}

- name: Install anaconda client
if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
- name: Set up Python
uses: mamba-org/setup-micromamba@v1
with:
environment-name: wheel-env
create-args: >-
python=${{ matrix.python[1] }}
anaconda-client
wheel
cache-downloads: true
cache-environment: true

- name: Validate wheel RECORD
shell: bash -el {0}
run: for whl in $(ls wheelhouse); do wheel unpack wheelhouse/$whl -d /tmp; done

# Testing on windowsservercore instead of GHA runner to fail on missing DLLs
- name: Test Windows Wheels
if: ${{ matrix.buildplat[1] == 'win_amd64' }}
shell: pwsh
run: |
conda install -q -y anaconda-client
$TST_CMD = @"
python -m pip install pytz six numpy python-dateutil tzdata>=2022.1 hypothesis>=6.46.1 pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17;
python -m pip install --find-links=pandas\wheelhouse --no-index pandas;
python -c `'import pandas as pd; pd.test()`';
"@
docker pull python:${{ matrix.python[1] }}-windowsservercore
docker run --env PANDAS_CI='1' -v ${PWD}:C:\pandas python:${{ matrix.python[1] }}-windowsservercore powershell -Command $TST_CMD

- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.python[0] }}-${{ startsWith(matrix.buildplat[1], 'macosx') && 'macosx' || matrix.buildplat[1] }}
path: ./wheelhouse/*.whl

- name: Upload sdist
- name: Upload wheels & sdist
if: ${{ success() && (env.IS_SCHEDULE_DISPATCH == 'true' || env.IS_PUSH == 'true') }}
shell: bash -el {0}
env:
PANDAS_STAGING_UPLOAD_TOKEN: ${{ secrets.PANDAS_STAGING_UPLOAD_TOKEN }}
PANDAS_NIGHTLY_UPLOAD_TOKEN: ${{ secrets.PANDAS_NIGHTLY_UPLOAD_TOKEN }}
# trigger an upload to
# https://anaconda.org/scipy-wheels-nightly/pandas
# for cron jobs or "Run workflow" (restricted to main branch).
# Tags will upload to
# https://anaconda.org/multibuild-wheels-staging/pandas
# The tokens were originally generated at anaconda.org
run: |
source ci/upload_wheels.sh
set_upload_vars
# trigger an upload to
# https://anaconda.org/scipy-wheels-nightly/pandas
# for cron jobs or "Run workflow" (restricted to main branch).
# Tags will upload to
# https://anaconda.org/multibuild-wheels-staging/pandas
# The tokens were originally generated at anaconda.org
upload_wheels
10 changes: 7 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
include RELEASE.md
include versioneer.py

graft doc
prune doc/build

Expand All @@ -10,6 +7,7 @@ graft pandas

global-exclude *.bz2
global-exclude *.csv
global-exclude *.data
global-exclude *.dta
global-exclude *.feather
global-exclude *.tar
Expand All @@ -18,9 +16,12 @@ global-exclude *.h5
global-exclude *.html
global-exclude *.json
global-exclude *.jsonl
global-exclude *.kml
global-exclude *.msgpack
global-exclude *.pdf
global-exclude *.parquet
global-exclude *.pickle
global-exclude *.pkl
global-exclude *.png
global-exclude *.pptx
global-exclude *.ods
Expand All @@ -29,12 +30,15 @@ global-exclude *.orc
global-exclude *.sas7bdat
global-exclude *.sav
global-exclude *.so
global-exclude *.txt
global-exclude *.xls
global-exclude *.xlsb
global-exclude *.xlsm
global-exclude *.xlsx
global-exclude *.xpt
global-exclude *.cpt
global-exclude *.xml
global-exclude *.xsl
global-exclude *.xz
global-exclude *.zip
global-exclude *.zst
Expand Down
61 changes: 0 additions & 61 deletions ci/fix_wheels.py

This file was deleted.

Loading