Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

71.39. python3-keyring-25.7.0

Python access to the desktop's Secret Service, with the keyring command

Version 25.7.0, release 2
Shelf python-libs — General-purpose python3-* runtime libraries: text, templating, markup, parsing, config, CLI, system, files, crypto, imaging
Phase 40_lang (Languages), 119 of 186 in build order
Licence MIT AND BSD-3-Clause
Homepage https://github.com/jaraco/keyring
Build time 0.2 SBU
Installed size 1.3 MiB in 209 files
Recipe ports/core/python-libs/python3-keyring/kpkgbuild

About

keyring gives Python programs one API, and a keyring command, for storing and reading secrets in the system’s password store. On Linux its backend is the freedesktop Secret Service, reached through SecretStorage over jeepney’s pure-Python D-Bus client: it stores into whichever program owns org.freedesktop.secrets on the session bus. In a Plasma session that is ksecretd, from kwallet; see A login that typed no password leaves the wallet locked. cura and spyder depend on it.

Sources

Dependencies

Depends on: python3, python3-pip, python3-setuptools, python3-setuptools-scm, python3-flit-core, python3-cryptography.

Required by (2): cura, spyder.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/40_lang/phase.env && kpkg install python3-keyring'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/python-libs/python3-keyring.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/python-libs/python3-keyring
echo 'fe01bd85eb3f8fb3dd0405defdeac9a5b4f6f0439edbb3149577f244a2e8245b  python3-keyring-25.7.0.tar.gz' | sha256sum -c -
echo '75872cb59dfb519b715c795e92f9a3cc7c2846e525c48a42381eadf8102b2e06  python3-keyring-vendor-25.7.0.tar.xz' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/python3-keyring
SRC=$SRC_ROOT/python3-keyring-25.7.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf python3-keyring-25.7.0.tar.gz -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the recipe’s helpers pyrequirements, pyruntime and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

_vendor="$SRC_ROOT/vendor"
mkdir -p "$_vendor"
tar -xf $PORT_SRC/$name-vendor-$version.tar.xz --strip-components=1 -C "$_vendor"

_back="$SRC_ROOT/backends"
pip3 install --no-deps --no-index --find-links="$_vendor" --no-build-isolation \
	--target "$_back" coherent-licensed
export PYTHONPATH="$_back${PYTHONPATH:+:$PYTHONPATH}"

pip3 install --ignore-installed --no-deps --no-index --find-links="$_vendor" --no-build-isolation \
	--root=$PKG --prefix=/usr \
	jaraco-classes jaraco-context jaraco-functools more-itertools jeepney \
	secretstorage .
test -x "$PKG/usr/bin/keyring"

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/python3-keyring, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf python3-keyring-25.7.0-2.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/python3-keyring, and runs the triggers its paths call for.

Contents

Installed programs: keyring.

Installed directories: /usr/lib/python3.14/site-packages/jaraco, /usr/lib/python3.14/site-packages/jaraco_classes-3.4.0.dist-info, /usr/lib/python3.14/site-packages/jaraco_context-6.1.2.dist-info, /usr/lib/python3.14/site-packages/jaraco_functools-4.6.0.dist-info, /usr/lib/python3.14/site-packages/jeepney, /usr/lib/python3.14/site-packages/jeepney-0.9.0.dist-info, /usr/lib/python3.14/site-packages/keyring, /usr/lib/python3.14/site-packages/keyring-25.7.0.dist-info, /usr/lib/python3.14/site-packages/more_itertools, /usr/lib/python3.14/site-packages/more_itertools-11.1.0.dist-info, /usr/lib/python3.14/site-packages/secretstorage, /usr/lib/python3.14/site-packages/secretstorage-3.5.0.dist-info, /usr/share/licenses/python3-keyring.

Notes

keyring’s runtime dependencies that are not ports, the three jaraco packages, more-itertools, jeepney and secretstorage, are the bundle’s pypackages and are installed into this package by name with --no-deps; python3-cryptography, which SecretStorage needs, is a port in depends.

keyring, jaraco.context and jaraco.functools build with setuptools and the coherent.licensed plugin, which is not a port. build.sh installs the plugin from the bundle into $SRC_ROOT/backends and puts that directory on PYTHONPATH for the build alone, so nothing of it lands in the build root or the package.

The bundle is unpacked into $SRC_ROOT/vendor, outside the source tree. keyring keeps its package at the top of the tree and lists no packages, so setuptools would take a vendor directory there for a second top-level package and stop; see Where the bundle goes. test -x "$PKG/usr/bin/keyring" checks that the command was installed.