Skip to content

Commit

Permalink
Updated wheel build process for new location
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Sep 24, 2023
1 parent 905cf06 commit 6ac02ce
Show file tree
Hide file tree
Showing 13 changed files with 91 additions and 139 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/wheels-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ if [[ "$MB_PYTHON_VERSION" == pypy3* ]]; then
fi

echo "::group::Install a virtualenv"
source multibuild/common_utils.sh
source multibuild/travis_steps.sh
source wheels/multibuild/common_utils.sh
source wheels/multibuild/travis_steps.sh
python3 -m pip install virtualenv
before_install
echo "::endgroup::"

echo "::group::Build wheel"
clean_code
build_wheel
ls -l "${GITHUB_WORKSPACE}/${WHEEL_SDIR}/"
echo "::endgroup::"
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/wheels-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ name: Build Linux wheels
on:
workflow_call:
inputs:
build-commit:
required: true
type: string
artifacts-name:
required: true
type: string

env:
REPO_DIR: Pillow
CONFIG_PATH: "wheels/config.sh"
REPO_DIR: "."
TEST_DEPENDS: "pytest pytest-timeout"

jobs:
Expand Down Expand Up @@ -49,7 +47,6 @@ jobs:
mb-ml-libc: "musllinux"
mb-ml-ver: "_1_1"
env:
BUILD_COMMIT: ${{ inputs.build-commit }}
MB_PYTHON_VERSION: ${{ matrix.python }}
MB_ML_LIBC: ${{ matrix.mb-ml-libc }}
MB_ML_VER: ${{ matrix.mb-ml-ver }}
Expand All @@ -61,7 +58,7 @@ jobs:
with:
python-version: "3.x"
- name: Build Wheel
run: .github/workflows/build.sh
run: .github/workflows/wheels-build.sh
- uses: actions/upload-artifact@v3
with:
name: ${{ inputs.artifacts-name }}
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/wheels-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ name: Build macOS wheels
on:
workflow_call:
inputs:
build-commit:
required: true
type: string
artifacts-name:
required: true
type: string

env:
REPO_DIR: Pillow
CONFIG_PATH: "wheels/config.sh"
REPO_DIR: "."
TEST_DEPENDS: "pytest pytest-timeout"

jobs:
Expand All @@ -37,7 +35,6 @@ jobs:
- python: "pypy3.10-7.3.12"
platform: "arm64"
env:
BUILD_COMMIT: ${{ inputs.build-commit }}
PLAT: ${{ matrix.platform }}
MB_PYTHON_VERSION: ${{ matrix.python }}
TRAVIS_OS_NAME: "osx"
Expand All @@ -49,7 +46,7 @@ jobs:
with:
python-version: "3.x"
- name: Build Wheel
run: .github/workflows/build.sh
run: .github/workflows/wheels-build.sh
- uses: actions/upload-artifact@v3
with:
name: ${{ inputs.artifacts-name }}
Expand Down
51 changes: 18 additions & 33 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
name: Wheels

on: [push, pull_request, workflow_dispatch]
on:
push:
paths:
- ".github/workflows/wheels*.yml"
- "wheels/*"
tags:
- "*"
pull_request:
paths:
- ".github/workflows/wheels*.yml"
- "wheels/*"
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -10,46 +24,17 @@ jobs:
macos:
uses: ./.github/workflows/wheels-macos.yml
with:
build-commit: "HEAD"
artifacts-name: "wheels"

linux:
uses: ./.github/workflows/wheels-linux.yml
with:
build-commit: "HEAD"
artifacts-name: "wheels"

macos-latest:
if: "!startsWith(github.ref, 'refs/tags/')"
uses: ./.github/workflows/wheels-macos.yml
with:
build-commit: "main"
artifacts-name: "wheels-latest"

linux-latest:
if: "!startsWith(github.ref, 'refs/tags/')"
uses: ./.github/workflows/wheels-linux.yml
with:
build-commit: "main"
artifacts-name: "wheels-latest"

release:
name: Create Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [macos, linux]
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
- name: Upload Release
uses: fnkr/[email protected]
env:
GHR_PATH: .
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

success:
needs: [macos, linux, macos-latest, linux-latest]
permissions:
contents: none
needs: [macos, linux]
runs-on: ubuntu-latest
name: Wheels Successful
steps:
Expand Down
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
if: tag IS present

env:
global:
- REPO_DIR=Pillow
- BUILD_COMMIT=HEAD
- CONFIG_PATH=wheels/config.sh
- REPO_DIR=.
- PLAT=aarch64
- TEST_DEPENDS="pytest-timeout"
- TEST_DEPENDS=pytest-timeout

language: python
# Default Python version is usually 3.6
Expand Down Expand Up @@ -110,13 +112,11 @@ jobs:
- MB_PYTHON_VERSION=3.12

before_install:
- source multibuild/common_utils.sh
- source multibuild/travis_steps.sh
- source wheels/multibuild/common_utils.sh
- source wheels/multibuild/travis_steps.sh
- before_install

install:
# Maybe get and clean and patch source
- clean_code
- build_multilinux aarch64 build_wheel
- ls -l "${TRAVIS_BUILD_DIR}/${WHEEL_SDIR}/"

Expand All @@ -130,6 +130,6 @@ deploy:
file_glob: true
file: "${TRAVIS_BUILD_DIR}/${WHEEL_SDIR}/*.whl"
on:
repo: python-pillow/pillow-wheels
repo: python-pillow/Pillow
tags: true
skip_cleanup: true
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ global-exclude .git*
global-exclude *.pyc
global-exclude *.so
prune .ci
prune wheels
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ As of 2019, Pillow development is
<a href="https://ci.appveyor.com/project/python-pillow/Pillow"><img
alt="AppVeyor CI build status (Windows)"
src="https://img.shields.io/appveyor/build/python-pillow/Pillow/main.svg?label=Windows%20build"></a>
<a href="https://github.com/python-pillow/pillow-wheels/actions"><img
alt="GitHub Actions wheels build status (Wheels)"
src="https://github.com/python-pillow/pillow-wheels/workflows/Wheels/badge.svg"></a>
<a href="https://app.travis-ci.com/github/python-pillow/pillow-wheels"><img
<a href="https://github.com/python-pillow/Pillow/actions/workflows/wheels.yml"><img
alt="GitHub Actions build status (Wheels)"
src="https://github.com/python-pillow/Pillow/workflows/Wheels/badge.svg"></a>
<a href="https://app.travis-ci.com/github/python-pillow/Pillow"><img
alt="Travis CI wheels build status (aarch64)"
src="https://img.shields.io/travis/com/python-pillow/pillow-wheels/main.svg?label=aarch64%20wheels"></a>
src="https://img.shields.io/travis/com/python-pillow/Pillow/main.svg?label=aarch64%20wheels"></a>
<a href="https://app.codecov.io/gh/python-pillow/Pillow"><img
alt="Code coverage"
src="https://codecov.io/gh/python-pillow/Pillow/branch/main/graph/badge.svg"></a>
Expand Down
17 changes: 7 additions & 10 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Released quarterly on January 2nd, April 1st, July 1st and October 15th.
* [ ] Open a release ticket e.g. https://github.com/python-pillow/Pillow/issues/3154
* [ ] Develop and prepare release in `main` branch.
* [ ] Check [GitHub Actions](https://github.com/python-pillow/Pillow/actions) and [AppVeyor](https://ci.appveyor.com/project/python-pillow/Pillow) to confirm passing tests in `main` branch.
* [ ] Check that all of the wheel builds [Pillow Wheel Builder](https://github.com/python-pillow/pillow-wheels) pass the tests in Travis CI and GitHub Actions.
* [ ] Check that all of the wheel builds pass the tests in the [GitHub Actions "Wheels" workflow](https://github.com/python-pillow/Pillow/actions/workflows/wheels.yml) and [Travis CI](https://app.travis-ci.com/github/python-pillow/pillow) jobs by manually triggering them.
* [ ] In compliance with [PEP 440](https://peps.python.org/pep-0440/), update version identifier in `src/PIL/_version.py`
* [ ] Update `CHANGES.rst`.
* [ ] Run pre-release check via `make release-test` in a freshly cloned repo.
Expand Down Expand Up @@ -99,17 +99,14 @@ Released as needed privately to individual vendors for critical security-related
## Binary Distributions

### macOS and Linux
* [ ] Use the [Pillow Wheel Builder](https://github.com/python-pillow/pillow-wheels):
```bash
git clone https://github.com/python-pillow/pillow-wheels
cd pillow-wheels
./update-pillow-tag.sh [[release tag]]
```
* [ ] Download wheels from the [Pillow Wheel Builder release](https://github.com/python-pillow/pillow-wheels/releases)
and copy into `dist/`. For example using [GitHub CLI](https://github.com/cli/cli) from the main repo:
* [ ] Download wheels from the [GitHub Actions "Wheels" workflow](https://github.com/python-pillow/Pillow/actions/workflows/wheels.yml)
and copy into `dist/`. For example using [GitHub CLI](https://github.com/cli/cli):
```bash
gh release download --dir dist --pattern "*.whl" --repo python-pillow/pillow-wheels
gh run download --dir dist
# select dist-x.y.z
```
* [ ] Download the Linux aarch64 wheels created by Travis CI from [GitHub releases](https://github.com/python-pillow/Pillow/releases)
and copy into `dist`.

### Windows
* [ ] Download the artifacts from the [GitHub Actions "Test Windows" workflow](https://github.com/python-pillow/Pillow/actions/workflows/test-windows.yml)
Expand Down
2 changes: 1 addition & 1 deletion docs/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The fork author's goal is to foster and support active development of PIL throug

.. _GitHub Actions: https://github.com/python-pillow/Pillow/actions
.. _AppVeyor: https://ci.appveyor.com/project/Python-pillow/pillow
.. _Travis CI: https://app.travis-ci.com/github/python-pillow/pillow-wheels
.. _Travis CI: https://app.travis-ci.com/github/python-pillow/Pillow
.. _GitHub: https://github.com/python-pillow/Pillow
.. _Python Package Index: https://pypi.org/project/Pillow/

Expand Down
10 changes: 5 additions & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ Pillow for enterprise is available via the Tidelift Subscription. `Learn more <h
:target: https://ci.appveyor.com/project/python-pillow/Pillow
:alt: AppVeyor CI build status (Windows)

.. image:: https://github.com/python-pillow/pillow-wheels/workflows/Wheels/badge.svg
:target: https://github.com/python-pillow/pillow-wheels/actions
:alt: GitHub Actions wheels build status (Wheels)
.. image:: https://github.com/python-pillow/Pillow/workflows/Wheels/badge.svg
:target: https://github.com/python-pillow/Pillow/actions/workflows/wheels.yml
:alt: GitHub Actions build status (Wheels)

.. image:: https://img.shields.io/travis/com/python-pillow/pillow-wheels/main.svg?label=aarch64%20wheels
:target: https://app.travis-ci.com/github/python-pillow/pillow-wheels
.. image:: https://img.shields.io/travis/com/python-pillow/Pillow/main.svg?label=aarch64%20wheels
:target: https://app.travis-ci.com/github/python-pillow/Pillow
:alt: Travis CI wheels build status (aarch64)

.. image:: https://codecov.io/gh/python-pillow/Pillow/branch/main/graph/badge.svg
Expand Down
31 changes: 31 additions & 0 deletions wheels/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
README
------

This directory creates wheels for tagged versions of Pillow.

Archives
--------

https://github.com/python-pillow/pillow-depends contains archives for libraries
that will be built as part of the Pillow build.

In general, there is no need to put library archives there, because the
`multibuild` scripts will download them from their respective URLs.

But, the build will look in that repository before downloading from the
URL, so if there is a library that often fails to download, or you think might
fail to download, then download it and add it to the Git repository.

See the `pre_build` in `config.sh` and the `fetch_unpack` routine in
`multibuild/common_utils.sh` for the logic, and the build recipes in
`multibuild/library_builders.sh` for the filename to give to the downloaded
archive.

Wheels
------

Wheels are
[GitHub Actions artifacts created for tags, relevant changes or manual builds](https://github.com/python-pillow/Pillow/actions/workflows/wheels.yml).

Windows wheels are not created here. Instead, they are
[GitHub Actions artifacts created on each run of the Pillow repository](https://github.com/python-pillow/Pillow/actions/workflows/test-windows.yml?query=branch%3Amain).
55 changes: 0 additions & 55 deletions wheels/README.rst

This file was deleted.

Loading

0 comments on commit 6ac02ce

Please sign in to comment.