1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 poetry-core,
6 pybluez,
7 pytestCheckHook,
8 pythonOlder,
9 pyusb,
10}:
11
12buildPythonPackage rec {
13 pname = "nxt-python";
14 version = "3.3.0";
15 pyproject = true;
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitHub {
20 owner = "schodet";
21 repo = pname;
22 rev = "refs/tags/${version}";
23 hash = "sha256-v65KEP5DuJsZAifd1Rh46x9lSAgBZgyo+e8PKSDKnhw=";
24 };
25
26 build-system = [ poetry-core ];
27
28 dependencies = [ pyusb ];
29
30 optional-dependencies = {
31 bluetooth = [ pybluez ];
32 };
33
34 nativeCheckInputs = [ pytestCheckHook ];
35
36 pythonImportsCheck = [ "nxt" ];
37
38 meta = with lib; {
39 description = "Python driver/interface for Lego Mindstorms NXT robot";
40 homepage = "https://github.com/schodet/nxt-python";
41 changelog = "https://github.com/schodet/nxt-python/releases/tag/${version}";
42 license = licenses.gpl3Only;
43 maintainers = with maintainers; [ ibizaman ];
44 };
45}