From e7fbe79667d49ea21151de62ff1c4f75d74088f8 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 8 Dec 2021 09:52:48 +0100 Subject: [PATCH] python3Packages.pytest-snapshot: enable tests --- .../pytest-snapshot/default.nix | 42 ++++++++++++++----- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/pytest-snapshot/default.nix b/pkgs/development/python-modules/pytest-snapshot/default.nix index 3b7a9f389ebd..cb58e101be7b 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"; + format = "setuptools"; - src = fetchPypi { - inherit pname version; - sha256 = "cf84c88c3e0b4ae08ae797d9ccdc32715b64dd68b2da40f575db56956ed23326"; + src = fetchFromGitHub { + owner = "joseph-roitman"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-xnfsB4wmsvqq5FfhLasSpxZh7+vhQsND6+Lxu0OuCvs="; }; - 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";