diff options
Diffstat (limited to 'pkgs/development/python-modules/pytest-snapshot/default.nix')
-rw-r--r-- | pkgs/development/python-modules/pytest-snapshot/default.nix | 42 |
1 files 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 3b7a9f389ebde..cb58e101be7b6 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"; |