Files
nixpkgs/pkgs/development/python-modules/courlan/default.nix
T
Robert Schütz 1a04744f74 treewide: remove superfluous disabled
There is no need to disable Python packages for Python versions that are
no longer in Nixpkgs.
This change was generated using the following script:

    pattern='^\s*disabled\s*=\s*pythonOlder\s*"3\.\([0-9]\|10\)"\s*;\s*$'
    for f in $(find -name '*.nix'); do
        grep -q "$pattern" "$f" || continue
        sed -i "/$pattern/d" "$f"
        if [ $(grep -c pythonOlder "$f") == 1 ]; then
            sed -i '/^\s*pythonOlder,\s*$/d' "$f"
        fi
        nixfmt "$f"
    done
2026-01-11 09:34:20 -08:00

56 lines
1.3 KiB
Nix

{
lib,
babel,
buildPythonPackage,
fetchPypi,
langcodes,
pytestCheckHook,
setuptools,
tld,
urllib3,
}:
buildPythonPackage rec {
pname = "courlan";
version = "1.3.2";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-C2b02zqcOabiLdJHxyz6pX1o6mYOlLsshOx9uHEq8ZA=";
};
# 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 = {
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 = lib.licenses.asl20;
maintainers = with lib.maintainers; [ jokatzke ];
mainProgram = "courlan";
};
}