about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/clevercsv/default.nix
blob: 233b7164989ddeca76cd0b1862d154a0dc2268c6 (plain) (blame)
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
{ lib
, buildPythonPackage
, fetchFromGitHub
, chardet
, cleo
, clikit
, pandas
, regex
, tabview
, python
}:

buildPythonPackage rec {
  pname = "clevercsv";
  version = "0.6.8";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "alan-turing-institute";
    repo = "CleverCSV";
    rev = "v${version}";
    sha256 = "0jpgyh65zqr76sz2s63zsjyb49dpg2xdmf72jvpicw923bdzhqvp";
  };

  propagatedBuildInputs = [
    chardet
    cleo
    clikit
    pandas
    regex
    tabview
  ];

  pythonImportsCheck = [
    "clevercsv"
    "clevercsv.cparser"
  ];

  checkPhase = ''
    # by linking the installed version the tests also have access to compiled native libraries
    rm -r clevercsv
    ln -s $out/${python.sitePackages}/clevercsv/ clevercsv
    # their ci only runs unit tests, there are also integration and fuzzing tests
    ${python.interpreter} -m unittest discover -v -f -s ./tests/test_unit
  '';

  meta = with lib; {
    description = "CleverCSV is a Python package for handling messy CSV files";
    longDescription = ''
       CleverCSV is a Python package for handling messy CSV files. It provides
       a drop-in replacement for the builtin CSV module with improved dialect
       detection, and comes with a handy command line application for working
       with CSV files.
    '';
    homepage = "https://github.com/alan-turing-institute/CleverCSV";
    changelog = "https://github.com/alan-turing-institute/CleverCSV/blob/master/CHANGELOG.md";
    license = licenses.mit;
    maintainers = with maintainers; [ hexa ];
  };
}