From 69c5219cba9610fd4bc084043144df8e541092a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 6 Jun 2021 11:15:35 +0200 Subject: [PATCH] python3Packages.adblock: 0.4.0 -> 0.4.4 --- .../python-modules/adblock/default.nix | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/adblock/default.nix b/pkgs/development/python-modules/adblock/default.nix index 59d1f2e4e7a8..186e2e9e4437 100644 --- a/pkgs/development/python-modules/adblock/default.nix +++ b/pkgs/development/python-modules/adblock/default.nix @@ -3,7 +3,6 @@ , fetchFromGitHub , buildPythonPackage , rustPlatform -, pythonImportsCheckHook , pkg-config , openssl , publicsuffix-list @@ -11,11 +10,14 @@ , libiconv , CoreFoundation , Security +, pytestCheckHook +, toml +, python }: buildPythonPackage rec { pname = "adblock"; - version = "0.4.0"; + version = "0.4.4"; disabled = isPy27; # Pypi only has binary releases @@ -23,18 +25,18 @@ buildPythonPackage rec { owner = "ArniDagur"; repo = "python-adblock"; rev = version; - sha256 = "10d6ks2fyzbizq3kb69q478idj0h86k6ygjb6wl3zq3mf65ma4zg"; + sha256 = "sha256-zNQ8zEpTLzyU5AnFBNpOGDJ02Ogu2+xl85LA+ia7Si4="; }; cargoDeps = rustPlatform.fetchCargoTarball { inherit src; name = "${pname}-${version}"; - hash = "sha256-gEFmj3/KvhvvsOK2nX2L1RUD4Wfp3nYzEzVnQZIsIDY="; + hash = "sha256-ajVZ0xPxC31hM1gQr3DC1HWdpIYBCSmqm0z2cflcClg="; }; format = "pyproject"; - nativeBuildInputs = [ pkg-config pythonImportsCheckHook ] + nativeBuildInputs = [ pkg-config ] ++ (with rustPlatform; [ cargoSetupHook maturinBuildHook ]); buildInputs = [ openssl ] @@ -42,10 +44,19 @@ buildPythonPackage rec { PSL_PATH = "${publicsuffix-list}/share/publicsuffix/public_suffix_list.dat"; - # There are no rust tests - doCheck = false; + checkInputs = [ pytestCheckHook toml ]; - pythonImportsCheck = [ "adblock" ]; + preCheck = '' + # import from $out instead + rm -r adblock + ''; + + disabledTestPaths = [ + # relies on directory removed above + "tests/test_typestubs.py" + ]; + + pythonImportsCheck = [ "adblock" "adblock.adblock" ]; meta = with lib; { description = "Python wrapper for Brave's adblocking library, which is written in Rust";