about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2022-06-27 08:51:55 +0200
committerJonathan Ringer <jonringer@users.noreply.github.com>2022-06-27 09:30:54 -0700
commita0aea1e6c34f47d74f0c1bf0c8d23f911bf9561e (patch)
treec5c898b72e02b40fc82fa9986086d3690643dbb0
parente4c7b303df800aecbdd32de98ff3864dad568d4f (diff)
python310Packages.nodeenv: enable tests
- disable on older Python releases
-rw-r--r--pkgs/development/python-modules/nodeenv/default.nix38
1 files changed, 31 insertions, 7 deletions
diff --git a/pkgs/development/python-modules/nodeenv/default.nix b/pkgs/development/python-modules/nodeenv/default.nix
index 176846c3e0697..d08fcf4699ab7 100644
--- a/pkgs/development/python-modules/nodeenv/default.nix
+++ b/pkgs/development/python-modules/nodeenv/default.nix
@@ -1,31 +1,55 @@
-{ lib, buildPythonPackage, fetchPypi, setuptools, python, which }:
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, mock
+, pytestCheckHook
+, python
+, pythonOlder
+, setuptools
+, which
+}:
 
 buildPythonPackage rec {
   pname = "nodeenv";
   version = "1.7.0";
+  format = "setuptools";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "sha256-4Of337hfxTlMb+Ho+pgTGiRz4EMRpFr7ZQj3zxg2+is=";
+  disabled = pythonOlder "3.7";
+
+  src = fetchFromGitHub {
+    owner = "ekalinin";
+    repo = pname;
+    rev = version;
+    hash = "sha256-X30PUiOMT/vXqmdSJKHTNNA8aLWavCUaKa7LzqkdLrk=";
   };
 
   propagatedBuildInputs = [
     setuptools
   ];
 
-  # Tests not included in PyPI tarball
-  doCheck = false;
+  checkInputs = [
+    mock
+    pytestCheckHook
+  ];
 
   preFixup = ''
     substituteInPlace $out/${python.sitePackages}/nodeenv.py \
       --replace '["which", candidate]' '["${lib.getBin which}/bin/which", candidate]'
   '';
 
-  pythonImportsCheck = [ "nodeenv" ];
+  pythonImportsCheck = [
+    "nodeenv"
+  ];
+
+  disabledTests = [
+    # Test requires coverage
+    "test_smoke"
+  ];
 
   meta = with lib; {
     description = "Node.js virtual environment builder";
     homepage = "https://github.com/ekalinin/nodeenv";
     license = licenses.bsd3;
+    maintainers = with maintainers; [ ];
   };
 }