2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
2023-04-12 12:48:02 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# propagates
|
|
|
|
chardet,
|
|
|
|
regex,
|
|
|
|
packaging,
|
2023-04-12 12:48:02 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# optionals
|
|
|
|
faust-cchardet,
|
|
|
|
pandas,
|
|
|
|
tabview,
|
|
|
|
# TODO: , wilderness
|
2023-04-12 12:48:02 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# tests
|
|
|
|
python,
|
|
|
|
pytestCheckHook,
|
2021-04-26 19:14:03 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "clevercsv";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.8.2";
|
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}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-yyPUNFDq9W5OW1muHtQ10QgAHhXI8w7CY77fsWhIy0k=";
|
2021-04-26 19:14:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
chardet
|
|
|
|
regex
|
2023-04-12 12:48:02 +00:00
|
|
|
packaging
|
2021-04-26 19:14:03 +00:00
|
|
|
];
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
full = [
|
|
|
|
faust-cchardet
|
|
|
|
pandas
|
|
|
|
tabview
|
|
|
|
# TODO: wilderness
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ] ++ passthru.optional-dependencies.full;
|
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
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestFlagsArray = [ "./tests/test_unit" ];
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
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";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "clevercsv";
|
2021-04-26 19:14:03 +00:00
|
|
|
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";
|
2023-03-24 00:07:29 +00:00
|
|
|
changelog = "https://github.com/alan-turing-institute/CleverCSV/blob/${src.rev}/CHANGELOG.md";
|
2021-04-26 19:14:03 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ hexa ];
|
|
|
|
};
|
|
|
|
}
|