about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pytest-snapshot/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/pytest-snapshot/default.nix')
-rw-r--r--pkgs/development/python-modules/pytest-snapshot/default.nix44
1 files changed, 33 insertions, 11 deletions
diff --git a/pkgs/development/python-modules/pytest-snapshot/default.nix b/pkgs/development/python-modules/pytest-snapshot/default.nix
index 3b7a9f389ebde..34833bcc30a87 100644
--- a/pkgs/development/python-modules/pytest-snapshot/default.nix
+++ b/pkgs/development/python-modules/pytest-snapshot/default.nix
@@ -1,23 +1,45 @@
-{ lib, buildPythonPackage, fetchPypi, packaging, pytest, setuptools-scm }:
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, packaging
+, pytest
+, setuptools-scm
+, pytestCheckHook
+}:
 
 buildPythonPackage rec {
   pname = "pytest-snapshot";
-  version = "0.8.0";
+  version = "0.8.1";
+  format = "setuptools";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "cf84c88c3e0b4ae08ae797d9ccdc32715b64dd68b2da40f575db56956ed23326";
+  src = fetchFromGitHub {
+    owner = "joseph-roitman";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-ymB9h3Mc6GSMRsxIh6uuf111qLvIkNAnFsxR6O2SF7s=";
   };
 
-  nativeBuildInputs = [ setuptools-scm ];
+  SETUPTOOLS_SCM_PRETEND_VERSION = version;
 
-  buildInputs = [ pytest ];
+  nativeBuildInputs = [
+    setuptools-scm
+  ];
 
-  propagatedBuildInputs = [ packaging ];
+  buildInputs = [
+    pytest
+  ];
 
-  # pypi does not contain tests and GitHub archive is not supported because setuptools-scm can't detect the version
-  doCheck = false;
-  pythonImportsCheck = [ "pytest_snapshot" ];
+  propagatedBuildInputs = [
+    packaging
+  ];
+
+  checkInputs = [
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [
+    "pytest_snapshot"
+  ];
 
   meta = with lib; {
     description = "A plugin to enable snapshot testing with pytest";