Skip to content

Commit f61172a

Browse files
committed
Use system GPG python bindings
bmaptool was incorrectly installing the gpg bindings from PyPi. This is incorrect however, since the gpg module must match the system GPG library and is packaged with it. Modify the dependencies, instructions, and CI to reflect this Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
1 parent f53bc5a commit f61172a

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
python-version: ${{ matrix.python-version }}
2525
- name: Install dependencies
2626
run: |
27-
sudo apt-get install -y pbzip2 pigz lzop liblz4-tool libgpgme11-dev
27+
sudo apt-get install -y pbzip2 pigz lzop liblz4-tool libgpgme11-dev python3-gpg
2828
python -m pip install --upgrade pip
2929
pip install build
3030
- name: Build package

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,11 @@ More details can be found [in the OpenZFS documentation](https://openzfs.github.
316316
changes to the project, first create a new virtual environment and activate it:
317317

318318
```bash
319-
python3 -m venv .venv
319+
python3 -m venv .venv --system-site-packages
320320
. .venv/bin/activate
321321
```
322+
Note: --system-site-packages is required to give the virtual environment
323+
access to the system GPG python bindings
322324

323325
Next install the project in editable mode with development dependencies:
324326

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 = [

src/bmaptool/CLI.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ def verify_detached_bmap_signature(args, bmap_obj, bmap_path):
204204
error_out(
205205
'cannot verify the signature because the python "gpg" '
206206
"module is not installed on your system\nPlease, either "
207-
"install the module or use --no-sig-verify"
207+
"install system GPG python bindings (e.g. python3-gpg) or use "
208+
"--no-sig-verify"
208209
)
209210

210211
try:
@@ -254,7 +255,7 @@ def verify_clearsign_bmap_signature(args, bmap_obj):
254255
'cannot verify the signature because the python "gpg"'
255256
"module is not installed on your system\nCannot extract "
256257
"block map from the bmap file which has clearsign format, "
257-
"please, install the module"
258+
"please install system GPG python bindings (e.g. python3-gpg)"
258259
)
259260

260261
try:

0 commit comments

Comments
 (0)