1{ lib
2, buildPythonPackage
3, cryptography
4, fetchpatch
5, fetchPypi
6, pyopenssl
7, pytestCheckHook
8, pythonOlder
9}:
10
11buildPythonPackage rec {
12 pname = "josepy";
13 version = "1.13.0";
14 format = "setuptools";
15
16 disabled = pythonOlder "3.6";
17
18 src = fetchPypi {
19 inherit pname version;
20 hash = "sha256-iTHa84+KTIUnSg6LfLJa3f2NHyj5+4++0FPdUa7HXck=";
21 };
22
23 patches = [
24 # https://github.com/certbot/josepy/pull/158
25 (fetchpatch {
26 name = "fix-setuptools-deprecation.patch";
27 url = "https://github.com/certbot/josepy/commit/8f1b4b57a29a868a87fd6eee19a67a7ebfc07ea1.patch";
28 hash = "sha256-9d+Bk/G4CJXpnjJU0YkXLsg0G3tPxR8YN2niqriQQkI=";
29 includes = [ "tests/test_util.py" ];
30 })
31 ];
32
33 propagatedBuildInputs = [
34 pyopenssl
35 cryptography
36 ];
37
38 nativeCheckInputs = [
39 pytestCheckHook
40 ];
41
42 postPatch = ''
43 substituteInPlace pytest.ini \
44 --replace " --flake8 --cov-report xml --cov-report=term-missing --cov=josepy --cov-config .coveragerc" ""
45 sed -i '/flake8-ignore/d' pytest.ini
46 '';
47
48 pythonImportsCheck = [
49 "josepy"
50 ];
51
52 meta = with lib; {
53 description = "JOSE protocol implementation in Python";
54 homepage = "https://github.com/jezdez/josepy";
55 license = licenses.asl20;
56 maintainers = with maintainers; [ ];
57 };
58}