about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2021-06-07 00:19:48 +0200
committerFabian Affolter <mail@fabian-affolter.ch>2021-06-21 08:51:37 +0200
commit3838df3ec83707583a0e7a18743248b697e93260 (patch)
tree248a889f6bc43ec31cfeaa40436356643f241230
parent712488a221e19b3391b20e6cb0fe26dca76863ab (diff)
downloadnixlib-3838df3ec83707583a0e7a18743248b697e93260.tar
nixlib-3838df3ec83707583a0e7a18743248b697e93260.tar.gz
nixlib-3838df3ec83707583a0e7a18743248b697e93260.tar.bz2
nixlib-3838df3ec83707583a0e7a18743248b697e93260.tar.lz
nixlib-3838df3ec83707583a0e7a18743248b697e93260.tar.xz
nixlib-3838df3ec83707583a0e7a18743248b697e93260.tar.zst
nixlib-3838df3ec83707583a0e7a18743248b697e93260.zip
python3Packages.libcst: run some tests
-rw-r--r--pkgs/development/python-modules/libcst/default.nix47
1 files changed, 30 insertions, 17 deletions
diff --git a/pkgs/development/python-modules/libcst/default.nix b/pkgs/development/python-modules/libcst/default.nix
index ed6e7755bf15..314bc82cd4fb 100644
--- a/pkgs/development/python-modules/libcst/default.nix
+++ b/pkgs/development/python-modules/libcst/default.nix
@@ -1,21 +1,22 @@
 { lib
+, black
 , buildPythonPackage
+, dataclasses
 , fetchFromGitHub
-, pythonOlder
 , hypothesis
-, dataclasses
-, hypothesmith
-, pytestCheckHook
+, isort
+, pytest
+, python
+, pythonOlder
 , pyyaml
 , typing-extensions
 , typing-inspect
-, black
-, isort
 }:
 
 buildPythonPackage rec {
   pname = "libcst";
   version = "0.3.18";
+  disabled = pythonOlder "3.6";
 
   # Some files for tests missing from PyPi
   # https://github.com/Instagram/LibCST/issues/331
@@ -26,25 +27,37 @@ buildPythonPackage rec {
     sha256 = "sha256-19yGaKBLpGASSPv/aSX0kx9lh2JxKExHJDKKtuBbuqI=";
   };
 
-  disabled = pythonOlder "3.6";
-
-  propagatedBuildInputs = [ hypothesis typing-extensions typing-inspect pyyaml ]
-    ++ lib.optional (pythonOlder "3.7") dataclasses;
-
-  checkInputs = [ black hypothesmith isort pytestCheckHook ];
+  propagatedBuildInputs = [
+    hypothesis
+    typing-extensions
+    typing-inspect
+    pyyaml
+  ] ++ lib.optional (pythonOlder "3.7") [
+    dataclasses
+  ];
 
-  # can't run tests due to circular dependency on hypothesmith -> licst
-  doCheck = false;
+  checkInputs = [
+    black
+    isort
+    pytest
+  ];
 
   preCheck = ''
-    python -m libcst.codegen.generate visitors
-    python -m libcst.codegen.generate return_types
+    ${python.interpreter} -m libcst.codegen.generate visitors
+    ${python.interpreter} -m libcst.codegen.generate return_types
+    # Can't run all tests due to circular dependency on hypothesmith -> libcst
+    rm -r {libcst/tests,libcst/codegen/tests,libcst/m*/tests}
   '';
 
+  disabledTests = [
+    # No files are generated
+    "test_codemod_formatter_error_input"
+  ];
+
   pythonImportsCheck = [ "libcst" ];
 
   meta = with lib; {
-    description = "A Concrete Syntax Tree (CST) parser and serializer library for Python.";
+    description = "Concrete Syntax Tree (CST) parser and serializer library for Python";
     homepage = "https://github.com/Instagram/libcst";
     license = with licenses; [ mit asl20 psfl ];
     maintainers = with maintainers; [ ruuda SuperSandro2000 ];