Files
nixpkgs/pkgs/development/python-modules/dbus-fast/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

80 lines
1.6 KiB
Nix

{
lib,
async-timeout,
buildPythonPackage,
cython,
dbus,
fetchFromGitHub,
poetry-core,
pytest,
pytest-asyncio,
pytest-codspeed,
pytest-cov-stub,
python,
setuptools,
}:
buildPythonPackage rec {
pname = "dbus-fast";
version = "3.1.2";
pyproject = true;
src = fetchFromGitHub {
owner = "Bluetooth-Devices";
repo = "dbus-fast";
tag = "v${version}";
hash = "sha256-WmVtJ/hTFTohsbxwXpBbOvDE8/pdPHX2rBurxtW+ct0=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "Cython>=3,<3.3.0" Cython
'';
# The project can build both an optimized cython version and an unoptimized
# python version. This ensures we fail if we build the wrong one.
env.REQUIRE_CYTHON = 1;
build-system = [
cython
poetry-core
setuptools
];
dependencies = [ async-timeout ];
nativeCheckInputs = [
dbus
pytest
pytest-asyncio
pytest-codspeed
pytest-cov-stub
];
pythonImportsCheck = [
"dbus_fast"
"dbus_fast.aio"
"dbus_fast.service"
"dbus_fast.message"
];
checkPhase = ''
runHook preCheck
# test_peer_interface times out
dbus-run-session \
--config-file=${dbus}/share/dbus-1/session.conf \
${python.interpreter} -m pytest -k "not test_peer_interface"
runHook postCheck
'';
meta = {
description = "Faster version of dbus-next";
homepage = "https://github.com/bluetooth-devices/dbus-fast";
changelog = "https://github.com/Bluetooth-Devices/dbus-fast/releases/tag/${src.tag}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ fab ];
};
}