So the question is - is this by design and does it make sense? It should be a part of a build process (test deps), but it’s not required for python-lsp-server to run and I wouldn’t expect it to be downloaded unless you’re building the package from scratch (i.e. a cache hit).
I’m a bit inexperienced with combining buildPythonPackage w/ buildInputs and nativeBuildInputs. As far as I understand, this should be a part of nativeBuildInputs and not buildInputs.
I don’t see the issue. It is added as test input (checkInputs) which means it is only used during build time when tests are enabled. There is no runtime dependency.
$ nix why-depends nixpkgs#python3.pkgs.python-lsp-server nixpkgs#python3.pkgs.pyqt5
these 5 paths will be fetched (15.68 MiB download, 74.85 MiB unpacked):
'/nix/store/f7qgpp9mq9sgp1nywl9cc176m874mf7j-python3.9-python-lsp-server-1.3.3' does not depend on '/nix/store/sgl0171sagjx58am4vxsb6z1jiy2lhny-python3.9-PyQt5-5.15.4'