diff --git a/pkgs/development/python-modules/beanquery/default.nix b/pkgs/development/python-modules/beanquery/default.nix new file mode 100644 index 000000000000..726e6e220d88 --- /dev/null +++ b/pkgs/development/python-modules/beanquery/default.nix @@ -0,0 +1,53 @@ +{ + lib, + beancount, + click, + buildPythonPackage, + fetchFromGitHub, + python-dateutil, + pytestCheckHook, + setuptools, + tatsu, +}: +buildPythonPackage rec { + pname = "beanquery"; + version = "0.1.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "beancount"; + repo = "beanquery"; + rev = "refs/tags/v${version}"; + hash = "sha256-1+KTUvnqPceRbzY1OZwOSQdK7f78K9kSwtQfI1SUIa8="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + beancount + click + python-dateutil + tatsu + ]; + + pythonRelaxDeps = [ "tatsu" ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ + "beancount" + "beanquery" + ]; + + meta = with lib; { + homepage = "https://github.com/beancount/beanquery"; + description = "Beancount Query Language"; + longDescription = '' + A customizable light-weight SQL query tool that works on tabular data, + including Beancount. + ''; + license = licenses.gpl2Only; + maintainers = with maintainers; [ alapshin ]; + mainProgram = "bean-query"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fb7d56216dbf..2668597060bc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16525,6 +16525,8 @@ with pkgs; bean-add = callPackage ../applications/office/beancount/bean-add.nix { }; + beanquery = with python3.pkgs; toPythonApplication beanquery; + bench = # TODO: Erroneous references to GHC on aarch64-darwin: https://github.com/NixOS/nixpkgs/issues/318013 (if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 then lib.id else haskell.lib.compose.justStaticExecutables) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e97f3474650c..f7121fcc9e19 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1567,6 +1567,8 @@ self: super: with self; { beanhub-import = callPackage ../development/python-modules/beanhub-import { }; + beanquery = callPackage ../development/python-modules/beanquery { }; + beanstalkc = callPackage ../development/python-modules/beanstalkc { }; beartype = callPackage ../development/python-modules/beartype { };