Unverified Commit de8e3a03 authored by Fabian Affolter's avatar Fabian Affolter Committed by GitHub
Browse files

python312Packages.graphtage: refactor (#339785)

parents 541ae527 93e069f9
Loading
Loading
Loading
Loading
+55 −0
Original line number Diff line number Diff line
{
  lib,
  astunparse,
  buildPythonPackage,
  distutils,
  fetchFromGitHub,
  fickling,
  flit-core,
  numpy,
  pytestCheckHook,
  pythonOlder,
  torch,
  torchvision,
}:

buildPythonPackage rec {
  pname = "fickling";
  version = "0.1.3";
  pyproject = true;

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "trailofbits";
    repo = "fickling";
    rev = "refs/tags/v${version}";
    hash = "sha256-/cV1XhJ8KMFby9nZ/qXEYxf+P6352Q2DZOLuvebyuHQ=";
  };

  build-system = [
    distutils
    flit-core
  ];

  dependencies = [ astunparse ];

  optional-dependencies = {
    torch = [
      torch
      torchvision
    ];
  };

  nativeCheckInputs = [ pytestCheckHook ] ++ lib.flatten (builtins.attrValues optional-dependencies);

  pythonImportsCheck = [ "fickling" ];

  meta = with lib; {
    description = "A Python pickling decompiler and static analyzer";
    homepage = "https://github.com/trailofbits/fickling";
    changelog = "https://github.com/trailofbits/fickling/releases/tag/v${version}";
    license = licenses.lgpl3Plus;
    maintainers = with maintainers; [ ];
  };
}
+18 −12
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pytestCheckHook,
  pythonOlder,
  colorama,
  distutils,
  fetchFromGitHub,
  fickling,
  intervaltree,
  json5,
  pytestCheckHook,
  pythonOlder,
  pyyaml,
  scipy,
  setuptools,
  tqdm,
  typing-extensions,
}:
@@ -16,24 +19,27 @@
buildPythonPackage rec {
  pname = "graphtage";
  version = "0.3.1";
  format = "setuptools";
  pyproject = true;

  disabled = pythonOlder "3.6";
  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "trailofbits";
    repo = pname;
    repo = "graphtage";
    rev = "refs/tags/v${version}";
    hash = "sha256-Bz2T8tVdVOdXt23yPITkDNL46Y5LZPhY3SXZ5bF3CHw=";
  };

  postPatch = ''
    substituteInPlace setup.py \
      --replace "json5==0.9.5" "json5>=0.9.5"
  '';
  pythonRelaxDeps = [ "json5" ];

  build-system = [
    distutils
    setuptools
  ];

  propagatedBuildInputs = [
  dependencies = [
    colorama
    fickling
    intervaltree
    json5
    pyyaml
@@ -48,10 +54,10 @@ buildPythonPackage rec {

  meta = with lib; {
    description = "Utility to diff tree-like files such as JSON and XML";
    mainProgram = "graphtage";
    homepage = "https://github.com/trailofbits/graphtage";
    changelog = "https://github.com/trailofbits/graphtage/releases/tag/v${version}";
    license = licenses.lgpl3Plus;
    maintainers = with maintainers; [ veehaitch ];
    mainProgram = "graphtage";
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -4358,6 +4358,8 @@ self: super: with self; {
  fiblary3-fork = callPackage ../development/python-modules/fiblary3-fork { };
  fickling = callPackage ../development/python-modules/fickling { };
  fido2 = callPackage ../development/python-modules/fido2 { };
  fields = callPackage ../development/python-modules/fields { };