diff --git a/pkgs/applications/version-management/commitizen/default.nix b/pkgs/development/python-modules/commitizen/default.nix similarity index 74% rename from pkgs/applications/version-management/commitizen/default.nix rename to pkgs/development/python-modules/commitizen/default.nix index 472a0e04b8c6..7f2870ae493c 100644 --- a/pkgs/applications/version-management/commitizen/default.nix +++ b/pkgs/development/python-modules/commitizen/default.nix @@ -1,20 +1,39 @@ { lib , commitizen , fetchFromGitHub +, buildPythonPackage , git -, python3 +, pythonOlder , stdenv , installShellFiles +, poetry-core , nix-update-script , testers +, argcomplete +, charset-normalizer +, colorama +, decli +, importlib-metadata +, jinja2 +, packaging +, pyyaml +, questionary +, termcolor +, tomlkit +, py +, pytest-freezer +, pytest-mock +, pytest-regressions +, pytest7CheckHook +, deprecated }: -python3.pkgs.buildPythonApplication rec { +buildPythonPackage rec { pname = "commitizen"; version = "3.28.0"; format = "pyproject"; - disabled = python3.pythonOlder "3.8"; + disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "commitizen-tools"; @@ -28,12 +47,12 @@ python3.pkgs.buildPythonApplication rec { "decli" ]; - nativeBuildInputs = with python3.pkgs; [ + nativeBuildInputs = [ poetry-core installShellFiles ]; - propagatedBuildInputs = with python3.pkgs; [ + propagatedBuildInputs = [ argcomplete charset-normalizer colorama @@ -47,7 +66,7 @@ python3.pkgs.buildPythonApplication rec { tomlkit ]; - nativeCheckInputs = with python3.pkgs; [ + nativeCheckInputs = [ argcomplete deprecated git @@ -60,6 +79,8 @@ python3.pkgs.buildPythonApplication rec { doCheck = true; + pythonImportsCheck = [ "commitizen" ]; + # The tests require a functional git installation # which requires a valid HOME directory. preCheck = '' @@ -85,14 +106,14 @@ python3.pkgs.buildPythonApplication rec { postInstall = let - argcomplete = lib.getExe' python3.pkgs.argcomplete "register-python-argcomplete"; + register-python-argcomplete = lib.getExe' argcomplete "register-python-argcomplete"; in lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' installShellCompletion --cmd cz \ - --bash <(${argcomplete} --shell bash $out/bin/cz) \ - --zsh <(${argcomplete} --shell zsh $out/bin/cz) \ - --fish <(${argcomplete} --shell fish $out/bin/cz) + --bash <(${register-python-argcomplete} --shell bash $out/bin/cz) \ + --zsh <(${register-python-argcomplete} --shell zsh $out/bin/cz) \ + --fish <(${register-python-argcomplete} --shell fish $out/bin/cz) ''; passthru = { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2cfa96b3f346..d73625ccdcd0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4544,7 +4544,7 @@ with pkgs; comma = callPackage ../tools/package-management/comma { }; - commitizen = callPackage ../applications/version-management/commitizen { }; + commitizen = with python3Packages; toPythonApplication commitizen; common-licenses = callPackage ../data/misc/common-licenses { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e83eb06d9d73..b515694b0b91 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2053,6 +2053,8 @@ self: super: with self; { command-runner = callPackage ../development/python-modules/command-runner { }; + commitizen = callPackage ../development/python-modules/commitizen { }; + connect-box = callPackage ../development/python-modules/connect-box { }; connection-pool = callPackage ../development/python-modules/connection-pool { };