Skip to content

Commit

Permalink
Merge branch 'main' into emscripten
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodmane committed Aug 25, 2023
2 parents 3961227 + e8bb208 commit d0e4a2a
Show file tree
Hide file tree
Showing 54 changed files with 393 additions and 209 deletions.
2 changes: 2 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
skip: changesIncludeOnly('docs/*', '.pre-commit-config.yaml')

run_tests: &RUN_TESTS
install_cibuildwheel_script:
- python -m pip install -e ".[dev]" pytest-custom-exit-code
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
pull_request:
paths-ignore:
- 'docs/**'
- .pre-commit-config.yaml
workflow_dispatch:
# allow manual runs on branches without a PR

Expand Down
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 23.3.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.7.0
hooks:
- id: black

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.275
rev: v0.0.285
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.3.0
rev: v2.4.0
hooks:
- id: setup-cfg-fmt
args: [--include-version-classifiers, --max-py-version=3.11]
args: [--include-version-classifiers, --min-py-version=3.8, --max-py-version=3.11]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.4.1
rev: v1.5.1
hooks:
- id: mypy
name: mypy 3.8 on cibuildwheel/
Expand Down
49 changes: 26 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ What does it do?
<sup>² Windows arm64 support is experimental.</sup><br>
<sup>³ Alpine 3.14 and very briefly 3.15's default python3 [was not able to load](https://github.com/pypa/cibuildwheel/issues/934) musllinux wheels. This has been fixed; please upgrade the python package if using Alpine from before the fix.</sup><br>
<sup>⁴ Cross-compilation not supported with PyPy - to build these wheels you need to run cibuildwheel on an Apple Silicon machine.</sup><br>
<sup>⁵ CPython 3.12 is available using the [CIBW_PRERELEASE_PYTHONS](https://cibuildwheel.readthedocs.io/en/stable/options/#prerelease-pythons) option.</sup><br>
<sup>⁵ CPython 3.12 is built by default using Python RCs, starting with cibuildwheel 2.15.</sup><br>

- Builds manylinux, musllinux, macOS 10.9+, and Windows wheels for CPython and PyPy
- Works on GitHub Actions, Azure Pipelines, Travis CI, AppVeyor, CircleCI, GitLab CI, and Cirrus CI
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
- uses: actions/setup-python@v3

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.13.1
run: python -m pip install cibuildwheel==2.15.0

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
Expand Down Expand Up @@ -164,7 +164,7 @@ Here are some repos that use cibuildwheel.
| [scikit-learn][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | The machine learning library. A complex but clean config using many of cibuildwheel's features to build a large project with Cython and C++ extensions. |
| [pytorch-fairseq][] | ![github icon][] | ![apple icon][] ![linux icon][] | Facebook AI Research Sequence-to-Sequence Toolkit written in Python. |
| [NumPy][] | ![github icon][] ![travisci icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | The fundamental package for scientific computing with Python. |
| [Tornado][] | ![travisci icon][] | ![apple icon][] ![linux icon][] | Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed. |
| [Tornado][] | ![github icon][] | ![linux icon][] ![apple icon][] ![windows icon][] | Tornado is a Python web framework and asynchronous networking library. Uses stable ABI for a small C extension. |
| [Matplotlib][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | The venerable Matplotlib, a Python library with C++ portions |
| [NCNN][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | ncnn is a high-performance neural network inference framework optimized for the mobile platform |
| [Prophet][] | ![github icon][] | ![windows icon][] ![apple icon][] ![linux icon][] | Tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth. |
Expand Down Expand Up @@ -214,42 +214,45 @@ Changelog

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

### v2.13.1
### v2.15.0

_10 June 2023_
_8 August 2023_

- 🛠 Updates the prerelease CPython 3.12 version to 3.12.0b2. (#1516)
- 🛠 Adds a moving `v<major>.<minor>` tag for use in GitHub Actions workflow files. If you use this, you'll get the latest patch release within a minor version. Additionally, Dependabot won't send you PRs for patch releases. (#1517)
- 🌟 CPython 3.12 wheels are now built by default - without the CIBW_PRERELEASE_PYTHONS flag. It's time to build and upload these wheels to PyPI! This release includes CPython 3.12.0rc1, which is guaranteed to be ABI compatible with the final release. (#1565)
- Adds musllinux_1_2 support - this allows packagers to build for musl-based Linux distributions on a more recent Alpine image, and a newer musl libc. (#1561)

### v2.13.0
### v2.14.1

_28 May 2023_
_15 July 2023_

- ✨ Adds CPython 3.12 support, under the prerelease flag [CIBW_PRERELEASE_PYTHONS](https://cibuildwheel.readthedocs.io/en/stable/options/#prerelease-pythons). This version of cibuildwheel uses 3.12.0b1.
- 🛠 Updates the prerelease CPython 3.12 version to 3.12.0b4 (#1550)

While CPython is in beta, the ABI can change, so your wheels might not be compatible with the final release. For this reason, we don't recommend distributing wheels until RC1, at which point 3.12 will be available in cibuildwheel without the flag. (#1507)
### v2.14.0

- ✨ Adds the ability to pass arguments to the container engine when the container is created, using the [CIBW_CONTAINER_ENGINE](https://cibuildwheel.readthedocs.io/en/stable/options/#container-engine) option. (#1499)
_10 July 2023_

### v2.12.3
- ✨ Adds support for building PyPy 3.10 wheels. (#1525)
- 🛠 Updates the prerelease CPython 3.12 version to 3.12.0b3.
- ✨ Allow the use of the `{wheel}` placeholder in CIBW_TEST_COMMAND (#1533)
- 📚 Docs & examples updates (#1532, #1416)
- ⚠️ Removed support for running cibuildwheel in Python 3.7. Python 3.7 is EOL. However, cibuildwheel continues to build Python 3.7 wheels for the moment. (#1175)

_19 April 2023_
### v2.13.1

- 🐛 Fix an import error when running on Python 3.7. (#1479)
_10 June 2023_

### v2.12.2
- 🛠 Updates the prerelease CPython 3.12 version to 3.12.0b2. (#1516)
- 🛠 Adds a moving `v<major>.<minor>` tag for use in GitHub Actions workflow files. If you use this, you'll get the latest patch release within a minor version. Additionally, Dependabot won't send you PRs for patch releases. (#1517)

_18 April 2023_
### v2.13.0

- 🐛 Fix a bug that caused an extra empty config-setting to be passed to the backend when CIBW_BUILD_FRONTEND is set to `build`. (#1474)
- 🐛 Fix a crash that occurred when overwriting an existing wheel on Windows. (#1464)
- 🛠 Pinned version updates, including CPython 3.10.11, 3.11.3, pip 23.1 and wheel 0.40.0.
_28 May 2023_

### v2.12.1
- ✨ Adds CPython 3.12 support, under the prerelease flag [CIBW_PRERELEASE_PYTHONS](https://cibuildwheel.readthedocs.io/en/stable/options/#prerelease-pythons). This version of cibuildwheel uses 3.12.0b1.

_11 March 2023_
While CPython is in beta, the ABI can change, so your wheels might not be compatible with the final release. For this reason, we don't recommend distributing wheels until RC1, at which point 3.12 will be available in cibuildwheel without the flag. (#1507)

- 🐛 Fix a bug that prevented the use of CIBW_CONFIG_SETTINGS with the 'pip' build backend. (#1430)
- ✨ Adds the ability to pass arguments to the container engine when the container is created, using the [CIBW_CONTAINER_ENGINE](https://cibuildwheel.readthedocs.io/en/stable/options/#container-engine) option. (#1499)

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

Expand Down
6 changes: 6 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
pr:
paths:
exclude:
- docs/*
- .pre-commit-config.yaml

jobs:
- job: linux_38
timeoutInMinutes: 120
Expand Down
5 changes: 3 additions & 2 deletions bin/bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def bump_version() -> None:
print(e)
print("Failed to get previous version tag information.")

git_changes_result = subprocess.run(["git diff-index --quiet HEAD --"], shell=True)
git_changes_result = subprocess.run(["git diff-index --quiet HEAD --"], shell=True, check=False)
repo_has_uncommitted_changes = git_changes_result.returncode != 0

if repo_has_uncommitted_changes:
Expand Down Expand Up @@ -142,7 +142,8 @@ def bump_version() -> None:
"pre-commit",
"run",
"--files=docs/changelog.md",
]
],
check=False,
)

# run pre-commit to check that no errors occurred on the second run
Expand Down
10 changes: 5 additions & 5 deletions bin/make_dependency_update_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
import click


def shell(cmd, **kwargs):
return run([cmd], shell=True, **kwargs)
def shell(cmd, *, check: bool, **kwargs):
return run([cmd], shell=True, check=check, **kwargs)


def git_repo_has_changes():
unstaged_changes = shell("git diff-index --quiet HEAD --").returncode != 0
staged_changes = shell("git diff-index --quiet --cached HEAD --").returncode != 0
unstaged_changes = shell("git diff-index --quiet HEAD --", check=False).returncode != 0
staged_changes = shell("git diff-index --quiet --cached HEAD --", check=False).returncode != 0
return unstaged_changes or staged_changes


Expand Down Expand Up @@ -73,7 +73,7 @@ def main():
print("Done.")
finally:
# remove any local changes
shell("git checkout -- .")
shell("git checkout -- .", check=True)
shell(f"git checkout {previous_branch}", check=True)
shell(f"git branch -D --force {branch_name}", check=True)

Expand Down
10 changes: 5 additions & 5 deletions bin/run_example_ci_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
import click


def shell(cmd, **kwargs):
return run([cmd], shell=True, **kwargs)
def shell(cmd, *, check: bool, **kwargs):
return run([cmd], shell=True, check=check, **kwargs)


def git_repo_has_changes():
unstaged_changes = shell("git diff-index --quiet HEAD --").returncode != 0
staged_changes = shell("git diff-index --quiet --cached HEAD --").returncode != 0
unstaged_changes = shell("git diff-index --quiet HEAD --", check=False).returncode != 0
staged_changes = shell("git diff-index --quiet --cached HEAD --", check=False).returncode != 0
return unstaged_changes or staged_changes


Expand Down Expand Up @@ -163,7 +163,7 @@ def run_example_ci_configs(config_files=None):
finally:
# remove any local changes
shutil.rmtree(example_project, ignore_errors=True)
shell("git checkout -- .")
shell("git checkout -- .", check=True)
shell(f"git checkout {previous_branch}", check=True)
shell(f"git branch -D --force {branch_name}", check=True)

Expand Down
6 changes: 5 additions & 1 deletion bin/sample_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@
check=True,
)

sys.exit(subprocess.run([sys.executable, "-m", "cibuildwheel"], cwd=project_dir).returncode)
sys.exit(
subprocess.run(
[sys.executable, "-m", "cibuildwheel"], cwd=project_dir, check=False
).returncode
)
6 changes: 6 additions & 0 deletions bin/update_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ class Image:
Image("musllinux_1_1", "aarch64", "quay.io/pypa/musllinux_1_1_aarch64", None),
Image("musllinux_1_1", "ppc64le", "quay.io/pypa/musllinux_1_1_ppc64le", None),
Image("musllinux_1_1", "s390x", "quay.io/pypa/musllinux_1_1_s390x", None),
# musllinux_1_2 images
Image("musllinux_1_2", "x86_64", "quay.io/pypa/musllinux_1_2_x86_64", None),
Image("musllinux_1_2", "i686", "quay.io/pypa/musllinux_1_2_i686", None),
Image("musllinux_1_2", "aarch64", "quay.io/pypa/musllinux_1_2_aarch64", None),
Image("musllinux_1_2", "ppc64le", "quay.io/pypa/musllinux_1_2_ppc64le", None),
Image("musllinux_1_2", "s390x", "quay.io/pypa/musllinux_1_2_s390x", None),
]

config = configparser.ConfigParser()
Expand Down
2 changes: 1 addition & 1 deletion bin/update_how_it_works_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


def main():
subprocess.run(["mkdocs", "build"])
subprocess.run(["mkdocs", "build"], check=True)

hti = Html2Image(custom_flags=["--force-device-scale-factor=2"])

Expand Down
2 changes: 1 addition & 1 deletion cibuildwheel/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from __future__ import annotations

__version__ = "2.13.1"
__version__ = "2.15.0"
2 changes: 1 addition & 1 deletion cibuildwheel/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def build_in_container(
constraints_file = build_options.dependency_constraints.get_for_python_version(
config.version
)
container_constraints_file = PurePath("/constraints.txt")
container_constraints_file = PurePosixPath("/constraints.txt")

container.copy_into(constraints_file, container_constraints_file)
dependency_constraint_flags = ["-c", container_constraints_file]
Expand Down
1 change: 1 addition & 0 deletions cibuildwheel/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ def globals(self) -> GlobalOptions:
build_config = args.only
skip_config = ""
architectures = Architecture.all_archs(self.platform)
prerelease_pythons = True

build_selector = BuildSelector(
build_config=build_config,
Expand Down
12 changes: 6 additions & 6 deletions cibuildwheel/resources/build-platforms.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ python_configurations = [
{ identifier = "cp311-macosx_x86_64", version = "3.11", url = "https://www.python.org/ftp/python/3.11.4/python-3.11.4-macos11.pkg" },
{ identifier = "cp311-macosx_arm64", version = "3.11", url = "https://www.python.org/ftp/python/3.11.4/python-3.11.4-macos11.pkg" },
{ identifier = "cp311-macosx_universal2", version = "3.11", url = "https://www.python.org/ftp/python/3.11.4/python-3.11.4-macos11.pkg" },
{ identifier = "cp312-macosx_x86_64", version = "3.12", url = "https://www.python.org/ftp/python/3.12.0/python-3.12.0b3-macos11.pkg" },
{ identifier = "cp312-macosx_arm64", version = "3.12", url = "https://www.python.org/ftp/python/3.12.0/python-3.12.0b3-macos11.pkg" },
{ identifier = "cp312-macosx_universal2", version = "3.12", url = "https://www.python.org/ftp/python/3.12.0/python-3.12.0b3-macos11.pkg" },
{ identifier = "cp312-macosx_x86_64", version = "3.12", url = "https://www.python.org/ftp/python/3.12.0/python-3.12.0rc1-macos11.pkg" },
{ identifier = "cp312-macosx_arm64", version = "3.12", url = "https://www.python.org/ftp/python/3.12.0/python-3.12.0rc1-macos11.pkg" },
{ identifier = "cp312-macosx_universal2", version = "3.12", url = "https://www.python.org/ftp/python/3.12.0/python-3.12.0rc1-macos11.pkg" },
{ identifier = "pp37-macosx_x86_64", version = "3.7", url = "https://downloads.python.org/pypy/pypy3.7-v7.3.9-osx64.tar.bz2" },
{ identifier = "pp38-macosx_x86_64", version = "3.8", url = "https://downloads.python.org/pypy/pypy3.8-v7.3.11-macos_x86_64.tar.bz2" },
{ identifier = "pp38-macosx_arm64", version = "3.8", url = "https://downloads.python.org/pypy/pypy3.8-v7.3.11-macos_arm64.tar.bz2" },
Expand All @@ -126,12 +126,12 @@ python_configurations = [
{ identifier = "cp310-win_amd64", version = "3.10.11", arch = "64" },
{ identifier = "cp311-win32", version = "3.11.4", arch = "32" },
{ identifier = "cp311-win_amd64", version = "3.11.4", arch = "64" },
{ identifier = "cp312-win32", version = "3.12.0-b3", arch = "32" },
{ identifier = "cp312-win_amd64", version = "3.12.0-b3", arch = "64" },
{ identifier = "cp312-win32", version = "3.12.0-rc1", arch = "32" },
{ identifier = "cp312-win_amd64", version = "3.12.0-rc1", arch = "64" },
{ identifier = "cp39-win_arm64", version = "3.9.10", arch = "ARM64" },
{ identifier = "cp310-win_arm64", version = "3.10.11", arch = "ARM64" },
{ identifier = "cp311-win_arm64", version = "3.11.4", arch = "ARM64" },
{ identifier = "cp312-win_arm64", version = "3.12.0-b3", arch = "ARM64" },
{ identifier = "cp312-win_arm64", version = "3.12.0-rc1", arch = "ARM64" },
{ identifier = "pp37-win_amd64", version = "3.7", arch = "64", url = "https://downloads.python.org/pypy/pypy3.7-v7.3.9-win64.zip" },
{ identifier = "pp38-win_amd64", version = "3.8", arch = "64", url = "https://downloads.python.org/pypy/pypy3.8-v7.3.11-win64.zip" },
{ identifier = "pp39-win_amd64", version = "3.9", arch = "64", url = "https://downloads.python.org/pypy/pypy3.9-v7.3.12-win64.zip" },
Expand Down
12 changes: 6 additions & 6 deletions cibuildwheel/resources/constraints-python310.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
#
delocate==0.10.4
# via -r cibuildwheel/resources/constraints.in
distlib==0.3.6
distlib==0.3.7
# via virtualenv
filelock==3.12.2
# via virtualenv
packaging==23.1
# via delocate
platformdirs==3.8.0
platformdirs==3.10.0
# via virtualenv
typing-extensions==4.7.1
# via delocate
virtualenv==20.23.1
virtualenv==20.24.3
# via -r cibuildwheel/resources/constraints.in
wheel==0.40.0
wheel==0.41.1
# via -r cibuildwheel/resources/constraints.in

# The following packages are considered to be unsafe in a requirements file:
pip==23.1.2
pip==23.2.1
# via -r cibuildwheel/resources/constraints.in
setuptools==68.0.0
setuptools==68.1.2
# via -r cibuildwheel/resources/constraints.in
12 changes: 6 additions & 6 deletions cibuildwheel/resources/constraints-python311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
#
delocate==0.10.4
# via -r cibuildwheel/resources/constraints.in
distlib==0.3.6
distlib==0.3.7
# via virtualenv
filelock==3.12.2
# via virtualenv
packaging==23.1
# via delocate
platformdirs==3.8.0
platformdirs==3.10.0
# via virtualenv
typing-extensions==4.7.1
# via delocate
virtualenv==20.23.1
virtualenv==20.24.3
# via -r cibuildwheel/resources/constraints.in
wheel==0.40.0
wheel==0.41.1
# via -r cibuildwheel/resources/constraints.in

# The following packages are considered to be unsafe in a requirements file:
pip==23.1.2
pip==23.2.1
# via -r cibuildwheel/resources/constraints.in
setuptools==68.0.0
setuptools==68.1.2
# via -r cibuildwheel/resources/constraints.in
12 changes: 6 additions & 6 deletions cibuildwheel/resources/constraints-python312.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
#
delocate==0.10.4
# via -r cibuildwheel/resources/constraints.in
distlib==0.3.6
distlib==0.3.7
# via virtualenv
filelock==3.12.2
# via virtualenv
packaging==23.1
# via delocate
platformdirs==3.8.0
platformdirs==3.10.0
# via virtualenv
typing-extensions==4.7.1
# via delocate
virtualenv==20.23.1
virtualenv==20.24.3
# via -r cibuildwheel/resources/constraints.in
wheel==0.40.0
wheel==0.41.1
# via -r cibuildwheel/resources/constraints.in

# The following packages are considered to be unsafe in a requirements file:
pip==23.1.2
pip==23.2.1
# via -r cibuildwheel/resources/constraints.in
setuptools==68.0.0
setuptools==68.1.2
# via -r cibuildwheel/resources/constraints.in
Loading

0 comments on commit d0e4a2a

Please sign in to comment.