18 buildPythonPackage rec {
23 disabled = pythonOlder "3.7";
25 # Pypi only has binary releases
26 src = fetchFromGitHub {
28 repo = "python-adblock";
29 rev = "refs/tags/${version}";
30 hash = "sha256-5g5xdUzH/RTVwu4Vfb5Cb1t0ruG0EXgiXjrogD/+JCU=";
34 # https://github.com/ArniDagur/python-adblock/pull/91
36 name = "pep-621-compat.patch";
37 url = "https://github.com/ArniDagur/python-adblock/commit/2a8716e0723b60390f0aefd0e05f40ba598ac73f.patch";
38 hash = "sha256-n9+LDs0no66OdNZxw3aU57ngWrAbmm6hx4qIuxXoatM=";
43 substituteInPlace pyproject.toml \
44 --replace "0.0.0" "${version}"
47 cargoDeps = rustPlatform.fetchCargoTarball {
49 name = "${pname}-${version}";
50 hash = "sha256-1xmYmF5P7a5O9MilxDy+CVhmWMGRetdM2fGvTPy7JmM=";
55 ] ++ (with rustPlatform; [
62 ] ++ lib.optionals stdenv.isDarwin [
68 PSL_PATH = "${publicsuffix-list}/share/publicsuffix/public_suffix_list.dat";
76 # import from $out instead
81 # relies on directory removed above
82 "tests/test_typestubs.py"
85 pythonImportsCheck = [
91 description = "Python wrapper for Brave's adblocking library";
92 homepage = "https://github.com/ArniDagur/python-adblock/";
93 changelog = "https://github.com/ArniDagur/python-adblock/blob/${version}/CHANGELOG.md";
94 maintainers = with maintainers; [ dotlambda ];
95 license = with licenses; [ asl20 /* or */ mit ];