forked from pypa/cibuildwheel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testing files: ['examples/circleci-minimal.yml', 'examples/appveyor-minimal.yml', 'examples/azure-pipelines-minimal.yml', 'examples/github-minimal.yml', 'examples/gitlab-minimal.yml', 'examples/travis-ci-minimal.yml', 'examples/cirrus-ci-minimal.yml'] Generated from branch: cn Time: 2023-11-07T08-25-36
- Loading branch information
0 parents
commit 5774e53
Showing
10 changed files
with
332 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
version: 2 | ||
|
||
jobs: | ||
linux-wheels: | ||
working_directory: ~/linux-wheels | ||
docker: | ||
- image: circleci/python:3.9 | ||
steps: | ||
- checkout | ||
- setup_remote_docker | ||
- run: | ||
name: Build the Linux wheels. | ||
command: | | ||
pip3 install --user cibuildwheel==2.16.2 | ||
cibuildwheel --output-dir wheelhouse | ||
- store_artifacts: | ||
path: wheelhouse/ | ||
|
||
linux-aarch64-wheels: | ||
working_directory: ~/linux-aarch64-wheels | ||
machine: | ||
image: ubuntu-2004:2022.04.1 | ||
# resource_class is what tells CircleCI to use an ARM worker for native arm builds | ||
# https://circleci.com/product/features/resource-classes/ | ||
resource_class: arm.medium | ||
steps: | ||
- checkout | ||
- run: | ||
name: Build the Linux aarch64 wheels. | ||
command: | | ||
python3 -m pip install --user cibuildwheel==2.16.2 | ||
python3 -m cibuildwheel --output-dir wheelhouse | ||
- store_artifacts: | ||
path: wheelhouse/ | ||
|
||
osx-wheels: | ||
working_directory: ~/osx-wheels | ||
macos: | ||
xcode: 12.5.1 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Build the OS X wheels. | ||
command: | | ||
pip3 install cibuildwheel==2.16.2 | ||
cibuildwheel --output-dir wheelhouse | ||
- store_artifacts: | ||
path: wheelhouse/ | ||
|
||
workflows: | ||
version: 2 | ||
all-tests: | ||
jobs: | ||
- linux-wheels | ||
- linux-aarch64-wheels | ||
- osx-wheels |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
build_and_store_wheels: &BUILD_AND_STORE_WHEELS | ||
install_cibuildwheel_script: | ||
- python -m pip install cibuildwheel==2.16.2 | ||
run_cibuildwheel_script: | ||
- cibuildwheel | ||
wheels_artifacts: | ||
path: "wheelhouse/*" | ||
|
||
|
||
linux_x86_task: | ||
name: Build Linux x86 wheels. | ||
compute_engine_instance: | ||
image_project: cirrus-images | ||
image: family/docker-builder | ||
platform: linux | ||
cpu: 4 | ||
memory: 4G | ||
|
||
install_pre_requirements_script: | ||
- apt install -y python3-venv python-is-python3 | ||
<<: *BUILD_AND_STORE_WHEELS | ||
|
||
linux_aarch64_task: | ||
name: Build Linux aarch64 wheels. | ||
compute_engine_instance: | ||
image_project: cirrus-images | ||
image: family/docker-builder-arm64 | ||
architecture: arm64 | ||
platform: linux | ||
cpu: 4 | ||
memory: 4G | ||
|
||
install_pre_requirements_script: | ||
- apt install -y python3-venv python-is-python3 | ||
<<: *BUILD_AND_STORE_WHEELS | ||
|
||
windows_x86_task: | ||
name: Build Windows x86 wheels. | ||
windows_container: | ||
image: cirrusci/windowsservercore:visualstudio2022 | ||
cpu: 4 | ||
memory: 4G | ||
|
||
install_pre_requirements_script: | ||
- choco install -y --no-progress python3 --version 3.10.6 | ||
- refreshenv | ||
- echo PATH=%PATH% >> "%CIRRUS_ENV%" | ||
<<: *BUILD_AND_STORE_WHEELS | ||
|
||
macos_arm64_task: | ||
name: Build macOS arm64 wheels. | ||
macos_instance: | ||
image: ghcr.io/cirruslabs/macos-monterey-xcode | ||
|
||
env: | ||
PATH: /opt/homebrew/opt/python@3.10/bin:$PATH | ||
install_pre_requirements_script: | ||
- brew install python@3.10 | ||
- ln -s python3 /opt/homebrew/opt/python@3.10/bin/python | ||
<<: *BUILD_AND_STORE_WHEELS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Build | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, windows-2019, macos-11] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Build wheels | ||
uses: pypa/cibuildwheel@v2.16.2 | ||
# env: | ||
# CIBW_SOME_OPTION: value | ||
# ... | ||
# with: | ||
# package-dir: . | ||
# output-dir: wheelhouse | ||
# config-file: "{package}/pyproject.toml" | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./wheelhouse/*.whl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
linux: | ||
image: python:3.8 | ||
# make a docker daemon available for cibuildwheel to use | ||
services: | ||
- name: docker:dind | ||
entrypoint: ["env", "-u", "DOCKER_HOST"] | ||
command: ["dockerd-entrypoint.sh"] | ||
variables: | ||
DOCKER_HOST: tcp://docker:2375/ | ||
DOCKER_DRIVER: overlay2 | ||
# See https://github.com/docker-library/docker/pull/166 | ||
DOCKER_TLS_CERTDIR: "" | ||
script: | ||
- curl -sSL https://get.docker.com/ | sh | ||
- python -m pip install cibuildwheel==2.16.2 | ||
- cibuildwheel --output-dir wheelhouse | ||
artifacts: | ||
paths: | ||
- wheelhouse/ | ||
|
||
windows: | ||
image: mcr.microsoft.com/windows/servercore:1809 | ||
before_script: | ||
- choco install python -y --version 3.8.6 | ||
- choco install git.install -y | ||
- py -m pip install cibuildwheel==2.16.2 | ||
script: | ||
- py -m cibuildwheel --output-dir wheelhouse --platform windows | ||
artifacts: | ||
paths: | ||
- wheelhouse/ | ||
tags: | ||
- windows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
os: linux | ||
dist: focal | ||
language: python | ||
python: "3.9" | ||
|
||
jobs: | ||
include: | ||
# perform a linux build | ||
- services: docker | ||
# perform a linux ARMv8 build | ||
- services: docker | ||
arch: arm64 | ||
# perform a linux PPC64LE build | ||
- services: docker | ||
arch: ppc64le | ||
# perform a linux S390X build | ||
- services: docker | ||
arch: s390x | ||
# and a windows build | ||
- os: windows | ||
language: shell | ||
before_install: | ||
- choco upgrade python -y --version 3.8.6 | ||
- export PATH="/c/Python38:/c/Python38/Scripts:$PATH" | ||
# make sure it's on PATH as 'python3' | ||
- ln -s /c/Python38/python.exe /c/Python38/python3.exe | ||
|
||
install: | ||
- python3 -m pip install cibuildwheel==2.16.2 | ||
|
||
script: | ||
# build the wheels, put them into './wheelhouse' | ||
- python3 -m cibuildwheel --output-dir wheelhouse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
environment: | ||
matrix: | ||
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu | ||
APPVEYOR_JOB_NAME: "python37-x64-ubuntu" | ||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 | ||
APPVEYOR_JOB_NAME: "python37-x64-vs2015" | ||
- APPVEYOR_BUILD_WORKER_IMAGE: macos | ||
APPVEYOR_JOB_NAME: "python37-x64-macos" | ||
|
||
stack: python 3.7 | ||
|
||
init: | ||
- cmd: set PATH=C:\Python37;C:\Python37\Scripts;%PATH% | ||
|
||
install: python -m pip install cibuildwheel==2.16.2 | ||
|
||
build_script: python -m cibuildwheel --output-dir wheelhouse | ||
|
||
artifacts: | ||
- path: "wheelhouse\\*.whl" | ||
name: Wheels |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
jobs: | ||
- job: linux | ||
pool: {vmImage: 'Ubuntu-20.04'} | ||
steps: | ||
- task: UsePythonVersion@0 | ||
- bash: | | ||
set -o errexit | ||
python3 -m pip install --upgrade pip | ||
pip3 install cibuildwheel==2.16.2 | ||
displayName: Install dependencies | ||
- bash: cibuildwheel --output-dir wheelhouse . | ||
displayName: Build wheels | ||
- task: PublishBuildArtifacts@1 | ||
inputs: {pathtoPublish: 'wheelhouse'} | ||
|
||
- job: macos | ||
pool: {vmImage: 'macOS-11'} | ||
steps: | ||
- task: UsePythonVersion@0 | ||
- bash: | | ||
set -o errexit | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install cibuildwheel==2.16.2 | ||
displayName: Install dependencies | ||
- bash: cibuildwheel --output-dir wheelhouse . | ||
displayName: Build wheels | ||
- task: PublishBuildArtifacts@1 | ||
inputs: {pathtoPublish: wheelhouse} | ||
|
||
- job: windows | ||
pool: {vmImage: 'windows-2019'} | ||
steps: | ||
- task: UsePythonVersion@0 | ||
- bash: | | ||
set -o errexit | ||
python -m pip install --upgrade pip | ||
pip install cibuildwheel==2.16.2 | ||
displayName: Install dependencies | ||
- bash: cibuildwheel --output-dir wheelhouse . | ||
displayName: Build wheels | ||
- task: PublishBuildArtifacts@1 | ||
inputs: {pathtoPublish: 'wheelhouse'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
[metadata] | ||
name = spam | ||
version = 0.1.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
import sys | ||
from setuptools import setup, Extension | ||
|
||
|
||
|
||
libraries = [] | ||
if sys.platform.startswith('linux'): | ||
libraries.extend(['m', 'c']) | ||
|
||
setup( | ||
ext_modules=[Extension( | ||
'spam', | ||
sources=['spam.c'], | ||
libraries=libraries, | ||
|
||
)], | ||
|
||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
#include <Python.h> | ||
|
||
|
||
|
||
static PyObject * | ||
spam_system(PyObject *self, PyObject *args) | ||
{ | ||
const char *command; | ||
int sts; | ||
|
||
if (!PyArg_ParseTuple(args, "s", &command)) | ||
return NULL; | ||
|
||
sts = system(command); | ||
|
||
|
||
|
||
return PyLong_FromLong(sts); | ||
} | ||
|
||
/* Module initialization */ | ||
static PyMethodDef module_methods[] = { | ||
{"system", (PyCFunction)spam_system, METH_VARARGS, | ||
"Execute a shell command."}, | ||
{NULL} /* Sentinel */ | ||
}; | ||
|
||
PyMODINIT_FUNC PyInit_spam(void) | ||
{ | ||
static struct PyModuleDef moduledef = { | ||
PyModuleDef_HEAD_INIT, "spam", "Example module", -1, module_methods, | ||
}; | ||
return PyModule_Create(&moduledef); | ||
} |