diff --git a/pkgs/by-name/fa/fava/package.nix b/pkgs/by-name/fa/fava/package.nix index cf346b7c36406..37d8581506fc4 100644 --- a/pkgs/by-name/fa/fava/package.nix +++ b/pkgs/by-name/fa/fava/package.nix @@ -1,17 +1,17 @@ { lib, - python3Packages, fetchPypi, + python3Packages, }: python3Packages.buildPythonApplication rec { pname = "fava"; - version = "1.29"; + version = "1.30"; pyproject = true; src = fetchPypi { inherit pname version; - hash = "sha256-UZZ142FchYXqPtHb6EWnKjV+xtJ0Gvu+SovTH6+kVn8="; + hash = "sha256-HBvsFflKGPVlHc9pHB8VCGGD1WLDT9TbjL1V41C3hKU="; }; postPatch = '' @@ -24,6 +24,8 @@ python3Packages.buildPythonApplication rec { dependencies = with python3Packages; [ babel beancount + beangulp + beanquery cheroot click flask @@ -39,9 +41,14 @@ python3Packages.buildPythonApplication rec { nativeCheckInputs = [ python3Packages.pytestCheckHook ]; - preCheck = '' - export HOME=$TEMPDIR - ''; + preCheck = + '' + export HOME=$TEMPDIR + '' + # Disable some tests when building with beancount2 + + lib.optionalString (lib.versions.major python3Packages.beancount.version == "2") '' + export SNAPSHOT_IGNORE=true + ''; meta = with lib; { description = "Web interface for beancount"; diff --git a/pkgs/development/python-modules/beancount/3.nix b/pkgs/development/python-modules/beancount/3.nix new file mode 100644 index 0000000000000..d84eb69324fca --- /dev/null +++ b/pkgs/development/python-modules/beancount/3.nix @@ -0,0 +1,66 @@ +{ + lib, + beautifulsoup4, + buildPythonPackage, + click, + fetchPypi, + isPy3k, + meson, + meson-python, + pytestCheckHook, + python-dateutil, + regex, +}: + +buildPythonPackage rec { + version = "3.0.0"; + pname = "beancount"; + pyproject = true; + + disabled = !isPy3k; + + src = fetchPypi { + inherit pname version; + hash = "sha256-z2aGhpx+o+78CU7hPthmv196K7DGHk1PXfPjX4Rs/98="; + }; + + # Tests require files not included in the PyPI archive. + # Also there is an import error after migration to meson build. + doCheck = false; + + build-system = [ + meson + meson-python + ]; + + depedencies = [ + click + python-dateutil + regex + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + propagatedBuildInputs = [ + beautifulsoup4 + click + python-dateutil + regex + ]; + + pythonImportsCheck = [ "beancount" ]; + + meta = with lib; { + homepage = "https://github.com/beancount/beancount"; + description = "Double-entry bookkeeping computer language"; + longDescription = '' + A double-entry bookkeeping computer language that lets you define + financial transaction records in a text file, read them in memory, + generate a variety of reports from them, and provides a web interface. + ''; + license = licenses.gpl2Only; + maintainers = with maintainers; [ bhipple ]; + }; +} diff --git a/pkgs/development/python-modules/beangulp/default.nix b/pkgs/development/python-modules/beangulp/default.nix new file mode 100644 index 0000000000000..ce5b8e77412e2 --- /dev/null +++ b/pkgs/development/python-modules/beangulp/default.nix @@ -0,0 +1,57 @@ +{ + lib, + beancount, + buildPythonPackage, + chardet, + click, + fetchFromGitHub, + lxml, + petl, + python-magic, + pytestCheckHook, + regex, + setuptools, +}: +buildPythonPackage { + pname = "beangulp"; + version = "0.2.0-unstable-2025-01-02"; + pyproject = true; + + src = fetchFromGitHub { + owner = "beancount"; + repo = "beangulp"; + rev = "f8d2bc5da40e74461772dcb8e8394fa3c1b2a65d"; + hash = "sha256-uAVsZI+yKdtkS7b9sUIxzzrqouYVwYHopqSIrKF5mmw="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + beancount + chardet + click + lxml + python-magic + ]; + + nativeCheckInputs = [ + petl + pytestCheckHook + regex + ]; + + pythonImportsCheck = [ + "beangulp" + ]; + + meta = { + homepage = "https://github.com/beancount/beangulp"; + description = "Importers framework for Beancount"; + longDescription = '' + Beangulp provides a framework for importing transactions into a Beancoount + ledger from account statements and other documents and for managing documents. + ''; + license = lib.licenses.gpl2Only; + maintainers = with lib.maintainers; [ alapshin ]; + }; +} diff --git a/pkgs/development/python-modules/petl/default.nix b/pkgs/development/python-modules/petl/default.nix new file mode 100644 index 0000000000000..f58b2a51a862d --- /dev/null +++ b/pkgs/development/python-modules/petl/default.nix @@ -0,0 +1,42 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + pytestCheckHook, + setuptools, + setuptools-scm, +}: +buildPythonPackage rec { + pname = "petl"; + version = "1.7.15"; + pyproject = true; + + src = fetchPypi { + inherit pname version; + hash = "sha256-jjFDg4CtUVUlOYZa07GrZV3htTG9A5gMhx7Cz/SoxBQ="; + }; + + build-system = [ + setuptools + setuptools-scm + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "petl" + ]; + + meta = { + homepage = "https://github.com/petl-developers/petl"; + description = "Python Extract Transform and Load Tables of Data"; + longDescription = '' + A general purpose Python package for extracting, transforming and loading + tables of data. + ''; + license = lib.licenses.mit; + mainProgram = "petl"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b0e2a02f70d7f..b2da208ed1753 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16148,6 +16148,7 @@ with pkgs; samplv1 = libsForQt5.callPackage ../applications/audio/samplv1 { }; beancount = with python3.pkgs; toPythonApplication beancount; + beancount3 = with python3.pkgs; toPythonApplication beancount3; beancount-black = with python3.pkgs; toPythonApplication beancount-black; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c73c7c7651c67..690b3596cd3ed 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1575,6 +1575,8 @@ self: super: with self; { beancount = callPackage ../development/python-modules/beancount { }; + beancount3 = callPackage ../development/python-modules/beancount/3.nix { }; + beancount-black = callPackage ../development/python-modules/beancount-black { }; beancount-parser = callPackage ../development/python-modules/beancount-parser { }; @@ -1583,6 +1585,8 @@ self: super: with self; { beancount-plugin-utils = callPackage ../development/python-modules/beancount-plugin-utils { }; + beangulp = callPackage ../development/python-modules/beangulp { }; + beanhub-cli = callPackage ../development/python-modules/beanhub-cli { }; beanhub-extract = callPackage ../development/python-modules/beanhub-extract { }; @@ -9427,6 +9431,8 @@ self: super: with self; { nxt-python = callPackage ../development/python-modules/nxt-python { }; + petl = callPackage ../development/python-modules/petl { }; + plugp100 = callPackage ../development/python-modules/plugp100 {}; python-bugzilla = callPackage ../development/python-modules/python-bugzilla { };