1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 pytestCheckHook,
7 pyqt5,
8 pyqt3d,
9 pyqtchart,
10 pyqtdatavisualization,
11 pyqtwebengine,
12}:
13
14buildPythonPackage rec {
15 pname = "pyqt5-stubs";
16 version = "5.15.6.0";
17 format = "setuptools";
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "python-qt-tools";
22 repo = "PyQt5-stubs";
23 rev = version;
24 hash = "sha256-qWnvlHnFRy8wbZJ28C0pYqAxod623Epe5z5FZufheDc=";
25 };
26 postPatch = ''
27 # pulls in a dependency to mypy, but we don't want to run linters
28 rm tests/test_stubs.py
29 ''
30 + lib.optionalString (!pyqt5.connectivityEnabled) ''
31 rm tests/qflags/test_QtBluetooth_*
32 rm tests/qflags/test_QtNfc_*
33 ''
34 + lib.optionalString (!pyqt5.locationEnabled) ''
35 rm tests/qflags/test_QtLocation_*
36 rm tests/qflags/test_QtPositioning_*
37 ''
38 + lib.optionalString (!pyqt5.multimediaEnabled) ''
39 rm tests/qflags/test_QtMultimedia_*
40 ''
41 + lib.optionalString (!pyqt5.serialPortEnabled) ''
42 rm tests/qflags/test_QtSerialPort_*
43 ''
44 + lib.optionalString (!pyqt5.toolsEnabled) ''
45 rm tests/qflags/test_QtDesigner_*
46 '';
47
48 pythonImportsCheck = [ "PyQt5-stubs" ];
49
50 nativeCheckInputs = [
51 pytestCheckHook
52 pyqt5
53 pyqt3d
54 pyqtchart
55 pyqtdatavisualization
56 pyqtwebengine
57 ];
58
59 meta = with lib; {
60 description = "Stubs for PyQt5";
61 homepage = "https://github.com/python-qt-tools/PyQt5-stubs";
62 license = licenses.gpl3;
63 maintainers = with maintainers; [ _999eagle ];
64 };
65}