1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonAtLeast,
6 pythonOlder,
7 attrs,
8 isodate,
9 python-dateutil,
10 rfc3986,
11 uritemplate,
12 pytestCheckHook,
13 pytest-cov-stub,
14 pytest-mock,
15}:
16
17buildPythonPackage rec {
18 pname = "csvw";
19 version = "1.11.0";
20 format = "setuptools";
21
22 disabled = pythonOlder "3.6";
23
24 src = fetchFromGitHub {
25 owner = "cldf";
26 repo = "csvw";
27 rev = "v${version}";
28 sha256 = "1393xwqawaxsflbq62vks92vv4zch8p6dd1mdvdi7j4vvf0zljkg";
29 };
30
31 propagatedBuildInputs = [
32 attrs
33 isodate
34 python-dateutil
35 rfc3986
36 uritemplate
37 ];
38
39 nativeCheckInputs = [
40 pytestCheckHook
41 pytest-cov-stub
42 pytest-mock
43 ];
44
45 disabledTests = [
46 # this test is flaky on darwin because it depends on the resolution of filesystem mtimes
47 # https://github.com/cldf/csvw/blob/45584ad63ff3002a9b3a8073607c1847c5cbac58/tests/test_db.py#L257
48 "test_write_file_exists"
49 ]
50 ++ lib.optionals (pythonAtLeast "3.10") [
51 # https://github.com/cldf/csvw/issues/58
52 "test_roundtrip_escapechar"
53 "test_escapequote_escapecharquotechar_final"
54 "test_doubleQuote"
55 ];
56
57 pythonImportsCheck = [ "csvw" ];
58
59 meta = with lib; {
60 description = "CSV on the Web";
61 homepage = "https://github.com/cldf/csvw";
62 license = licenses.asl20;
63 maintainers = [ ];
64 };
65}