depot/third_party/nixpkgs/pkgs/development/python-modules/courlan/default.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

58 lines
1.3 KiB
Nix

{
lib,
babel,
buildPythonPackage,
fetchPypi,
langcodes,
pytestCheckHook,
pythonOlder,
setuptools,
tld,
urllib3,
}:
buildPythonPackage rec {
pname = "courlan";
version = "1.3.0";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchPypi {
inherit pname version;
hash = "sha256-OGjziBIvKwnRVIAgQ/6S39YsPqenAOquirwFGYz4vCU=";
};
# 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
langcodes
tld
urllib3
];
nativeCheckInputs = [ pytestCheckHook ];
# disable tests that require an internet connection
disabledTests = [ "test_urlcheck" ];
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 ];
mainProgram = "courlan";
};
}