Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into fmtpass-alt
Browse files Browse the repository at this point in the history
  • Loading branch information
joerick committed Nov 14, 2021
2 parents f4b14d3 + 2710202 commit 69d2854
Show file tree
Hide file tree
Showing 47 changed files with 453 additions and 301 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on:
workflow_dispatch:
pull_request:
release:
types:
- published

jobs:
dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Build SDist and wheel
run: pipx run build

- uses: actions/upload-artifact@v2
with:
path: dist/*

- name: Check metadata
run: pipx run twine check dist/*

publish:
needs: [dist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'

steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.pypi_password }}
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.3
- run: pipx run nox -s check_manifest

test:
name: Test cibuildwheel on ${{ matrix.os }}
Expand Down
15 changes: 9 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ repos:

# Autoremoves unused imports
- repo: https://github.com/hadialqattan/pycln
rev: v1.0.3
rev: v1.1.0
hooks:
- id: pycln
args: [--config=pyproject.toml]

- repo: https://github.com/PyCQA/isort
rev: 5.9.3
rev: 5.10.0
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 21.9b0
rev: 21.10b0
hooks:
- id: black

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.18.0
rev: v1.19.0
hooks:
- id: setup-cfg-fmt

Expand All @@ -54,7 +54,9 @@ repos:
exclude: ^(bin|cibuildwheel/resources|docs)/.*py$
args: ["--python-version=3.6", "--scripts-are-modules", "--show-error-codes"]
additional_dependencies: &mypy-dependencies
- nox
- packaging>=21.0
- pygithub
- rich
- tomli
- types-certifi
Expand All @@ -63,14 +65,15 @@ repos:
- types-jinja2
- types-pyyaml
- types-requests
- bracex
- id: mypy
name: mypy 3.7+ on bin/
files: ^((bin|docs)/.*py|noxfile.py)$
files: ^((bin|docs)/.*py)$
args: ["--python-version=3.7", "--scripts-are-modules", "--show-error-codes"]
additional_dependencies: *mypy-dependencies

- repo: https://github.com/asottile/yesqa
rev: v1.2.3
rev: v1.3.0
hooks:
- id: yesqa
additional_dependencies: &flake8-dependencies
Expand Down
6 changes: 6 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
recursive-include cibuildwheel *.cfg
recursive-include cibuildwheel *.in
recursive-include cibuildwheel *.py
recursive-include cibuildwheel *.toml
recursive-include cibuildwheel *.txt
recursive-include cibuildwheel *.typed
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
- uses: actions/setup-python@v2

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.2.0b1
run: python -m pip install cibuildwheel==2.2.2

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
Expand Down Expand Up @@ -189,24 +189,39 @@ Changelog

<!-- this section was generated by bin/update_readme_changelog.py -- do not edit manually -->

### v2.2.0 (prerelease)
### v2.2.2

_Currently in prerelease. The below release notes will be condensed into a single entry on final release._
_26 October 2021_

_v2.2.0b1 (19 October 2021)_
- 🐛 Fix bug in the GitHub Action step causing a syntax error (#895)

- 🌟 TOML option overrides. This provides much greater flexibility in configuration via pyproject.toml.
### v2.2.1

You can now set build options for any subset of your builds using a match pattern. So, for example, you can customise CPython 3.8 builds with an override on `cp38-*` or musllinux builds by selecting `*musllinux*`. Check out [the docs](https://cibuildwheel.readthedocs.io/en/latest/options/#overrides) for more info on the specifics.
_26 October 2021_

- 🛠 Added a `config-file` option on the GitHub Action to specify something other than pyproject.toml in your GitHub Workflow file. (#883)
- 🐛 Fix missing resources in sdist and released wheel on PyPI. We've also made some internal changes to our release processes to make them more reliable. (#893, #894)

### v2.2.0

_22 October 2021_

- 🌟 Added support for [musllinux](https://www.python.org/dev/peps/pep-0656/). Support for this new wheel format lets projects build wheels for Linux distributions that use [musl libc](https://musl.libc.org/), notably, [Alpine](https://alpinelinux.org/) Docker containers. (#768)

_v2.2.0a1 (23 September 2021)_
Musllinux builds are enabled by default. If you're not ready to build musllinux, add `*-musllinux_*` to your [`CIBW_SKIP`/`skip`](https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip) option. Or, you might have to make some changes to your options - to simplify that process, you can use...

- 🌟 Added support for [musllinux](https://www.python.org/dev/peps/pep-0656/). Support for this new wheel format lets projects build wheels for Linux distributions that use [musl libc](https://musl.libc.org/), notably, [Alpine](https://alpinelinux.org/) Docker containers.
- 🌟 TOML option overrides! This provides much greater flexibility in configuration via pyproject.toml. (#854)

You can now set build options for any subset of your builds using a match pattern. So, for example, you can customise CPython 3.8 builds with an override on `cp38-*` or musllinux builds by selecting `*musllinux*`. Check out [the docs](https://cibuildwheel.readthedocs.io/en/latest/options/#overrides) for more info on the specifics.

- 🛠 Added support for building PyPy wheels on macOS 11 CI runners. (#875)

Musllinux builds are enabled by default. To disable them on your project, add `*-musllinux_*` to your [`CIBW_SKIP`/`skip`](https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip)
option. (#768)
- 🛠 Setting an empty string for the [`CIBW_*_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image) option will now fallthrough to the config file or cibuildwheel's default, rather than causing an error. This makes the option easier to use in CI build matricies. (#829)

- 🛠 Support for TOML 1.0 when reading config files, via the `tomli` package. (#876)

<sup>Note: This version is not available on PyPI due to some missing resources in the release files. Please use a later version instead.</sup>

### v2.1.3

_6 October 2021_
Expand All @@ -221,21 +236,6 @@ _14 September 2021_
- 📚 Multiple docs updates
- 🐛 Improved warnings when built binaries are bundled into the container on Linux. (#807)

### v2.1.1

_7 August 2021_

- ✨ Corresponding with the release of CPython 3.10.0rc1, which is ABI stable, cibuildwheel now builds CPython 3.10 by default - without the CIBW_PRERELEASE_PYTHONS flag.

<sup>Note: v2.1.0 was a bad release, it was yanked from PyPI.</sup>

### v2.0.1

_25 July 2021_

- 📚 Docs improvements (#767)
- 🛠 Dependency updates, including delocate 0.9.0.

<!-- END bin/update_readme_changelog.py -->

---
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ inputs:
description: 'Folder to place the outputs in, defaults to "wheelhouse"'
required: false
default: wheelhouse
config-file:
description: 'File containing the config, defaults to {package}/pyproject.toml'
required: false
default: ''
branding:
icon: package
color: yellow
Expand All @@ -24,5 +28,6 @@ runs:
cibuildwheel
${{ inputs.package-dir }}
--output-dir ${{ inputs.output-dir }}
--config-file "${{ inputs.config-file }}"
2>&1
shell: bash
2 changes: 1 addition & 1 deletion bin/inspect_all_known_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import click
import yaml
from ghapi.core import GhApi, HTTP404NotFoundError # type: ignore[import]
from ghapi.core import GhApi, HTTP404NotFoundError
from rich import print

from cibuildwheel.projectfiles import Analyzer
Expand Down
2 changes: 1 addition & 1 deletion cibuildwheel/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.2.0b1"
__version__ = "2.2.2"
9 changes: 5 additions & 4 deletions cibuildwheel/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,15 @@ def main() -> None:

parser.add_argument(
"--output-dir",
help="Destination folder for the wheels.",
help="Destination folder for the wheels. Default: wheelhouse.",
)

parser.add_argument(
"--config-file",
default="",
help="""
TOML config file for cibuildwheel. Defaults to pyproject.toml, but
can be overridden with this option.
TOML config file. Default: "", meaning {package}/pyproject.toml,
if it exists.
""",
)

Expand Down Expand Up @@ -162,7 +163,7 @@ def main() -> None:
os.environ["CIBUILDWHEEL"] = "1"

# Python is buffering by default when running on the CI platforms, giving problems interleaving subprocess call output with unflushed calls to 'print'
sys.stdout = Unbuffered(sys.stdout) # type: ignore[no-untyped-call,assignment]
sys.stdout = Unbuffered(sys.stdout) # type: ignore[assignment]

print_preamble(platform=platform, options=options, identifiers=identifiers)

Expand Down
7 changes: 3 additions & 4 deletions cibuildwheel/linux.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import subprocess
import sys
import textwrap
from collections import OrderedDict
from pathlib import Path, PurePath
from typing import Iterator, List, NamedTuple, Set
from typing import Iterator, List, NamedTuple, Set, Tuple

from .architecture import Architecture
from .docker_container import DockerContainer
from .logger import log
from .options import Options
from .typing import PathOrStr, assert_never
from .typing import OrderedDict, PathOrStr, assert_never
from .util import (
BuildSelector,
NonPlatformWheelError,
Expand Down Expand Up @@ -80,7 +79,7 @@ def get_build_steps(
Groups PythonConfigurations into BuildSteps. Each BuildStep represents a
separate Docker container.
"""
steps: OrderedDict[tuple, BuildStep] = OrderedDict() # type: ignore[type-arg]
steps = OrderedDict[Tuple[str, str, str], BuildStep]()

for config in python_configurations:
_, platform_tag = config.identifier.split("-", 1)
Expand Down
5 changes: 3 additions & 2 deletions cibuildwheel/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CommandLineArguments:
platform: Literal["auto", "linux", "macos", "windows"]
archs: Optional[str]
output_dir: Optional[str]
config_file: Optional[str]
config_file: str
package_dir: str
print_build_identifiers: bool
allow_empty: bool
Expand Down Expand Up @@ -335,8 +335,9 @@ def __init__(self, platform: PlatformName, command_line_arguments: CommandLineAr
def config_file_path(self) -> Optional[Path]:
args = self.command_line_arguments

if args.config_file is not None:
if args.config_file:
return Path(args.config_file.format(package=args.package_dir))

# return pyproject.toml, if it's available
pyproject_toml_path = Path(args.package_dir) / "pyproject.toml"
if pyproject_toml_path.exists():
Expand Down
25 changes: 15 additions & 10 deletions cibuildwheel/resources/build-platforms.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ python_configurations = [
{ identifier = "cp39-manylinux_i686", version = "3.9", path_str = "/opt/python/cp39-cp39" },
{ identifier = "cp310-manylinux_i686", version = "3.10", path_str = "/opt/python/cp310-cp310" },
{ identifier = "pp37-manylinux_x86_64", version = "3.7", path_str = "/opt/python/pp37-pypy37_pp73" },
{ identifier = "pp38-manylinux_x86_64", version = "3.8", path_str = "/opt/python/pp38-pypy38_pp73" },
{ identifier = "cp36-manylinux_aarch64", version = "3.6", path_str = "/opt/python/cp36-cp36m" },
{ identifier = "cp37-manylinux_aarch64", version = "3.7", path_str = "/opt/python/cp37-cp37m" },
{ identifier = "cp38-manylinux_aarch64", version = "3.8", path_str = "/opt/python/cp38-cp38" },
Expand All @@ -27,7 +28,9 @@ python_configurations = [
{ identifier = "cp39-manylinux_s390x", version = "3.9", path_str = "/opt/python/cp39-cp39" },
{ identifier = "cp310-manylinux_s390x", version = "3.10", path_str = "/opt/python/cp310-cp310" },
{ identifier = "pp37-manylinux_aarch64", version = "3.7", path_str = "/opt/python/pp37-pypy37_pp73" },
{ identifier = "pp38-manylinux_aarch64", version = "3.8", path_str = "/opt/python/pp38-pypy38_pp73" },
{ identifier = "pp37-manylinux_i686", version = "3.7", path_str = "/opt/python/pp37-pypy37_pp73" },
{ identifier = "pp38-manylinux_i686", version = "3.8", path_str = "/opt/python/pp38-pypy38_pp73" },
{ identifier = "cp36-musllinux_x86_64", version = "3.6", path_str = "/opt/python/cp36-cp36m" },
{ identifier = "cp37-musllinux_x86_64", version = "3.7", path_str = "/opt/python/cp37-cp37m" },
{ identifier = "cp38-musllinux_x86_64", version = "3.8", path_str = "/opt/python/cp38-cp38" },
Expand Down Expand Up @@ -62,13 +65,14 @@ python_configurations = [
{ identifier = "cp38-macosx_x86_64", version = "3.8", url = "https://www.python.org/ftp/python/3.8.10/python-3.8.10-macosx10.9.pkg" },
{ identifier = "cp38-macosx_arm64", version = "3.8", url = "https://www.python.org/ftp/python/3.8.10/python-3.8.10-macosx10.9.pkg" },
{ identifier = "cp38-macosx_universal2", version = "3.8", url = "https://www.python.org/ftp/python/3.8.10/python-3.8.10-macosx10.9.pkg" },
{ identifier = "cp39-macosx_x86_64", version = "3.9", url = "https://www.python.org/ftp/python/3.9.7/python-3.9.7-macos11.pkg" },
{ identifier = "cp39-macosx_arm64", version = "3.9", url = "https://www.python.org/ftp/python/3.9.7/python-3.9.7-macos11.pkg" },
{ identifier = "cp39-macosx_universal2", version = "3.9", url = "https://www.python.org/ftp/python/3.9.7/python-3.9.7-macos11.pkg" },
{ identifier = "cp310-macosx_x86_64", version = "3.10", url = "https://www.python.org/ftp/python/3.10.0/python-3.10.0-macos11.pkg" },
{ identifier = "cp310-macosx_arm64", version = "3.10", url = "https://www.python.org/ftp/python/3.10.0/python-3.10.0-macos11.pkg" },
{ identifier = "cp310-macosx_universal2", version = "3.10", url = "https://www.python.org/ftp/python/3.10.0/python-3.10.0-macos11.pkg" },
{ identifier = "pp37-macosx_x86_64", version = "3.7", url = "https://downloads.python.org/pypy/pypy3.7-v7.3.5-osx64.tar.bz2" },
{ identifier = "cp39-macosx_x86_64", version = "3.9", url = "https://www.python.org/ftp/python/3.9.8/python-3.9.8-macos11.pkg" },
{ identifier = "cp39-macosx_arm64", version = "3.9", url = "https://www.python.org/ftp/python/3.9.8/python-3.9.8-macos11.pkg" },
{ identifier = "cp39-macosx_universal2", version = "3.9", url = "https://www.python.org/ftp/python/3.9.8/python-3.9.8-macos11.pkg" },
{ identifier = "cp310-macosx_x86_64", version = "3.10", url = "https://www.python.org/ftp/python/3.10.0/python-3.10.0post2-macos11.pkg" },
{ identifier = "cp310-macosx_arm64", version = "3.10", url = "https://www.python.org/ftp/python/3.10.0/python-3.10.0post2-macos11.pkg" },
{ identifier = "cp310-macosx_universal2", version = "3.10", url = "https://www.python.org/ftp/python/3.10.0/python-3.10.0post2-macos11.pkg" },
{ identifier = "pp37-macosx_x86_64", version = "3.7", url = "https://downloads.python.org/pypy/pypy3.7-v7.3.7-osx64.tar.bz2" },
{ identifier = "pp38-macosx_x86_64", version = "3.8", url = "https://downloads.python.org/pypy/pypy3.8-v7.3.7-osx64.tar.bz2" },
]

[windows]
Expand All @@ -79,9 +83,10 @@ python_configurations = [
{ identifier = "cp37-win_amd64", version = "3.7.9", arch = "64" },
{ identifier = "cp38-win32", version = "3.8.10", arch = "32" },
{ identifier = "cp38-win_amd64", version = "3.8.10", arch = "64" },
{ identifier = "cp39-win32", version = "3.9.7", arch = "32" },
{ identifier = "cp39-win_amd64", version = "3.9.7", arch = "64" },
{ identifier = "cp39-win32", version = "3.9.8", arch = "32" },
{ identifier = "cp39-win_amd64", version = "3.9.8", arch = "64" },
{ identifier = "cp310-win32", version = "3.10.0", arch = "32" },
{ identifier = "cp310-win_amd64", version = "3.10.0", arch = "64" },
{ identifier = "pp37-win_amd64", version = "3.7", arch = "64", url = "https://downloads.python.org/pypy/pypy3.7-v7.3.5-win64.zip" },
{ identifier = "pp37-win_amd64", version = "3.7", arch = "64", url = "https://downloads.python.org/pypy/pypy3.7-v7.3.7-win64.zip" },
{ identifier = "pp38-win_amd64", version = "3.8", arch = "64", url = "https://downloads.python.org/pypy/pypy3.8-v7.3.7-win64.zip" },
]
14 changes: 7 additions & 7 deletions cibuildwheel/resources/constraints-python36.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
#
# bin/update_dependencies.py
#
backports.entry-points-selectable==1.1.0
backports.entry-points-selectable==1.1.1
# via virtualenv
delocate==0.10.0
# via -r cibuildwheel/resources/constraints.in
distlib==0.3.3
# via virtualenv
filelock==3.3.0
filelock==3.3.2
# via virtualenv
importlib-metadata==4.8.1
importlib-metadata==4.8.2
# via
# backports.entry-points-selectable
# virtualenv
importlib-resources==5.2.2
importlib-resources==5.4.0
# via virtualenv
platformdirs==2.4.0
# via virtualenv
Expand All @@ -26,7 +26,7 @@ typing-extensions==3.10.0.2
# via
# delocate
# importlib-metadata
virtualenv==20.8.1
virtualenv==20.10.0
# via -r cibuildwheel/resources/constraints.in
wheel==0.37.0
# via
Expand All @@ -38,7 +38,7 @@ zipp==3.6.0
# importlib-resources

# The following packages are considered to be unsafe in a requirements file:
pip==21.2.4
pip==21.3.1
# via -r cibuildwheel/resources/constraints.in
setuptools==58.2.0
setuptools==58.5.3
# via -r cibuildwheel/resources/constraints.in
Loading

0 comments on commit 69d2854

Please sign in to comment.