From 647275a16fb9c8831db1eb1424d3463dd1817ce2 Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sat, 26 Jun 2021 15:15:46 +0200 Subject: [PATCH 1/3] pythonPackages.ofxparse: unstable-2020-02-05 -> 0.21 --- .../python-modules/ofxparse/default.nix | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/ofxparse/default.nix b/pkgs/development/python-modules/ofxparse/default.nix index 33d027f1beed..a364c7393ba8 100644 --- a/pkgs/development/python-modules/ofxparse/default.nix +++ b/pkgs/development/python-modules/ofxparse/default.nix @@ -1,6 +1,6 @@ { lib , buildPythonPackage -, fetchFromGitHub +, fetchPypi , six , beautifulsoup4 , lxml @@ -8,15 +8,11 @@ buildPythonPackage rec { pname = "ofxparse"; - version = "unstable-2020-02-05"; + version = "0.21"; - # The newer changes haven't been released yet and ledger-autosync - # depends on them: - src = fetchFromGitHub { - owner = "jseutter"; - repo = "ofxparse"; - rev = "3236cfd96434feb6bc79a8b66f3400f18e2ad3c4"; - sha256 = "1rkp174102q7hwjrg3na0qnfd612xb3r360b9blkbprjhzxy7gr7"; + src = fetchPypi { + inherit pname version; + sha256 = "19y4sp5l9jqiqzzlbqdfiab42qx7d84n4xm4s7jfq397666vcyh5"; }; propagatedBuildInputs = [ six beautifulsoup4 lxml ]; From 37635624cf506a5299095ad39dcd7eca661ea70a Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sat, 26 Jun 2021 15:16:18 +0200 Subject: [PATCH 2/3] ledger-autosync: format dependency list --- pkgs/applications/office/ledger-autosync/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/office/ledger-autosync/default.nix b/pkgs/applications/office/ledger-autosync/default.nix index 74fcf1af8f9f..47faeeccc14c 100644 --- a/pkgs/applications/office/ledger-autosync/default.nix +++ b/pkgs/applications/office/ledger-autosync/default.nix @@ -1,4 +1,11 @@ -{ lib, python3Packages, fetchFromGitHub, ledger, hledger, useLedger ? true, useHledger ? true }: +{ lib +, python3Packages +, fetchFromGitHub +, ledger +, hledger +, useLedger ? true +, useHledger ? true +}: python3Packages.buildPythonApplication rec { pname = "ledger-autosync"; From fe090d4c1348565c804bb8fc61c03dba25238056 Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sat, 26 Jun 2021 15:50:41 +0200 Subject: [PATCH 3/3] ledger-autosync: unstable-2021-04-01 -> 1.0.3 Co-authored-by: Sandro --- .../office/ledger-autosync/default.nix | 27 ++++++++++--------- .../fix-ofxparse-dependency.patch | 13 --------- 2 files changed, 14 insertions(+), 26 deletions(-) delete mode 100644 pkgs/applications/office/ledger-autosync/fix-ofxparse-dependency.patch diff --git a/pkgs/applications/office/ledger-autosync/default.nix b/pkgs/applications/office/ledger-autosync/default.nix index 47faeeccc14c..4f992c3ebe95 100644 --- a/pkgs/applications/office/ledger-autosync/default.nix +++ b/pkgs/applications/office/ledger-autosync/default.nix @@ -9,22 +9,19 @@ python3Packages.buildPythonApplication rec { pname = "ledger-autosync"; - version = "unstable-2021-04-01"; + version = "1.0.3"; + format = "pyproject"; # no tests included in PyPI tarball src = fetchFromGitHub { owner = "egh"; repo = "ledger-autosync"; - rev = "0b674c57c833f75b1a36d8caf78e1567c8e2180c"; - sha256 = "0q404gr85caib5hg83cnmgx4684l72w9slxyxrwsiwhlf7gm443q"; + rev = "v${version}"; + sha256 = "0n3y4qxsv1cyvyap95h3rj4bj1sinyfgsajygm7s8di3j5aabqr2"; }; - patches = [ - # ledger-autosync specifies an URL for its ofxparse - # dependency. This patch removes the URL to only use the - # `ofxparse` name. This works because nixpkgs' version of ofxparse - # is more recent than the latest release. - ./fix-ofxparse-dependency.patch + nativeBuildInputs = with python3Packages; [ + poetry-core ]; propagatedBuildInputs = with python3Packages; [ @@ -52,10 +49,14 @@ python3Packages.buildPythonApplication rec { # Checks require ledger as a python package, # ledger does not support python3 while ledger-autosync requires it. - checkInputs = with python3Packages; [ ledger hledger nose mock ]; - checkPhase = '' - nosetests -a generic -a ledger -a hledger - ''; + checkInputs = 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"; diff --git a/pkgs/applications/office/ledger-autosync/fix-ofxparse-dependency.patch b/pkgs/applications/office/ledger-autosync/fix-ofxparse-dependency.patch deleted file mode 100644 index cb12ba9f3351..000000000000 --- a/pkgs/applications/office/ledger-autosync/fix-ofxparse-dependency.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/setup.py b/setup.py -index eda6db5..ed6b90b 100644 ---- a/setup.py -+++ b/setup.py -@@ -38,7 +38,7 @@ setup( - install_requires=[ - 'setuptools>=26', - 'ofxclient', -- "ofxparse @ https://github.com/jseutter/ofxparse/tarball/3236cfd96434feb6bc79a8b66f3400f18e2ad3c4" -+ 'ofxparse' - ], - - extras_require={ \ No newline at end of file