2021-04-26 19:14:03 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2021-10-01 09:20:50 +00:00
|
|
|
, cchardet
|
2021-04-26 19:14:03 +00:00
|
|
|
, chardet
|
|
|
|
, pandas
|
|
|
|
, regex
|
|
|
|
, tabview
|
|
|
|
, python
|
2022-09-30 11:47:45 +00:00
|
|
|
, pytestCheckHook
|
2021-04-26 19:14:03 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "clevercsv";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "0.7.5";
|
2021-04-26 19:14:03 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "alan-turing-institute";
|
|
|
|
repo = "CleverCSV";
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-zpnUw0ThYbbYS7CYgsi0ZL1qxbY4B1cy2NhrUU9uzig=";
|
2021-04-26 19:14:03 +00:00
|
|
|
};
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "packaging>=23.0" "packaging"
|
|
|
|
'';
|
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
propagatedBuildInputs = [
|
2021-10-01 09:20:50 +00:00
|
|
|
cchardet
|
2021-04-26 19:14:03 +00:00
|
|
|
chardet
|
|
|
|
pandas
|
|
|
|
regex
|
|
|
|
tabview
|
|
|
|
];
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"clevercsv"
|
|
|
|
"clevercsv.cparser"
|
|
|
|
];
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
preCheck = ''
|
2021-04-26 19:14:03 +00:00
|
|
|
# by linking the installed version the tests also have access to compiled native libraries
|
|
|
|
rm -r clevercsv
|
|
|
|
ln -s $out/${python.sitePackages}/clevercsv/ clevercsv
|
|
|
|
'';
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
# their ci only runs unit tests, there are also integration and fuzzing tests
|
2022-09-30 11:47:45 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"./tests/test_unit"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# ModuleNotFoundError: No module named 'wilderness'
|
|
|
|
"tests/test_unit/test_console.py"
|
|
|
|
];
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "CleverCSV is a Python package for handling messy CSV files";
|
|
|
|
longDescription = ''
|
2022-09-09 14:08:57 +00:00
|
|
|
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.
|
2021-04-26 19:14:03 +00:00
|
|
|
'';
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|