Skip to content

Commit 81c6d4f

Browse files
authored
add cibuildwheel build (#44)
1 parent a7f91fc commit 81c6d4f

9 files changed

+118
-245
lines changed
+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Build and upload to PyPI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build_wheels:
7+
name: Build wheels on ${{ matrix.os }}
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
os: [ubuntu-20.04, windows-2019, macos-10.15]
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Build wheels
17+
uses: pypa/[email protected]
18+
19+
- uses: actions/upload-artifact@v3
20+
with:
21+
path: ./wheelhouse/*.whl
22+
23+
build_sdist:
24+
name: Build source distribution
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v3
28+
29+
- name: Build sdist
30+
run: pipx run build --sdist
31+
32+
- uses: actions/upload-artifact@v3
33+
with:
34+
path: dist/*.tar.gz
35+
36+
upload_pypi:
37+
needs: [build_wheels, build_sdist]
38+
runs-on: ubuntu-latest
39+
# upload to PyPI on every tag
40+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
41+
# alternatively, to publish when a GitHub Release is created, use the following rule:
42+
# if: github.event_name == 'release' && github.event.action == 'published'
43+
steps:
44+
- uses: actions/download-artifact@v3
45+
with:
46+
name: artifact
47+
path: dist
48+
49+
- uses: pypa/[email protected]
50+
with:
51+
user: __token__
52+
password: ${{ secrets.PYPI_TOKEN }}

.github/workflows/docbuild.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: [push, pull_request, workflow_dispatch]
44

55
jobs:
66
docs_build:
7-
runs-on: ubuntu-20.04
7+
runs-on: ubuntu-22.04
88

99
env:
1010
PYANSYS_OFF_SCREEN: True
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup Python
1717
uses: actions/[email protected]
1818
with:
19-
python-version: 3.8
19+
python-version: 3.9
2020

2121
- name: Install and start virtual framebuffer
2222
run: |

.github/workflows/testing-and-deployment.yml

-81
This file was deleted.

azure-pipelines.yml

-66
This file was deleted.

pyproject.toml

+30-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
11
[build-system]
2-
requires = ["setuptools >= 40.6.0", "wheel", "numpy", "cython"]
3-
build-backend = "setuptools.build_meta"
2+
requires = [
3+
"setuptools>=42",
4+
"wheel>=0.33.0",
5+
"cython>=0.29.0",
6+
"oldest-supported-numpy"
7+
]
8+
9+
build-backend = "setuptools.build_meta"
10+
11+
[tool.pytest.ini_options]
12+
junit_family= "legacy"
13+
filterwarnings = [
14+
"ignore::FutureWarning",
15+
"ignore::PendingDeprecationWarning",
16+
"ignore::DeprecationWarning",
17+
# bogus numpy ABI warning (see numpy/#432)
18+
"ignore:.*numpy.dtype size changed.*:RuntimeWarning",
19+
"ignore:.*numpy.ufunc size changed.*:RuntimeWarning"
20+
]
21+
22+
[tool.cibuildwheel]
23+
archs = ["auto64"] # 64-bit only
24+
skip = "pp* *musllinux*" # disable PyPy and musl-based wheels
25+
test-requires = "pytest"
26+
test-command = "pytest {project}/tests"
27+
28+
[tool.cibuildwheel.macos]
29+
# https://cibuildwheel.readthedocs.io/en/stable/faq/#apple-silicon
30+
archs = ["x86_64", "universal2"]
31+
test-skip = ["*_arm64", "*_universal2:arm64"]

pytest.ini

-9
This file was deleted.

requirements_build.txt

-5
This file was deleted.

requirements_docs.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Sphinx==4.0.3
1+
Sphinx==5.0.2
22
pydata-sphinx-theme
33
matplotlib
44
pyvista

0 commit comments

Comments
 (0)