1{ lib
2, aiohttp
3, aresponses
4, buildPythonPackage
5, fetchFromGitHub
6, fetchpatch
7, poetry-core
8, pytest-aiohttp
9, pytest-asyncio
10, pytestCheckHook
11, pythonOlder
12}:
13
14buildPythonPackage rec {
15 pname = "pytile";
16 version = "2023.08.0";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.8";
20
21 src = fetchFromGitHub {
22 owner = "bachya";
23 repo = pname;
24 rev = "refs/tags/${version}";
25 hash = "sha256-wPtGofli3ZKBcAwjwjCbeYnLaSZ5lLshlBSz1/WlAcg=";
26 };
27
28 patches = [
29 # This patch removes references to setuptools and wheel that are no longer
30 # necessary and changes poetry to poetry-core, so that we don't need to add
31 # unnecessary nativeBuildInputs.
32 #
33 # https://github.com/bachya/pytile/pull/286
34 #
35 (fetchpatch {
36 name = "clean-up-build-dependencies.patch";
37 url = "https://github.com/bachya/pytile/commit/bdb5d96ba9d640bf85a1ae9c3787704dbc2ced23.patch";
38 hash = "sha256-RLRbHmaR2A8MNc96WHx0L8ccyygoBUaOulAuRJkFuUM=";
39 })
40 ];
41
42 nativeBuildInputs = [
43 poetry-core
44 ];
45
46 propagatedBuildInputs = [
47 aiohttp
48 ];
49
50 nativeCheckInputs = [
51 aresponses
52 pytest-aiohttp
53 pytest-asyncio
54 pytestCheckHook
55 ];
56
57 disabledTestPaths = [
58 # Ignore the examples as they are prefixed with test_
59 "examples/"
60 ];
61
62 pythonImportsCheck = [
63 "pytile"
64 ];
65
66 __darwinAllowLocalNetworking = true;
67
68 meta = with lib; {
69 description = " Python API for Tile Bluetooth trackers";
70 longDescription = ''
71 pytile is a simple Python library for retrieving information on Tile
72 Bluetooth trackers (including last location and more).
73 '';
74 homepage = "https://github.com/bachya/pytile";
75 license = with licenses; [ mit ];
76 maintainers = with maintainers; [ fab ];
77 };
78}