Skip to content
Snippets Groups Projects
zkapauthorizer.nix 1.61 KiB
Newer Older
  • Learn to ignore specific revisions
  • { buildPythonPackage, sphinx, circleci-cli
    
    , attrs, zope_interface, aniso8601, twisted, tahoe-lafs, privacypass
    
    , fixtures, testtools, hypothesis, pyflakes, treq, coverage
    
    , collectCoverage ? false
    
    , testSuite ? null
    
    let
      hypothesisProfile' = if hypothesisProfile == null then "default" else hypothesisProfile;
    
      testSuite' = if testSuite == null then "_zkapauthorizer" else testSuite;
    
      extraTrialArgs = builtins.concatStringsSep " " (if trialArgs == null then ["--rterrors" "--jobs=4" ] else trialArgs);
    
    buildPythonPackage rec {
      version = "0.0";
    
      pname = "zero-knowledge-access-pass-authorizer";
      name = "${pname}-${version}";
    
      outputs = [ "out" ] ++ (if collectCoverage then [ "doc" ] else [ ]);
    
      depsBuildBuild = [
        sphinx
        circleci-cli
      ];
    
    
      propagatedBuildInputs = [
    
        fixtures
    
        hypothesis
    
        "${pyflakes}/bin/pyflakes" src/_zkapauthorizer
    
        ZKAPAUTHORIZER_HYPOTHESIS_PROFILE=${hypothesisProfile'} python -m ${if collectCoverage
    
          then "coverage run --branch --source _zkapauthorizer,twisted.plugins.zkapauthorizer --module"
          else ""
    
        } twisted.trial ${extraTrialArgs} ${testSuite'}
    
      postCheck = if collectCoverage
        then ''
    
        python -m coverage html
        mkdir -p "$doc/share/doc/${name}"
        cp -vr .coverage htmlcov "$doc/share/doc/${name}"
    
        python -m coverage report