Skip to content
Open
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
54 changes: 31 additions & 23 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,34 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: actions/setup-python@v3
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel
- name: Build wheel
run: |
python -m cibuildwheel --output-dir dist
- uses: actions/upload-artifact@v3
with:
name: wheels
path: dist/
- name: Upload To PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
run: |
python -m pip install twine
python -m twine check --strict dist/*
python -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_github_triangle }}
- uses: actions/checkout@v3
with:
submodules: "recursive"

# Set up QEMU for ARM64 builds on Linux
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64

- uses: actions/setup-python@v3
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel
- name: Build wheel
run: |
python -m cibuildwheel --output-dir dist
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: dist/
- name: Upload To PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
run: |
python -m pip install twine
python -m twine check --strict dist/*
python -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_github_triangle }}
10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[build-system]
requires = [
'Cython >=3.0.2',
'Cython >=3.0.11',
'setuptools >=61',
]
build-backend = 'setuptools.build_meta'

[project]
name = 'triangle'
name = 'triangle3'
dynamic = ['version']
authors = [
{ name = 'Dzhelil Rufat', email = 'd@rufat.be' },
Expand Down Expand Up @@ -50,3 +50,9 @@ skip = ['pp*', '*musllinux*']
test-skip = ['*-manylinux_i686']
test-requires = 'pytest'
test-command = 'pytest {project}/tests'

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

[tool.cibuildwheel.linux]
archs = ["x86_64", "aarch64"]
23 changes: 12 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
from setuptools import setup, Extension

from Cython.Build import cythonize
from setuptools import Extension, setup

define_macros = [
('VOID', 'void'),
('REAL', 'double'),
('NO_TIMER', 1),
('TRILIBRARY', 1),
('ANSI_DECLARATORS', 1),
("VOID", "void"),
("REAL", "double"),
("NO_TIMER", 1),
("TRILIBRARY", 1),
("ANSI_DECLARATORS", 1),
]

ext_modules = [
Extension(
'triangle.core',
['c/triangle.c', 'triangle/core.c'],
include_dirs=['c'],
"triangle.core",
["c/triangle.c", "triangle/core.pyx"],
include_dirs=["c"],
define_macros=define_macros,
# extra_compile_args=['-g'],
),
]
ext_modules = cythonize(ext_modules)

# see pyproject.toml for other metadata
setup(
name='triangle',
name="triangle",
ext_modules=ext_modules,
)
Loading