1{ lib, buildPythonPackage, fetchPypi
2, cryptography, ecdsa
3, pytestrunner, pytestcov, pytest }:
4
5buildPythonPackage rec {
6 pname = "PyJWT";
7 version = "1.7.1";
8
9 src = fetchPypi {
10 inherit pname version;
11 sha256 = "8d59a976fb773f3e6a39c85636357c4f0e242707394cadadd9814f5cbaa20e96";
12 };
13
14 propagatedBuildInputs = [ cryptography ecdsa ];
15
16 checkInputs = [ pytestrunner pytestcov pytest ];
17
18 postPatch = ''
19 substituteInPlace setup.py --replace "pytest>=4.0.1,<5.0.0" "pytest"
20 '';
21
22 # ecdsa changed internal behavior
23 checkPhase = ''
24 pytest tests -k 'not ec_verify_should_return_false_if_signature_invalid'
25 '';
26
27 meta = with lib; {
28 description = "JSON Web Token implementation in Python";
29 homepage = "https://github.com/jpadilla/pyjwt";
30 license = licenses.mit;
31 maintainers = with maintainers; [ prikhi ];
32 };
33}