Skip to content

Commit

Permalink
cibuildwheel with GitHub Actions (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
bt2901 authored Aug 19, 2023
1 parent 89bb7dc commit 065f594
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 13 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build wheels

on:
push:
branches: [master, cibw]
workflow_dispatch:

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-22.04
- windows-2022
- macos-12
env:
CIBW_ARCHS_LINUX: x86_64 i686
CIBW_ARCHS_MACOS: x86_64 universal2
CIBW_ARCHS_WINDOWS: AMD64 x86 ARM64
CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-*"

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.15.0
- name: Build wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl


upload_all:
name: Upload if release
needs: [build_wheels]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'

steps:
- uses: actions/setup-python@v4
with:
python-version: "3.x"

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

- uses: pypa/[email protected]
with:
password: ${{ secrets.pypi_password }}
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build-system]
requires = ["setuptools", "wheel", "Cython"]
25 changes: 12 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#! /usr/bin/env python
import glob
from setuptools import setup, Extension
from Cython.Build import cythonize


extensions = [
Extension(
"dawg",
sources=glob.glob('src/*.pyx') + glob.glob('lib/b64/*.c'),
include_dirs=['lib'],
language="c++",
)
]

setup(
name="DAWG2",
Expand All @@ -11,14 +22,7 @@
author_email='[email protected]',
url='https://github.com/pymorphy2-fork/DAWG/',

ext_modules=[
Extension(
"dawg",
sources=glob.glob('src/*.cpp') + glob.glob('lib/b64/*.c'),
include_dirs=['lib'],
language="c++",
)
],
ext_modules=cythonize(extensions, language="c++", annotate=False),

classifiers=[
'Development Status :: 4 - Beta',
Expand All @@ -27,12 +31,7 @@
'License :: OSI Approved :: MIT License',
'Programming Language :: Cython',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
Expand Down

0 comments on commit 065f594

Please sign in to comment.