2024-05-15 15:35:15 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
babel,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
langcodes,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
|
|
|
tld,
|
|
|
|
urllib3,
|
2024-02-29 20:09:43 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "courlan";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "1.1.0";
|
|
|
|
pyproject = true;
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-1wZoQzTxi+StofvVfyaArfADZkj22ECFL3pIItOt/Y0=";
|
2024-02-29 20:09:43 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
# Tests try to write to /tmp directly. use $TMPDIR instead.
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace tests/unit_tests.py \
|
|
|
|
--replace-fail "\"courlan --help\"" "\"$out/bin/courlan --help\"" \
|
|
|
|
--replace-fail "courlan_bin = \"courlan\"" "courlan_bin = \"$out/bin/courlan\"" \
|
|
|
|
--replace-fail "/tmp" "$TMPDIR"
|
|
|
|
'';
|
|
|
|
|
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
babel
|
2024-02-29 20:09:43 +00:00
|
|
|
langcodes
|
|
|
|
tld
|
|
|
|
urllib3
|
|
|
|
];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
# disable tests that require an internet connection
|
2024-05-15 15:35:15 +00:00
|
|
|
disabledTests = [ "test_urlcheck" ];
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "courlan" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Clean, filter and sample URLs to optimize data collection";
|
|
|
|
homepage = "https://github.com/adbar/courlan";
|
|
|
|
changelog = "https://github.com/adbar/courlan/blob/v${version}/HISTORY.md";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ jokatzke ];
|
2024-05-15 15:35:15 +00:00
|
|
|
mainProgram = "courlan";
|
2024-02-29 20:09:43 +00:00
|
|
|
};
|
|
|
|
}
|