1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 cryptography,
11 pycryptodome,
12
13 # tests
14 pytestCheckHook,
15}:
16
17buildPythonPackage rec {
18 pname = "joserfc";
19 version = "1.2.2";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "authlib";
24 repo = "joserfc";
25 tag = version;
26 hash = "sha256-GS1UvhOdeuyGaF/jS0zgdYkRxz6M8w4lFXcbtIPqQcY=";
27 };
28
29 build-system = [ setuptools ];
30
31 dependencies = [ cryptography ];
32
33 optional-dependencies = {
34 drafts = [ pycryptodome ];
35 };
36
37 nativeCheckInputs = [ pytestCheckHook ] ++ lib.flatten (lib.attrValues optional-dependencies);
38
39 pythonImportsCheck = [ "joserfc" ];
40
41 meta = with lib; {
42 changelog = "https://github.com/authlib/joserfc/blob/${src.tag}/docs/changelog.rst";
43 description = "Implementations of JOSE RFCs in Python";
44 homepage = "https://github.com/authlib/joserfc";
45 license = licenses.bsd3;
46 maintainers = [ ];
47 };
48}