Unverified Commit 8207ad0d authored by Pol Dellaiera's avatar Pol Dellaiera Committed by GitHub
Browse files

python312Packages.rbtools: fix (#414886)

parents d7ed3c0d ecfff368
Loading
Loading
Loading
Loading
+36 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  typing-extensions,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "housekeeping";
  version = "1.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "beanbaginc";
    repo = "housekeeping";
    tag = "release-${version}";
    hash = "sha256-hRWZSRoXscjkUm0NUpkM6pKEdoirN6ZmpjWlNgoyCVY=";
  };

  build-system = [ setuptools ];

  dependencies = [ typing-extensions ];

  pythonImportsCheck = [ "housekeeping" ];

  nativeCheckInputs = [ pytestCheckHook ];

  meta = {
    description = "Reusable deprecation helpers for Python projects";
    homepage = "https://github.com/beanbaginc/housekeeping";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ emaryn ];
  };
}
+33 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "kgb";
  version = "7.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "beanbaginc";
    repo = "kgb";
    tag = "release-${version}";
    hash = "sha256-hNJXoUIyrCB9PCWLCmN81F6pBRwZApDR6JWA0adyklw=";
  };

  build-system = [ setuptools ];

  pythonImportsCheck = [ "kgb" ];

  nativeCheckInputs = [ pytestCheckHook ];

  meta = {
    description = "Python function spy support for unit tests";
    homepage = "https://github.com/beanbaginc/kgb";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ emaryn ];
  };
}
+47 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  six,
  pytestCheckHook,
  kgb,
}:

buildPythonPackage rec {
  pname = "pydiffx";
  version = "1.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "beanbaginc";
    repo = "diffx";
    tag = "pydiffx/release-${version}";
    hash = "sha256-oJjHrg1X02SmNJKbWbTPc0kycI+jLj0C4eUFFXwb+TA=";
  };

  sourceRoot = "${src.name}/python";

  postPatch = ''
    substituteInPlace pydiffx/tests/testcases.py \
      --replace-fail "assertRaisesRegexp" "assertRaisesRegex"
  '';

  build-system = [ setuptools ];

  dependencies = [ six ];

  pythonImportsCheck = [ "pydiffx" ];

  nativeCheckInputs = [
    pytestCheckHook
    kgb
  ];

  meta = {
    description = "DiffX file format and utilities";
    homepage = "https://github.com/beanbaginc/diffx";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ emaryn ];
  };
}
+59 −15
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchurl,
  fetchFromGitHub,
  isPy3k,
  setuptools,
  colorama,
  six,
  texttable,
  tqdm,
  certifi,
  housekeeping,
  puremagic,
  pydiffx,
  typing-extensions,
  importlib-metadata,
  importlib-resources,
  packaging,
  pytestCheckHook,
  pytest-env,
  kgb,
  gitSetupHook,
  gitFull,
  subversion,
}:

buildPythonPackage rec {
  pname = "rbtools";
  version = "5.2.1";
  format = "setuptools";

  pyproject = true;
  disabled = !isPy3k;

  src = fetchurl {
    url = "https://downloads.reviewboard.org/releases/RBTools/${lib.versions.majorMinor version}/RBTools-${version}.tar.gz";
    sha256 = "f2863515ef6ff1cfcd3905d5f409ab8c4d12878b364d6f805ba848dcaecb97f2";
  src = fetchFromGitHub {
    owner = "reviewboard";
    repo = "rbtools";
    tag = "release-${version}";
    hash = "sha256-Ci9lHlP2X95y7ldHBbqb5qWozPj3TJ0AxeVhqzVsdFA=";
  };

  propagatedBuildInputs = [
    six
  build-system = [ setuptools ];

  dependencies = [
    texttable
    tqdm
    colorama
    setuptools
    certifi
    housekeeping
    puremagic
    pydiffx
    typing-extensions
    importlib-metadata
    importlib-resources
    packaging
  ];

  pythonRelaxDeps = [ "pydiffx" ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-env
    kgb
    gitSetupHook
    gitFull
    subversion
  ];

  # The kgb test dependency is not in nixpkgs
  doCheck = false;
  disabledTestPaths = [
    "rbtools/utils/tests/test_repository.py::RepositoryMatchTests::test_find_matching_server_repository_no_match" # AttributeError: 'APICache' object has no attribute 'db'
    # kgb.errors.ExistingSpyError
    "rbtools/utils/tests/test_repository.py::RepositoryMatchTests::test_find_matching_server_repository_with_mirror_path_match"
    "rbtools/utils/tests/test_repository.py::RepositoryMatchTests::test_find_matching_server_repository_with_multiple_matches"
    "rbtools/utils/tests/test_repository.py::RepositoryMatchTests::test_find_matching_server_repository_with_path_match"
    "rbtools/diffs/tests/test_apple_diff_tool.py::AppleDiffToolTests::test_run_diff_file_with_text_differences" # AssertionError: b'---[38 chars]0000 +0000\n+++ /path2.txt\t2022-09-26 10:20:3[42 chars]ar\n' != b'---[38 chars]0000 -0700\n+++ /path2.txt\t2022-09-26 10:20:3[42 chars]ar\n'
    # rbtools.utils.process.RunProcessError: Unexpected error executing the command: svn co file:///build/source/rbtools/clients/tests/testdata/svn-repo /build/rbtools._bw2ih4g/working/svn-repo
    "rbtools/clients/tests/test_svn.py"
    "rbtools/utils/tests/test_source_tree.py"
    "rbtools/clients/tests/test_scanning.py::ScanningTests::test_scanning_nested_repos_1"
    "rbtools/clients/tests/test_scanning.py::ScanningTests::test_scanning_nested_repos_2"
  ];

  meta = with lib; {
  meta = {
    homepage = "https://www.reviewboard.org/docs/rbtools/dev/";
    description = "RBTools is a set of command line tools for working with Review Board and RBCommons";
    mainProgram = "rbt";
    license = licenses.mit;
    maintainers = with maintainers; [ domenkozar ];
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ domenkozar ];
  };
}
+6 −0
Original line number Diff line number Diff line
@@ -6482,6 +6482,8 @@ self: super: with self; {
  horizon-eda = callPackage ../development/python-modules/horizon-eda { inherit (pkgs) horizon-eda; };
  housekeeping = callPackage ../development/python-modules/housekeeping { };
  howdoi = callPackage ../development/python-modules/howdoi { };
  hpack = callPackage ../development/python-modules/hpack { };
@@ -7553,6 +7555,8 @@ self: super: with self; {
  kfactory = callPackage ../development/python-modules/kfactory { };
  kgb = callPackage ../development/python-modules/kgb { };
  khanaa = callPackage ../development/python-modules/khanaa { };
  kicad = toPythonModule (pkgs.kicad.override { python3 = python; }).src;
@@ -12377,6 +12381,8 @@ self: super: with self; {
  pydicom-seg = callPackage ../development/python-modules/pydicom-seg { };
  pydiffx = callPackage ../development/python-modules/pydiffx { };
  pydigiham = callPackage ../development/python-modules/pydigiham { };
  pydiscourse = callPackage ../development/python-modules/pydiscourse { };