1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pyserial
5, pythonOlder
6, pyusb
7}:
8
9buildPythonPackage rec {
10 pname = "pyftdi";
11 version = "0.54.0";
12 format = "setuptools";
13
14 disabled = pythonOlder "3.7";
15
16 src = fetchFromGitHub {
17 owner = "eblot";
18 repo = pname;
19 rev = "v${version}";
20 hash = "sha256-vL8jSgTtDvaHuCvaCYmFixILQFasTl82yINL5yRtOwU=";
21 };
22
23 propagatedBuildInputs = [
24 pyserial
25 pyusb
26 ];
27
28 # Tests require access to the serial port
29 doCheck = false;
30
31 pythonImportsCheck = [
32 "pyftdi"
33 ];
34
35 meta = with lib; {
36 description = "User-space driver for modern FTDI devices";
37 longDescription = ''
38 PyFtdi aims at providing a user-space driver for popular FTDI devices.
39 This includes UART, GPIO and multi-serial protocols (SPI, I2C, JTAG)
40 bridges.
41 '';
42 homepage = "https://github.com/eblot/pyftdi";
43 license = licenses.bsd3;
44 maintainers = with maintainers; [ fab ];
45 };
46}