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/3k9xwlmq4l6r20wzzwc0ls9l00p73rg5-qtwebchannel-5.15.3
/nix/store/6j6pj3yjfbvl2a72ql21x4r51jr0k4sm-qtdeclarative-5.15.3
/nix/store/8dm7k0v2rm2bj1f91hacmha2bp3b1sqw-qtsvg-5.15.3
/nix/store/rplfm52hjqixy0axjnv0cvvjr22wfzcw-qtbase-5.15.3
/nix/store/sgl0171sagjx58am4vxsb6z1jiy2lhny-python3.9-PyQt5-5.15.4
'/nix/store/f7qgpp9mq9sgp1nywl9cc176m874mf7j-python3.9-python-lsp-server-1.3.3' does not depend on '/nix/store/sgl0171sagjx58am4vxsb6z1jiy2lhny-python3.9-PyQt5-5.15.4'