summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/csvw/default.nix
blob: c5ce235b251ebef9def5982c084bbef8a6a53fa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pythonAtLeast,
  attrs,
  isodate,
  python-dateutil,
  rfc3986,
  uritemplate,
  pytestCheckHook,
  pytest-cov-stub,
  pytest-mock,
}:

buildPythonPackage rec {
  pname = "csvw";
  version = "1.11.0";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "cldf";
    repo = "csvw";
    rev = "v${version}";
    sha256 = "1393xwqawaxsflbq62vks92vv4zch8p6dd1mdvdi7j4vvf0zljkg";
  };

  propagatedBuildInputs = [
    attrs
    isodate
    python-dateutil
    rfc3986
    uritemplate
  ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-cov-stub
    pytest-mock
  ];

  disabledTests = [
    # this test is flaky on darwin because it depends on the resolution of filesystem mtimes
    # https://github.com/cldf/csvw/blob/45584ad63ff3002a9b3a8073607c1847c5cbac58/tests/test_db.py#L257
    "test_write_file_exists"
  ]
  ++ lib.optionals (pythonAtLeast "3.10") [
    # https://github.com/cldf/csvw/issues/58
    "test_roundtrip_escapechar"
    "test_escapequote_escapecharquotechar_final"
    "test_doubleQuote"
  ];

  pythonImportsCheck = [ "csvw" ];

  meta = {
    description = "CSV on the Web";
    homepage = "https://github.com/cldf/csvw";
    license = lib.licenses.asl20;
    maintainers = [ ];
  };
}