-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use cibuildwheel to build release wheels
- Loading branch information
Showing
7 changed files
with
65 additions
and
107 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -37,7 +37,7 @@ jobs: | |
mkdir -p dist/ | ||
echo "${VERSION}" > dist/VERSION | ||
- uses: actions/upload-artifact@v1 | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: dist | ||
path: dist/ | ||
|
@@ -47,111 +47,98 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 50 | ||
submodules: true | ||
|
||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
|
||
- name: Build source distribution | ||
run: | | ||
pip install -U setuptools wheel pip | ||
python -m pip install -U setuptools wheel pip | ||
python setup.py sdist | ||
- uses: actions/upload-artifact@v1 | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: dist | ||
path: dist/ | ||
path: dist/*.tar.* | ||
|
||
build-wheels: | ||
needs: validate-release-request | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python-version: [3.5, 3.6, 3.7, 3.8, 3.9] | ||
os: [ubuntu-20.04, macos-latest, windows-latest] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
cibw_arch: ["auto64", "aarch64", "universal2"] | ||
cibw_python: | ||
- "cp36-*" | ||
- "cp37-*" | ||
- "cp38-*" | ||
- "cp39-*" | ||
- "cp310-*" | ||
exclude: | ||
# Python 3.5 is unable to properly | ||
# find the recent VS tooling | ||
# https://bugs.python.org/issue30389 | ||
- os: ubuntu-latest | ||
cibw_arch: universal2 | ||
- os: macos-latest | ||
cibw_arch: aarch64 | ||
- os: macos-latest | ||
cibw_python: "cp36-*" | ||
cibw_arch: universal2 | ||
- os: macos-latest | ||
cibw_python: "cp37-*" | ||
cibw_arch: universal2 | ||
- os: windows-latest | ||
cibw_arch: universal2 | ||
- os: windows-latest | ||
python-version: 3.5 | ||
cibw_arch: aarch64 | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
env: | ||
PIP_DISABLE_PIP_VERSION_CHECK: 1 | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 50 | ||
submodules: true | ||
|
||
- uses: actions/download-artifact@v1 | ||
with: | ||
name: dist | ||
path: dist/ | ||
|
||
- name: Extract Release Version | ||
id: relver | ||
run: | | ||
set -e | ||
echo ::set-output name=version::$(cat dist/VERSION) | ||
rm dist/* | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Python Deps | ||
run: | | ||
python -m pip install --upgrade setuptools pip wheel | ||
- name: Build Wheels (linux) | ||
if: startsWith(matrix.os, 'ubuntu') | ||
uses: docker://quay.io/pypa/manylinux1_x86_64 | ||
env: | ||
PYTHON_VERSION: ${{ matrix.python-version }} | ||
- name: Set up QEMU | ||
if: matrix.os == 'ubuntu-latest' && matrix.cibw_arch == 'aarch64' | ||
uses: docker/setup-qemu-action@v1 | ||
with: | ||
entrypoint: /github/workspace/.github/workflows/build-manylinux-wheels.sh | ||
|
||
- name: Build Wheels (non-linux) | ||
if: "!startsWith(matrix.os, 'ubuntu')" | ||
run: | | ||
make clean | ||
python setup.py bdist_wheel | ||
platforms: arm64 | ||
|
||
- name: Test Wheels | ||
if: | | ||
!startsWith(matrix.os, 'windows') | ||
&& !contains(github.event.pull_request.labels.*.name, 'skip wheel tests') | ||
- uses: pypa/[email protected] | ||
env: | ||
OS: ${{ matrix.os }} | ||
PKG_VERSION: ${{ steps.relver.outputs.version }} | ||
run: | | ||
"${GITHUB_WORKSPACE}/.github/workflows/test-wheels.sh" | ||
- uses: actions/upload-artifact@v1 | ||
CIBW_BUILD_VERBOSITY: 1 | ||
CIBW_BUILD: ${{ matrix.cibw_python }} | ||
CIBW_ARCHS: ${{ matrix.cibw_arch }} | ||
CIBW_TEST_EXTRAS: "test" | ||
CIBW_TEST_COMMAND: "python {project}/tests/__init__.py" | ||
CIBW_TEST_COMMAND_WINDOWS: "python {project}\\tests\\__init__.py" | ||
CIBW_TEST_SKIP: "*universal2:arm64" | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: dist | ||
path: dist/ | ||
path: wheelhouse/*.whl | ||
|
||
publish: | ||
needs: [build-sdist, build-wheels] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 5 | ||
submodules: false | ||
|
||
- uses: actions/download-artifact@v1 | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: dist | ||
path: dist/ | ||
|
@@ -181,7 +168,7 @@ jobs: | |
release_name: v${{ steps.relver.outputs.version }} | ||
target: ${{ github.event.pull_request.base.ref }} | ||
body: ${{ github.event.pull_request.body }} | ||
draft: true | ||
draft: false | ||
|
||
- run: | | ||
ls -al dist/ | ||
|
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -94,12 +94,12 @@ def parse_url(url: bytes): | |
1. Clone this repository with | ||
`git clone --recursive [email protected]:MagicStack/httptools.git` | ||
|
||
2. Create a virtual environment with Python 3.5: | ||
`python3.5 -m venv envname` | ||
2. Create a virtual environment with Python 3: | ||
`python3 -m venv envname` | ||
|
||
3. Activate the environment with `source envname/bin/activate` | ||
|
||
4. Install Cython with `pip install cython` | ||
4. Install development requirements with `pip install -e .[test]` | ||
|
||
5. Run `make` and `make test`. | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[pytest] | ||
addopts = --capture=no --assert=plain --strict --tb native | ||
addopts = --capture=no --assert=plain --strict-markers --tb=native --import-mode=importlib | ||
testpaths = tests |
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 |
---|---|---|
|
@@ -185,6 +185,7 @@ def build_extensions(self): | |
'Development Status :: 5 - Production/Stable', | ||
], | ||
platforms=['macOS', 'POSIX', 'Windows'], | ||
python_requires='>=3.5.0', | ||
zip_safe=False, | ||
author='Yury Selivanov', | ||
author_email='[email protected]', | ||
|