build pypi wheel (#47)
This commit is contained in:
parent
f1298215cb
commit
5402154cb4
57
.github/workflows/pypi.yml
vendored
Normal file
57
.github/workflows/pypi.yml
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
name: pypi
|
||||
#on: [push, pull_request]
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
build_wheels:
|
||||
name: Build wheels on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: setup-qemu
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
uses: docker/setup-qemu-action@v3
|
||||
with:
|
||||
platforms: all
|
||||
|
||||
- name: cibuildwheel
|
||||
uses: pypa/cibuildwheel@v2.16.5
|
||||
env:
|
||||
CIBW_ARCHS_LINUX: "x86_64 i686 aarch64 ppc64le s390x"
|
||||
CIBW_ARCHS_MACOS: "x86_64 arm64 universal2"
|
||||
CIBW_ARCHS_WINDOWS: "AMD64 x86 ARM64"
|
||||
CIBW_BUILD: "cp311*"
|
||||
CIBW_BUILD_VERBOSITY: 1
|
||||
with:
|
||||
output-dir: wheelhouse
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wheels-${{ matrix.os }}
|
||||
path: ./wheelhouse/*.whl
|
||||
|
||||
upload_all:
|
||||
permissions:
|
||||
contents: none
|
||||
name: Upload
|
||||
needs: [build_wheels]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: dist
|
||||
merge-multiple: true
|
||||
|
||||
- uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
@ -1,5 +1,5 @@
|
||||
[build-system]
|
||||
requires = ["setuptools", "cython"]
|
||||
requires = ["setuptools", "cython", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
|
13
setup.py
13
setup.py
@ -2,6 +2,17 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from setuptools import setup, find_packages, Extension
|
||||
from wheel.bdist_wheel import bdist_wheel
|
||||
|
||||
class bdist_wheel_abi3(bdist_wheel):
|
||||
def get_tag(self):
|
||||
python, abi, plat = super().get_tag()
|
||||
|
||||
if python.startswith("cp"):
|
||||
# on CPython, our wheels are abi3 and compatible back to 3.6
|
||||
return "cp36", "abi3", plat
|
||||
|
||||
return python, abi, plat
|
||||
|
||||
ext = Extension(
|
||||
name = 'ruapu',
|
||||
@ -10,9 +21,11 @@ ext = Extension(
|
||||
)
|
||||
|
||||
setup_args = dict(
|
||||
name = 'ruapu',
|
||||
packages = find_packages(where="."),
|
||||
package_dir = {"": "."},
|
||||
ext_modules = [ext],
|
||||
cmdclass = {"bdist_wheel": bdist_wheel_abi3},
|
||||
)
|
||||
|
||||
setup(**setup_args)
|
||||
|
Loading…
Reference in New Issue
Block a user