at 23.11-beta 1.9 kB view raw
1{ stdenv 2, lib 3, buildPythonPackage 4, pythonOlder 5, fetchFromGitHub 6, six 7, decorator 8, nose 9, krb5 10, GSS 11, parameterized 12, shouldbe 13, cython 14, python 15, k5test 16}: 17 18buildPythonPackage rec { 19 pname = "gssapi"; 20 version = "1.8.3"; 21 disabled = pythonOlder "3.6"; 22 23 src = fetchFromGitHub { 24 owner = "pythongssapi"; 25 repo = "python-${pname}"; 26 rev = "refs/tags/v${version}"; 27 hash = "sha256-H1JfdvxJvX5dmC9aTqIOkjAqFEL44KoUXEhoYj2uRY8="; 28 }; 29 30 # It's used to locate headers 31 postPatch = '' 32 substituteInPlace setup.py \ 33 --replace 'get_output(f"{kc} gssapi --prefix")' '"${lib.getDev krb5}"' 34 ''; 35 36 env = lib.optionalAttrs (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) { 37 GSSAPI_SUPPORT_DETECT = "false"; 38 }; 39 40 nativeBuildInputs = [ 41 cython 42 krb5 43 ]; 44 45 propagatedBuildInputs = [ 46 decorator 47 six 48 ]; 49 50 buildInputs = lib.optionals stdenv.isDarwin [ 51 GSS 52 ]; 53 54 nativeCheckInputs = [ 55 k5test 56 nose 57 parameterized 58 shouldbe 59 six 60 ]; 61 62 doCheck = pythonOlder "3.8" # `shouldbe` not available 63 && !stdenv.isDarwin; # many failures on darwin 64 65 # skip tests which fail possibly due to be an upstream issue (see 66 # https://github.com/pythongssapi/python-gssapi/issues/220) 67 checkPhase = '' 68 # some tests don't respond to being disabled through nosetests -x 69 echo $'\ndel CredsTestCase.test_add_with_impersonate' >> gssapi/tests/test_high_level.py 70 echo $'\ndel TestBaseUtilities.test_acquire_creds_impersonate_name' >> gssapi/tests/test_raw.py 71 echo $'\ndel TestBaseUtilities.test_add_cred_impersonate_name' >> gssapi/tests/test_raw.py 72 73 export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH" 74 nosetests -e 'ext_test_\d.*' 75 ''; 76 pythonImportsCheck = [ "gssapi" ]; 77 78 meta = with lib; { 79 homepage = "https://pypi.python.org/pypi/gssapi"; 80 description = "Python GSSAPI Wrapper"; 81 license = licenses.mit; 82 }; 83}