Skip to content

Commit aa39af0

Browse files
JPEWdevjosch
authored andcommitted
ci: Fix GPG tests
Fixes up the way that the GPG tests work by adding a new "native" python test version. This is required because the python 'gpg' module *must* come from the host package in order to patch libgpgme (e.g. 'python3-gpg'). It's not possible to get this module installed with the pre-canned python versions provided by GitHub Actions, so the gpg tests are skipped for this version, but using the host native python can.
1 parent dc89fd4 commit aa39af0

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,40 @@ jobs:
1616
- "3.10"
1717
- "3.11"
1818
- "3.12"
19+
# Testing with native host python is required in order to test the
20+
# GPG code, since it must use the host python3-gpg package
21+
- "native"
1922
steps:
2023
- uses: actions/checkout@v4
21-
- name: Setup Python ${{ matrix.python-version }}
24+
25+
- if: matrix.python-version != 'native'
26+
name: Setup Python ${{ matrix.python-version }}
2227
uses: actions/setup-python@v4
2328
with:
2429
python-version: ${{ matrix.python-version }}
30+
31+
- if: matrix.python-version == 'native'
32+
name: Setup Native Python
33+
run: |
34+
sudo apt-get install -y python3 python3-pip libgpgme11-dev python3-gpg
35+
2536
- name: Install dependencies
2637
run: |
27-
sudo apt-get install -y pbzip2 pigz lzop liblz4-tool libgpgme11-dev gpg gpgv python3-gpg
28-
python -m pip install --upgrade pip
29-
pip install build
38+
sudo apt-get install -y pbzip2 pigz lzop liblz4-tool
39+
python3 -m pip install --upgrade pip
40+
python3 -m pip install build
41+
3042
- name: Build package
3143
run: |
32-
python -m build
44+
python3 -m build
45+
3346
- name: Install package
3447
run: |
35-
pip install -e .[dev]
48+
python3 -m pip install -e .[dev]
49+
3650
- name: Run tests
3751
run: |
38-
python -m unittest -vb
52+
python3 -m unittest -vb
3953
4054
lint:
4155
runs-on: ubuntu-latest

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ name = "bmaptool"
33
description = "BMAP tools"
44
dynamic = ["version"]
55
dependencies = [
6-
"gpg >= 1.10.0",
6+
# NOTE: gpg is not installed because it must come from the system GPG package
7+
# (e.g. python3-gpg on Ubuntu) and not from PyPi. The PyPi version is very old
8+
# and no longer functions correctly
9+
#"gpg >= 1.10.0",
710
]
811
required-python = ">= 3.8"
912
authors = [

0 commit comments

Comments
 (0)