about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/py/pyp/package.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-03-24 11:04:41 +0100
committerAlyssa Ross <hi@alyssa.is>2024-03-24 11:04:41 +0100
commit5423cabbbf2b6dec5568f1ecabd288d5d9a642ec (patch)
treef316a6a921bfefd3a63bd4502c2eb50ff1644f67 /nixpkgs/pkgs/by-name/py/pyp/package.nix
parent46a88117a05c3469af5d99433af140c3de8ca088 (diff)
parent8aa81f34981add12aecada6c702ddbbd0375ca36 (diff)
downloadnixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar
nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.gz
nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.bz2
nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.lz
nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.xz
nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.zst
nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.zip
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/by-name/py/pyp/package.nix')
-rw-r--r--nixpkgs/pkgs/by-name/py/pyp/package.nix95
1 files changed, 52 insertions, 43 deletions
diff --git a/nixpkgs/pkgs/by-name/py/pyp/package.nix b/nixpkgs/pkgs/by-name/py/pyp/package.nix
index 1ba4629220db..08f3fdc63d49 100644
--- a/nixpkgs/pkgs/by-name/py/pyp/package.nix
+++ b/nixpkgs/pkgs/by-name/py/pyp/package.nix
@@ -1,51 +1,60 @@
 { lib
-, fetchFromGitHub
-, python3
 , bc
+, fetchFromGitHub
 , jq
+, python3
 }:
 
 let
-  version = "1.1.0";
-in python3.pkgs.buildPythonApplication {
-  pname = "pyp";
-  inherit version;
-  format = "pyproject";
-
-  src = fetchFromGitHub {
-    owner = "hauntsaninja";
-    repo = "pyp";
-    rev = "v${version}";
-    hash = "sha256-A1Ip41kxH17BakHEWEuymfa24eBEl5FIHAWL+iZFM4I=";
-  };
+  pythonPackages = python3.pkgs;
+  finalAttrs = {
+    pname = "pyp";
+    version = "1.2.0";
+
+    src = fetchFromGitHub {
+      owner = "hauntsaninja";
+      repo = "pyp";
+      rev = "refs/tags/v${finalAttrs.version}";
+      hash = "sha256-hnEgqWOIVj2ugOhd2aS9IulfkVnrlkhwOtrgH4qQqO8=";
+    };
+
+    pyproject = true;
+
+    build-system = with pythonPackages; [
+      flit-core
+    ];
+
+    nativeCheckInputs = (with pythonPackages; [
+      pytestCheckHook
+    ]) ++ [
+      bc
+      jq
+    ];
+
+    pythonImportsCheck = [
+      "pyp"
+    ];
+
+    # without this, the tests fail because they are unable to find the pyp tool
+    # itself...
+    preCheck = ''
+      _OLD_PATH_=$PATH
+      PATH=$out/bin:$PATH
+   '';
+
+    # And a cleanup!
+    postCheck = ''
+      PATH=$_OLD_PATH_
+    '';
 
-  nativeBuildInputs = [
-    python3.pkgs.flit-core
-  ];
-
-  nativeCheckInputs = [
-    python3.pkgs.pytestCheckHook
-    bc
-    jq
-  ];
-
-  # without this, the tests fail because they are unable to find the pyp tool
-  # itself...
-  preCheck = ''
-     _OLD_PATH_=$PATH
-     PATH=$out/bin:$PATH
-  '';
-
-  # And a cleanup
-  postCheck = ''
-    PATH=$_OLD_PATH_
-  '';
-
-  meta = {
-    homepage = "https://github.com/hauntsaninja/pyp";
-    description = "Easily run Python at the shell";
-    changelog = "https://github.com/hauntsaninja/pyp/blob/${version}/CHANGELOG.md";
-    license = lib.licenses.mit;
-    maintainers = with lib.maintainers; [ AndersonTorres ];
+    meta = {
+      homepage = "https://github.com/hauntsaninja/pyp";
+      description = "Easily run Python at the shell";
+      changelog = "https://github.com/hauntsaninja/pyp/blob/${finalAttrs.version}/CHANGELOG.md";
+      license = with lib.licenses; [ mit ];
+      mainProgram = "pyp";
+      maintainers = with lib.maintainers; [ rmcgibbo AndersonTorres ];
+    };
   };
-}
+in
+pythonPackages.buildPythonPackage finalAttrs