Unverified Commit bd909c86 authored by Robert Schütz's avatar Robert Schütz Committed by GitHub
Browse files

Merge pull request #334202 from dotlambda/ledger-autosync

ledger-autosync: fix build with Python 3.12 and don't propagate ledger and hledger
parents 9e023b01 9faf61f9
Loading
Loading
Loading
Loading
+64 −0
Original line number Diff line number Diff line
{ lib
, python3Packages
, fetchFromGitHub
, ledger
, hledger
, useLedger ? true
, useHledger ? true
{
  lib,
  python3Packages,
  fetchFromGitHub,
  fetchpatch2,
  ledger,
  hledger,
}:

python3Packages.buildPythonApplication rec {
  pname = "ledger-autosync";
  version = "1.0.3";
  format = "pyproject";
  pyproject = true;

  # no tests included in PyPI tarball
  src = fetchFromGitHub {
    owner = "egh";
    repo = "ledger-autosync";
    rev = "v${version}";
    sha256 = "0n3y4qxsv1cyvyap95h3rj4bj1sinyfgsajygm7s8di3j5aabqr2";
    hash = "sha256-IuOlVJEjNqRPfV4q/Zy3UQe5iMwDlnSV356FrTsmflg=";
  };

  nativeBuildInputs = with python3Packages; [
    poetry-core
  patches = [
    (fetchpatch2 {
      name = "drop-distutils.patch";
      url = "https://github.com/egh/ledger-autosync/commit/b7a2a185b9c3b17764322dcc80153410d12e6a5f.patch";
      hash = "sha256-qKuTpsNFuS00yRAH4VGpMA249ml0BGZsGVb75WrBWEo=";
    })
    (fetchpatch2 {
      name = "drop-imp.patch";
      url = "https://github.com/egh/ledger-autosync/commit/453d92ad279e6c90fadf835d1c39189a1179eb17.patch";
      hash = "sha256-mncMvdWldAnVDy1+bJ+oyDOrUb14v9LrBRz/CYrtYbc=";
    })
  ];

  propagatedBuildInputs = with python3Packages; [
    asn1crypto
    beautifulsoup4
    cffi
    cryptography
    entrypoints
    fuzzywuzzy
    idna
    jeepney
    keyring
    lxml
    mock
    nose
  build-system = with python3Packages; [ poetry-core ];

  dependencies = with python3Packages; [
    ofxclient
    ofxhome
    ofxparse
    pbr
    pycparser
    secretstorage
    six
  ] ++ lib.optional useLedger ledger
    ++ lib.optional useHledger hledger;
  ];

  # Checks require ledger as a python package,
  # ledger does not support python3 while ledger-autosync requires it.
  nativeCheckInputs = with python3Packages; [ ledger hledger nose mock pytestCheckHook ];
  nativeCheckInputs = [
    hledger
    ledger
    python3Packages.ledger
    python3Packages.pytestCheckHook
  ];

  # Disable some non-passing tests:
  # https://github.com/egh/ledger-autosync/issues/127
@@ -60,8 +56,9 @@ python3Packages.buildPythonApplication rec {

  meta = with lib; {
    homepage = "https://github.com/egh/ledger-autosync";
    changelog = "https://github.com/egh/ledger-autosync/releases/tag/v${version}";
    description = "OFX/CSV autosync for ledger and hledger";
    license = licenses.gpl3;
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ eamsden ];
  };
}
+0 −2
Original line number Diff line number Diff line
@@ -31692,8 +31692,6 @@ with pkgs;
    inherit (darwin.apple_sdk.frameworks) Foundation;
  };
  ledger-autosync = callPackage  ../applications/office/ledger-autosync { };
  ledger-web = callPackage ../applications/office/ledger-web { };
  ledger2beancount = callPackage ../tools/text/ledger2beancount { };