From 2b2d8919e8802aaaab3cbb5d6319cc4389a9f810 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Fri, 9 Aug 2019 12:24:08 -0700 Subject: [PATCH] pythonPackage.pre-commit: move to python-modules Add pkgs.gitAndTools.pre-commit alias Add pkgs.pre-commit alias --- .../git-and-tools/default.nix | 2 +- .../python-modules}/pre-commit/default.nix | 25 ++++++++++++++----- pkgs/top-level/all-packages.nix | 2 ++ pkgs/top-level/python-packages.nix | 2 ++ 4 files changed, 24 insertions(+), 7 deletions(-) rename pkgs/{applications/version-management/git-and-tools => development/python-modules}/pre-commit/default.nix (60%) diff --git a/pkgs/applications/version-management/git-and-tools/default.nix b/pkgs/applications/version-management/git-and-tools/default.nix index 5068647e8798..c7d77bf34981 100644 --- a/pkgs/applications/version-management/git-and-tools/default.nix +++ b/pkgs/applications/version-management/git-and-tools/default.nix @@ -145,7 +145,7 @@ let lab = callPackage ./lab { }; - pre-commit = callPackage ./pre-commit { }; + pre-commit = pkgs.python3Packages.toPythonApplication pkgs.python3Packages.pre-commit; pass-git-helper = python3Packages.callPackage ./pass-git-helper { }; diff --git a/pkgs/applications/version-management/git-and-tools/pre-commit/default.nix b/pkgs/development/python-modules/pre-commit/default.nix similarity index 60% rename from pkgs/applications/version-management/git-and-tools/pre-commit/default.nix rename to pkgs/development/python-modules/pre-commit/default.nix index 98608b20b575..6b65af073f42 100644 --- a/pkgs/applications/version-management/git-and-tools/pre-commit/default.nix +++ b/pkgs/development/python-modules/pre-commit/default.nix @@ -1,5 +1,18 @@ -{ stdenv, python3Packages }: -with python3Packages; buildPythonApplication rec { +{ lib, fetchPypi, buildPythonApplication, pythonOlder +, aspy-yaml +, cached-property +, cfgv +, futures +, identify +, importlib-metadata +, importlib-resources +, nodeenv +, six +, toml +, virtualenv +}: + +buildPythonApplication rec { pname = "pre-commit"; version = "1.18.1"; @@ -19,13 +32,13 @@ with python3Packages; buildPythonApplication rec { toml virtualenv importlib-metadata - ] ++ stdenv.lib.optional (pythonOlder "3.7") importlib-resources - ++ stdenv.lib.optional (pythonOlder "3.2") futures; + ] ++ lib.optional (pythonOlder "3.7") importlib-resources + ++ lib.optional (pythonOlder "3.2") futures; - # Tests fail due to a missing windll dependency + # slow and impure doCheck = false; - meta = with stdenv.lib; { + meta = with lib; { description = "A framework for managing and maintaining multi-language pre-commit hooks"; homepage = https://pre-commit.com/; license = licenses.mit; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2dceba2763b1..e7c00f9d91ef 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5517,6 +5517,8 @@ in pptpd = callPackage ../tools/networking/pptpd {}; + pre-commit = gitAndTools.pre-commit; + prettyping = callPackage ../tools/networking/prettyping { }; prey-bash-client = callPackage ../tools/security/prey { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b4bb0b46977f..677fea42b6f5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1909,6 +1909,8 @@ in { pkginfo = callPackage ../development/python-modules/pkginfo { }; + pre-commit = callPackage ../development/python-modules/pre-commit { }; + pretend = callPackage ../development/python-modules/pretend { }; detox = callPackage ../development/python-modules/detox { };