Unverified Commit cd2c9968 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #299429 from henrirosten/sbomnix-to-1.6.1

parents 4cc6ce45 70cabcb4
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, fetchFromGitHub
, pandas
, setuptools
, simplesqlite
, typing-extensions
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "df-diskcache";
  version = "0.0.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "thombashi";
    repo = "df-diskcache";
    rev = "v${version}";
    hash = "sha256-s+sqEPXw6tbEz9mnG+qeUSF6BmDssYhaDYOmraFaRbw=";
  };

  nativeBuildInputs = [ setuptools ];

  propagatedBuildInputs = [
    pandas
    simplesqlite
    typing-extensions
  ];

  preCheck = ''
    # Needed for Permission denied: '/homeless-shelter'
    export HOME=$(mktemp -d)
  '';

  nativeCheckInputs = [ pytestCheckHook ];
  pythonImportsCheck = [ "dfdiskcache" ];

  meta = with lib; {
    description = "Python library for caching pandas.DataFrame objects to local disk";
    homepage = "https://github.com/thombashi/df-diskcache";
    license = licenses.mit;
    maintainers = with maintainers; [ henrirosten ];
  };
}
+46 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, fetchFromGitHub
, dataproperty
, mbstrdecoder
, pathvalidate
, sqliteschema
, setuptools
, tabledata
, typepy
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "SimpleSQLite";
  version = "1.5.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "thombashi";
    repo = "SimpleSQLite";
    rev = "v${version}";
    hash = "sha256-Yr17T0/EwVaOjG+mzdxopivj0fuvQdZdX1bFj8vq0MM=";
  };

  nativeBuildInputs = [ setuptools ];

  propagatedBuildInputs = [
    dataproperty
    mbstrdecoder
    pathvalidate
    sqliteschema
    tabledata
    typepy
  ];

  nativeCheckInputs = [ pytestCheckHook ];
  pythonImportsCheck = [ "simplesqlite" ];

  meta = with lib; {
    description = "Python library to simplify SQLite database operations";
    homepage = "https://github.com/thombashi/simplesqlite";
    license = licenses.mit;
    maintainers = with maintainers; [ henrirosten ];
  };
}
+55 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, fetchFromGitHub
, mbstrdecoder
, setuptools
, simplesqlite
, sqliteschema
, tabledata
, typepy
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "sqliteschema";
  version = "1.4.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "thombashi";
    repo = "sqliteschema";
    rev = "v${version}";
    hash = "sha256-IzHdYBnh6udVsanWTPSsX4p4PG934YCdzs9Ow/NW86E=";
  };

  nativeBuildInputs = [ setuptools ];

  propagatedBuildInputs = [
    mbstrdecoder
    tabledata
    typepy
  ];

  nativeCheckInputs = [
    pytestCheckHook
    simplesqlite
    sqliteschema
  ];

  pythonImportsCheck = [ "sqliteschema" ];

  # Enabling tests would trigger infinite recursion due to circular
  # dependency between this package and simplesqlite.
  # Therefore, we enable tests only when building passthru.tests.
  doCheck = false;
  passthru.tests.pytest = sqliteschema.overridePythonAttrs (_: {
    doCheck = true;
  });

  meta = with lib; {
    description = "Python library to dump table schema of a SQLite database file";
    homepage = "https://github.com/thombashi/sqliteschema";
    license = licenses.mit;
    maintainers = with maintainers; [ henrirosten ];
  };
}
+49 −0
Original line number Diff line number Diff line
{ lib
, fetchFromGitHub
, nix
, python
, matplotlib
, networkx
, pandas
, pygraphviz
, setuptools
}:

python.pkgs.buildPythonApplication rec {
  version = "1.0.5-unstable-2024-01-17";
  pname = "nix-visualize";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "craigmbooth";
    repo = "nix-visualize";
    rev = "5b9beae330ac940df56433d347494505e2038904";
    hash = "sha256-VgEsR/Odddc7v6oq2tNcVwCYm08PhiqhZJueuEYCR0o=";
  };

  postInstall = ''
    wrapProgram $out/bin/nix-visualize \
      --prefix PATH : ${lib.makeBinPath [nix]}
  '';

  nativeBuildInputs = [ setuptools ];

  propagatedBuildInputs = [
    matplotlib
    networkx
    pandas
    pygraphviz
  ];

  pythonImportsCheck = [ "nix_visualize" ];
  # No tests
  doCheck = false;

  meta = with lib; {
    description = "Generate dependency graphs of a given nix package";
    mainProgram = "nix-visualize";
    homepage = "https://github.com/craigmbooth/nix-visualize";
    license = with licenses; [ asl20 ];
    maintainers = with maintainers; [ henrirosten ];
  };
}
+45 −13
Original line number Diff line number Diff line
{ lib
, fetchFromGitHub
, coreutils
, curl
, gnugrep
, gnused
, gzip
, grype
, nix
, nix-visualize
, python
  # python libs
, vulnix
, # python libs
  beautifulsoup4
, colorlog
, dfdiskcache
, graphviz
, numpy
, packageurl-python
, packaging
, pandas
, pyrate-limiter
, requests
, requests-cache
, requests-ratelimiter
, reuse
, setuptools
, tabulate
,
}:

python.pkgs.buildPythonApplication rec {
  pname = "sbomnix";
  version = "1.4.5";
  version = "1.6.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "tiiuae";
    repo = pname;
    repo = "sbomnix";
    rev = "refs/tags/v${version}";
    hash = "sha256-RxDFxVGivVBw2uhtzf231Q2HHTBFKSqGrknr2Es/ygM=";
    hash = "sha256-kPjCK9NEs3D0qFsSSVX6MYGKbwqeij0svTfzz5JC4qM=";

    # Remove documentation as it contains references to nix store
    postFetch = ''
      rm -fr "$out"/doc
      find "$out" -name '*.md' ! -name "README.md" -exec rm -f '{}' \;
    '';
  };

  makeWrapperArgs = [
    "--prefix PATH : ${lib.makeBinPath [ coreutils curl gnugrep gnused gzip graphviz nix ]}"
  ];
  postInstall = ''
    wrapProgram $out/bin/sbomnix \
      --prefix PATH : ${lib.makeBinPath [nix graphviz]}
    wrapProgram $out/bin/nixgraph \
      --prefix PATH : ${lib.makeBinPath [nix graphviz]}
    wrapProgram $out/bin/vulnxscan \
      --prefix PATH : ${lib.makeBinPath [grype nix vulnix]}
    wrapProgram $out/bin/nix_outdated \
      --prefix PATH : ${lib.makeBinPath [nix-visualize]}
    wrapProgram $out/bin/provenance \
      --prefix PATH : ${lib.makeBinPath [nix]}
  '';

  nativeBuildInputs = [ setuptools ];

  propagatedBuildInputs = [
    beautifulsoup4
    colorlog
    dfdiskcache
    graphviz
    numpy
    packageurl-python
    packaging
    pandas
    pyrate-limiter
    requests
    requests-cache
    requests-ratelimiter
    reuse
    tabulate
  ];

  pythonImportsCheck = [ "sbomnix" ];
  # Tests require network access
  doCheck = false;

  meta = with lib; {
    description = "Generate SBOMs for nix targets";
    description = "Utilities to help with software supply chain challenges on nix targets";
    homepage = "https://github.com/tiiuae/sbomnix";
    license = with licenses; [ asl20 bsd3 cc-by-30 ];
    maintainers = with maintainers; [ henrirosten jk ];
Loading