nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at haskell-updates 90 lines 2.2 kB view raw
1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchFromGitLab, 6 setuptools, 7 setuptools-scm, 8 requests, 9 ndjson, 10 flask, 11 importlib-metadata, 12 swh-core, 13 swh-model, 14 swh-auth, 15 swh-web-client, 16 beautifulsoup4, 17 pytestCheckHook, 18 pytest-flask, 19 pytest-mock, 20 types-beautifulsoup4, 21 types-pyyaml, 22 types-requests, 23}: 24 25buildPythonPackage (finalAttrs: { 26 pname = "swh-scanner"; 27 version = "0.8.3"; 28 pyproject = true; 29 30 src = fetchFromGitLab { 31 domain = "gitlab.softwareheritage.org"; 32 group = "swh"; 33 owner = "devel"; 34 repo = "swh-scanner"; 35 tag = "v${finalAttrs.version}"; 36 hash = "sha256-baUUuYFapBD7iuDaDP8CSR9f4glVZcS5qBpZddVf7z8="; 37 }; 38 39 build-system = [ 40 setuptools 41 setuptools-scm 42 ]; 43 44 dependencies = [ 45 requests 46 ndjson 47 flask 48 importlib-metadata 49 swh-core 50 swh-model 51 swh-auth 52 swh-web-client 53 ]; 54 55 pythonImportsCheck = [ "swh.scanner" ]; 56 57 nativeCheckInputs = [ 58 beautifulsoup4 59 pytestCheckHook 60 pytest-flask 61 pytest-mock 62 swh-core 63 swh-model 64 types-beautifulsoup4 65 types-pyyaml 66 types-requests 67 ]; 68 69 disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [ 70 # Failed: Failed to start the server after 5 seconds. 71 "test_add_provenance_with_release" 72 "test_add_provenance_with_revision" 73 "test_scanner_result" 74 ]; 75 76 disabledTestPaths = [ 77 # pytestRemoveBytecodePhase fails with: "error (ignored): error: opening directory "/tmp/nix-build-python3.12-swh-scanner-0.8.3.drv-5/build/pytest-of-nixbld/pytest-0/test_randomdir_policy_info_cal0/big-directory/dir/dir/dir/ ......" 78 "swh/scanner/tests/test_policy.py" 79 # TypeError: CliRunner.__init__() got an unexpected keyword argument 'mix_stderr' 80 "swh/scanner/tests/test_cli.py" 81 ]; 82 83 meta = { 84 changelog = "https://gitlab.softwareheritage.org/swh/devel/swh-scanner/-/tags/${finalAttrs.src.tag}"; 85 description = "Source code scanner to analyze code bases and compare them with source code artifacts archived by Software Heritage"; 86 homepage = "https://gitlab.softwareheritage.org/swh/devel/swh-scanner"; 87 license = lib.licenses.gpl3Only; 88 maintainers = with lib.maintainers; [ drupol ]; 89 }; 90})