Skip to content

Commit 6c8e40c

Browse files
committed
Stubs and CI.
1 parent c5ac797 commit 6c8e40c

File tree

11 files changed

+358
-1926
lines changed

11 files changed

+358
-1926
lines changed

.github/workflows/release.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ['v*']
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
linux:
13+
runs-on: ubuntu-22.04
14+
strategy:
15+
matrix:
16+
target: [x86_64, aarch64]
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.x'
22+
- name: Setup QEMU
23+
if: matrix.target == 'aarch64'
24+
uses: docker/setup-qemu-action@v3
25+
- name: Build wheels
26+
uses: PyO3/maturin-action@v1
27+
with:
28+
target: ${{ matrix.target }}
29+
args: --release --out dist --find-interpreter
30+
manylinux: 2_28
31+
before-script-linux: |
32+
dnf install -y cmake gcc-c++ \
33+
libX11-devel libXrandr-devel libXinerama-devel libXcursor-devel libXi-devel \
34+
wayland-devel libxkbcommon-devel
35+
working-directory: crates/processing_pyo3
36+
- uses: actions/upload-artifact@v4
37+
with:
38+
name: wheels-linux-${{ matrix.target }}
39+
path: crates/processing_pyo3/dist
40+
41+
macos:
42+
runs-on: ${{ matrix.runner }}
43+
strategy:
44+
matrix:
45+
include:
46+
- runner: macos-14
47+
target: aarch64
48+
- runner: macos-13
49+
target: x86_64
50+
steps:
51+
- uses: actions/checkout@v4
52+
- uses: actions/setup-python@v5
53+
with:
54+
python-version: '3.x'
55+
- name: Build wheels
56+
uses: PyO3/maturin-action@v1
57+
with:
58+
target: ${{ matrix.target }}
59+
args: --release --out dist --find-interpreter
60+
working-directory: crates/processing_pyo3
61+
- uses: actions/upload-artifact@v4
62+
with:
63+
name: wheels-macos-${{ matrix.target }}
64+
path: crates/processing_pyo3/dist
65+
66+
windows:
67+
runs-on: windows-latest
68+
steps:
69+
- uses: actions/checkout@v4
70+
- uses: actions/setup-python@v5
71+
with:
72+
python-version: '3.x'
73+
- name: Build wheels
74+
uses: PyO3/maturin-action@v1
75+
with:
76+
target: x64
77+
args: --release --out dist --find-interpreter
78+
working-directory: crates/processing_pyo3
79+
- uses: actions/upload-artifact@v4
80+
with:
81+
name: wheels-windows-x64
82+
path: crates/processing_pyo3/dist
83+
84+
sdist:
85+
runs-on: ubuntu-latest
86+
steps:
87+
- uses: actions/checkout@v4
88+
- name: Build sdist
89+
uses: PyO3/maturin-action@v1
90+
with:
91+
command: sdist
92+
args: --out dist
93+
working-directory: crates/processing_pyo3
94+
- uses: actions/upload-artifact@v4
95+
with:
96+
name: wheels-sdist
97+
path: crates/processing_pyo3/dist
98+
99+
publish:
100+
name: Publish to PyPI
101+
runs-on: ubuntu-latest
102+
if: startsWith(github.ref, 'refs/tags/')
103+
needs: [linux, macos, windows, sdist]
104+
permissions:
105+
id-token: write
106+
environment: pypi
107+
steps:
108+
- uses: actions/download-artifact@v4
109+
with:
110+
pattern: wheels-*
111+
merge-multiple: true
112+
path: dist
113+
- name: Publish to PyPI
114+
uses: pypa/gh-action-pypi-publish@release/v1

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ webcam = ["dep:processing_webcam"]
1515

1616
[workspace]
1717
resolver = "3"
18-
members = ["crates/*"]
18+
members = ["crates/*", "tools/*"]
1919

2020
[workspace.lints.clippy]
2121
type_complexity = "allow"

crates/processing_pyo3/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,6 @@ docs/_build/
7070

7171
# Pyenv
7272
.python-version
73+
74+
# Generated type stubs
75+
**/__init__.pyi

crates/processing_pyo3/Cargo.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2024"
77
workspace = true
88

99
[lib]
10-
name = "processing"
10+
name = "mewnala"
1111
crate-type = ["cdylib"]
1212

1313
[features]
@@ -21,8 +21,5 @@ pyo3 = { workspace = true, features = ["experimental-inspect"] }
2121
processing = { workspace = true }
2222
processing_webcam = { workspace = true, optional = true }
2323
bevy = { workspace = true, features = ["file_watcher"] }
24-
glfw = { version = "0.60.0"}
25-
png = "0.18"
26-
27-
[target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies]
2824
glfw = { version = "0.60.0", features = ["static-link"] }
25+
png = "0.18"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .mewnala import *

crates/processing_pyo3/mewnala/py.typed

Whitespace-only changes.

crates/processing_pyo3/pyproject.toml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,47 @@ requires = ["maturin>=1.10,<2.0"]
33
build-backend = "maturin"
44

55
[project]
6-
name = "processing"
7-
requires-python = ">=3.8"
6+
name = "mewnala"
7+
requires-python = ">=3.10"
8+
description = "Python bindings for libprocessing — a creative coding library inspired by Processing"
9+
license = "MIT OR Apache-2.0"
10+
authors = [
11+
{ name = "The Processing Foundation" },
12+
]
813
classifiers = [
14+
"Development Status :: 3 - Alpha",
915
"Programming Language :: Rust",
1016
"Programming Language :: Python :: Implementation :: CPython",
11-
"Programming Language :: Python :: Implementation :: PyPy",
17+
"Programming Language :: Python :: 3",
18+
"Programming Language :: Python :: 3.10",
19+
"Programming Language :: Python :: 3.11",
20+
"Programming Language :: Python :: 3.12",
21+
"Programming Language :: Python :: 3.13",
22+
"Topic :: Multimedia :: Graphics",
23+
"Typing :: Typed",
1224
]
1325
dynamic = ["version"]
1426
dependencies = [
1527
"ipython>=8.12.3",
1628
"jupyter>=1.1.1",
1729
]
1830

31+
[project.urls]
32+
Homepage = "https://github.com/processing/libprocessing"
33+
Repository = "https://github.com/processing/libprocessing"
34+
Issues = "https://github.com/processing/libprocessing/issues"
35+
1936
[dependency-groups]
2037
dev = ["maturin>=1.10,<2.0"]
2138

2239
[tool.maturin]
2340
manifest-path = "Cargo.toml"
41+
include = [
42+
{ path = "mewnala/*.pyi", format = "sdist" },
43+
{ path = "mewnala/*.pyi", format = "wheel" },
44+
{ path = "mewnala/py.typed", format = "sdist" },
45+
{ path = "mewnala/py.typed", format = "wheel" },
46+
]
2447

2548
[tool.uv]
2649
cache-keys = [

crates/processing_pyo3/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ fn detect_environment(py: Python<'_>) -> PyResult<String> {
108108
}
109109

110110
#[pymodule]
111-
mod processing {
111+
mod mewnala {
112112
use super::*;
113113

114114
#[pymodule_export]

0 commit comments

Comments
 (0)