Merge pull request #334202 from dotlambda/ledger-autosync

ledger-autosync: fix build with Python 3.12 and don't propagate ledger and hledger
This commit is contained in:
Robert Schütz
2024-08-13 00:58:36 -07:00
committed by GitHub
3 changed files with 64 additions and 69 deletions
@@ -1,67 +0,0 @@
{ lib
, python3Packages
, fetchFromGitHub
, ledger
, hledger
, useLedger ? true
, useHledger ? true
}:
python3Packages.buildPythonApplication rec {
pname = "ledger-autosync";
version = "1.0.3";
format = "pyproject";
# no tests included in PyPI tarball
src = fetchFromGitHub {
owner = "egh";
repo = "ledger-autosync";
rev = "v${version}";
sha256 = "0n3y4qxsv1cyvyap95h3rj4bj1sinyfgsajygm7s8di3j5aabqr2";
};
nativeBuildInputs = with python3Packages; [
poetry-core
];
propagatedBuildInputs = with python3Packages; [
asn1crypto
beautifulsoup4
cffi
cryptography
entrypoints
fuzzywuzzy
idna
jeepney
keyring
lxml
mock
nose
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 ];
# Disable some non-passing tests:
# https://github.com/egh/ledger-autosync/issues/127
disabledTests = [
"test_payee_match"
"test_args_only"
];
meta = with lib; {
homepage = "https://github.com/egh/ledger-autosync";
description = "OFX/CSV autosync for ledger and hledger";
license = licenses.gpl3;
maintainers = with maintainers; [ eamsden ];
};
}
@@ -0,0 +1,64 @@
{
lib,
python3Packages,
fetchFromGitHub,
fetchpatch2,
ledger,
hledger,
}:
python3Packages.buildPythonApplication rec {
pname = "ledger-autosync";
version = "1.0.3";
pyproject = true;
# no tests included in PyPI tarball
src = fetchFromGitHub {
owner = "egh";
repo = "ledger-autosync";
rev = "v${version}";
hash = "sha256-IuOlVJEjNqRPfV4q/Zy3UQe5iMwDlnSV356FrTsmflg=";
};
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=";
})
];
build-system = with python3Packages; [ poetry-core ];
dependencies = with python3Packages; [
ofxclient
ofxparse
];
nativeCheckInputs = [
hledger
ledger
python3Packages.ledger
python3Packages.pytestCheckHook
];
# Disable some non-passing tests:
# https://github.com/egh/ledger-autosync/issues/127
disabledTests = [
"test_payee_match"
"test_args_only"
];
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.gpl3Plus;
maintainers = with maintainers; [ eamsden ];
};
}
-2
View File
@@ -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 { };