Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Replace custom workflow with cibuildwheel #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 0 additions & 153 deletions 153 .github/workflows/publish.yml

This file was deleted.

88 changes: 71 additions & 17 deletions 88 .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,87 @@ on:
pull_request:
branches:
- master
release:
types:
- published

jobs:
tox:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
python-version:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
os: [ubuntu-20.04, windows-2019, macos-10.15]

steps:
- uses: actions/checkout@v2

# Needed to build non-native architectures.
# https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation
- name: Setup QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
with:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2.2.2
env:
# While arm64 wheels can be built on x86_64, they cannot be tested.
# The ability to test the arm64 wheels will be added in a future
# release of cibuildwheel, once Apple Silicon CI runners are widely
# available.
CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64"

- uses: actions/upload-artifact@v2
with:
name: python_packages
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
python-version: '3.8'

- name: Install Tox
run: pip install tox tox-gh-actions
env:
PIP_CONSTRAINT: requirements.txt
- name: Install build
run: pip install build

- name: Build sdist
run: python -m build -s

- uses: actions/upload-artifact@v2
with:
name: python_packages
path: dist/*.tar.gz

publish:
needs:
- build_wheels
- build_sdist
runs-on: ubuntu-latest
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v2
with:
name: python_packages
path: dist

- name: Test
run: tox
- name: Publish packages to TestPyPI
uses: pypa/gh-action-pypi-publish@v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Publish packages to PyPI
uses: pypa/gh-action-pypi-publish@v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
10 changes: 10 additions & 0 deletions 10 pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
requires = ["setuptools>=40.8.0", "wheel"]
build-backend = "setuptools.build_meta"

[tool.cibuildwheel]
test-command = "pytest {package}/tests"
test-requires = "pytest"

[tool.cibuildwheel.macos]
archs = ["x86_64", "universal2", "arm64"]

[tool.cibuildwheel.linux]
archs = ["auto", "aarch64"]

[tool.black]
line-length = 79
target-version = ["py36"]
Expand Down
8 changes: 7 additions & 1 deletion 8 setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import os

from setuptools import Extension, setup

setup(
ext_modules=[
Extension("_jump", sources=["src/jump/jump.c"], optional=True)
Extension(
"_jump",
sources=["src/jump/jump.c"],
optional=os.environ.get("CIBUILDWHEEL", "0") != "1",
)
]
)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.