depot/third_party/nixpkgs/pkgs/development/python-modules/websockets/default.nix
Default email a6d62be0d1 Project import generated by Copybara.
GitOrigin-RevId: ac169ec6371f0d835542db654a65e0f2feb07838
2021-12-26 18:43:05 +01:00

49 lines
1.1 KiB
Nix

{ lib
, stdenv
, buildPythonPackage
, fetchFromGitHub
, python
, pythonOlder
}:
buildPythonPackage rec {
pname = "websockets";
version = "10.1";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "aaugustin";
repo = pname;
rev = version;
sha256 = "sha256-FFaoqxa+TmKJ+P6T7HrwodjbVCir+2qJSfZsoj6deJU=";
};
# Tests fail on Darwin with `OSError: AF_UNIX path too long`
doCheck = !stdenv.isDarwin;
# Disable all tests that need to terminate within a predetermined amount of
# time. This is nondeterministic.
patchPhase = ''
sed -i 's/with self.assertCompletesWithin.*:/if True:/' \
tests/legacy/test_protocol.py
'';
checkPhase = ''
runHook preCheck
${python.interpreter} -m unittest discover
runHook postCheck
'';
pythonImportsCheck = [
"websockets"
];
meta = with lib; {
description = "WebSocket implementation in Python";
homepage = "https://websockets.readthedocs.io/";
license = licenses.bsd3;
maintainers = with maintainers; [ fab ];
};
}