Skip to content

Commit e3a4388

Browse files
committed
try binary dist again
1 parent a3f989c commit e3a4388

File tree

7 files changed

+75
-12
lines changed

7 files changed

+75
-12
lines changed

.github/workflows/publish.yml

+63-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,62 @@ on:
55
types: [published]
66

77
jobs:
8+
build_wheels:
9+
name: Build wheels on ${{ matrix.os }}
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, windows-latest, macos-latest]
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: "3.10"
22+
23+
- name: Install dependencies (Linux)
24+
if: runner.os == 'Linux'
25+
run: |
26+
sudo apt-get update
27+
sudo apt-get install -y libwebkit2gtk-4.0-dev
28+
python -m pip install --upgrade pip
29+
pip install build wheel
30+
31+
- name: Install dependencies (macOS)
32+
if: runner.os == 'macOS'
33+
run: |
34+
python -m pip install --upgrade pip
35+
pip install build wheel
36+
37+
- name: Install dependencies (Windows)
38+
if: runner.os == 'Windows'
39+
run: |
40+
python -m pip install --upgrade pip
41+
pip install build wheel
42+
43+
- name: Download platform binary
44+
run: |
45+
python -c "import os, sys; sys.path.append(os.path.join(os.getcwd(), 'src')); from webview._webview_ffi import _be_sure_libraries; _be_sure_libraries()"
46+
47+
- name: Build wheels
48+
uses: pypa/cibuildwheel@v2.16.5
49+
env:
50+
CIBW_BUILD: "cp312-*"
51+
CIBW_ARCHS_MACOS: "x86_64 arm64"
52+
CIBW_ARCHS_LINUX: "x86_64"
53+
CIBW_ARCHS_WINDOWS: "AMD64"
54+
#CIBW_BEFORE_BUILD_LINUX: "yum install -y webkit2gtk3-devel"
55+
#CIBW_BUILD_VERBOSITY: 1
56+
57+
- uses: actions/upload-artifact@v3
58+
with:
59+
name: dist-${{ matrix.os }}
60+
path: dist/*.whl
61+
862
publish:
63+
needs: [build_wheels]
964
runs-on: ubuntu-latest
1065

1166
steps:
@@ -15,17 +70,21 @@ jobs:
1570
uses: actions/setup-python@v4
1671
with:
1772
python-version: "3.x"
73+
74+
- name: Download all artifacts
75+
uses: actions/download-artifact@v3
76+
with:
77+
path: dist
1878

1979
- name: Prepare distribution
2080
run: |
21-
python -m pip install --upgrade pip
22-
pip install -r requirements.txt
23-
python -m build -w -n
81+
mkdir final_dist
82+
cp dist/*/*.whl final_dist/
2483
2584
- name: Publish to PyPI
2685
env:
2786
TWINE_USERNAME: __token__
2887
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
2988
run: |
3089
pip install --upgrade twine
31-
twine upload dist/*.whl
90+
twine upload final_dist/*.whl

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,4 @@ develop-eggs
9292
.installed.cfg
9393
lib
9494
lib64
95-
95+
*.c

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ python -m build -n -w
224224

225225
## Roadmap
226226

227-
- [ ] Publish to PyPI
228-
- [ ] Setup GitHub Actions for CI/CD
227+
- [x] Publish to PyPI
228+
- [x] Setup GitHub Actions for CI/CD
229229
- [ ] Add preact example
230230
- [ ] Add three.js example
231231
- [ ] Add three.js fiber example

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools>=61.0"]
2+
requires = ["setuptools>=61.0","wheel", "cython"]
33
build-backend = "setuptools.build_meta"
44

55
[project]

requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ pytest-cov
33
build
44
setuptools
55
twine
6+
cython
7+
wheel

setup.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from setuptools import setup
2+
from Cython.Build import cythonize
3+
4+
setup(
5+
ext_modules=cythonize("src/webview/_dummy_holder.pyx")
6+
)

src/webview/_dummy_holder.pyx

-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
def primes(int nb_primes):
2-
cdef int n, i, len_p
3-
cdef int[1000] p
4-
pass

0 commit comments

Comments
 (0)