1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 cryptography,
7 pytestCheckHook,
8 pythonOlder,
9 sphinxHook,
10 sphinx-rtd-theme,
11 zope-interface,
12 oauthlib,
13}:
14
15buildPythonPackage rec {
16 pname = "pyjwt";
17 version = "2.9.0";
18 pyproject = true;
19
20 disabled = pythonOlder "3.8";
21
22 src = fetchFromGitHub {
23 owner = "jpadilla";
24 repo = "pyjwt";
25 rev = "refs/tags/${version}";
26 hash = "sha256-z1sqaSeign0ZDFcg94cli0fIVBxcK14VUlgP+mSaxRA=";
27 };
28
29 outputs = [
30 "out"
31 "doc"
32 ];
33
34 build-system = [ setuptools ];
35
36 nativeBuildInputs = [
37 sphinxHook
38 sphinx-rtd-theme
39 zope-interface
40 ];
41
42 optional-dependencies.crypto = [ cryptography ];
43
44 nativeCheckInputs = [ pytestCheckHook ] ++ (lib.flatten (lib.attrValues optional-dependencies));
45
46 disabledTests = [
47 # requires internet connection
48 "test_get_jwt_set_sslcontext_default"
49 ];
50
51 pythonImportsCheck = [ "jwt" ];
52
53 passthru.tests = {
54 inherit oauthlib;
55 };
56
57 meta = with lib; {
58 changelog = "https://github.com/jpadilla/pyjwt/blob/${version}/CHANGELOG.rst";
59 description = "JSON Web Token implementation in Python";
60 homepage = "https://github.com/jpadilla/pyjwt";
61 license = licenses.mit;
62 maintainers = with maintainers; [ prikhi ];
63 };
64}