nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 mock,
6 pexpect,
7 pyserial,
8 pytestCheckHook,
9 setuptools,
10}:
11
12buildPythonPackage rec {
13 pname = "pygatt";
14 version = "5.0.0";
15 pyproject = true;
16
17 src = fetchFromGitHub {
18 owner = "peplin";
19 repo = "pygatt";
20 tag = "v${version}";
21 hash = "sha256-TMIqC+JvNOLU38a9jkacRAbdmAAd4UekFUDRoAWhHFo=";
22 };
23
24 postPatch = ''
25 substituteInPlace setup.py \
26 --replace-fail "setup_requires" "test_requires"
27 '';
28
29 pythonRemoveDeps = [ "enum-compat" ];
30
31 build-system = [ setuptools ];
32
33 dependencies = [ pyserial ];
34
35 optional-dependencies.GATTTOOL = [ pexpect ];
36
37 nativeCheckInputs = [
38 mock
39 pytestCheckHook
40 ]
41 ++ optional-dependencies.GATTTOOL;
42
43 pythonImportsCheck = [ "pygatt" ];
44
45 meta = {
46 description = "Python wrapper the BGAPI for accessing Bluetooth LE Devices";
47 homepage = "https://github.com/peplin/pygatt";
48 changelog = "https://github.com/peplin/pygatt/blob/v${version}/CHANGELOG.rst";
49 license = with lib.licenses; [
50 asl20
51 mit
52 ];
53 maintainers = with lib.maintainers; [ fab ];
54 };
55}