1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 future,
7 pytestCheckHook,
8}:
9
10buildPythonPackage rec {
11 pname = "asn1";
12 version = "2.7.0";
13 format = "setuptools";
14
15 disabled = pythonOlder "3.7";
16
17 src = fetchFromGitHub {
18 owner = "andrivet";
19 repo = "python-asn1";
20 rev = "refs/tags/v${version}";
21 hash = "sha256-pXLG2Mkrv6EeJn6Dk+SefzNtrPdQ6of95LbVTKjTADQ=";
22 };
23
24 propagatedBuildInputs = [ future ];
25
26 nativeCheckInputs = [ pytestCheckHook ];
27
28 postPatch = ''
29 substituteInPlace setup.py \
30 --replace "enum-compat" ""
31 '';
32
33 pytestFlagsArray = [ "tests/test_asn1.py" ];
34
35 pythonImportsCheck = [ "asn1" ];
36
37 meta = with lib; {
38 description = "Python ASN.1 encoder and decoder";
39 homepage = "https://github.com/andrivet/python-asn1";
40 changelog = "https://github.com/andrivet/python-asn1/blob/v${version}/CHANGELOG.rst";
41 license = licenses.mit;
42 maintainers = with maintainers; [ fab ];
43 };
44}