Skip to content

Commit 98447d5

Browse files
ci: Add a python job
1 parent d2f8466 commit 98447d5

2 files changed

Lines changed: 59 additions & 0 deletions

File tree

.github/workflows/python.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Python Bindings
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'python/**'
8+
- 'client/**'
9+
- '.github/workflows/python.yml'
10+
pull_request:
11+
branches: [main]
12+
paths:
13+
- 'python/**'
14+
- 'client/**'
15+
- '.github/workflows/python.yml'
16+
17+
jobs:
18+
test:
19+
name: Test Python ${{ matrix.python-version }}
20+
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
24+
25+
steps:
26+
- uses: actions/checkout@v6
27+
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
33+
- name: Install system dependencies
34+
run: |
35+
sudo apt-get update
36+
sudo apt-get install -y gnome-keyring dbus-x11
37+
38+
- name: Set up Rust
39+
uses: dtolnay/rust-toolchain@stable
40+
41+
- name: Install Python dependencies
42+
working-directory: python
43+
run: |
44+
python -m pip install --upgrade pip
45+
pip install -r requirements-dev.txt
46+
47+
- name: Build Python package
48+
working-directory: python
49+
run: maturin develop
50+
51+
- name: Start gnome-keyring
52+
run: |
53+
dbus-run-session -- sh -c '
54+
echo "test" | gnome-keyring-daemon --unlock
55+
gnome-keyring-daemon --start --daemonize --components=secrets
56+
export $(gnome-keyring-daemon --start)
57+
cd python && pytest -v
58+
'

python/requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
maturin>=1.0,<2.0
12
pytest>=7.0
23
pytest-asyncio>=0.21

0 commit comments

Comments
 (0)