summary refs log tree commit diff
path: root/pkgs/development/python-modules/xdoctest/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/xdoctest/default.nix')
-rw-r--r--pkgs/development/python-modules/xdoctest/default.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/xdoctest/default.nix b/pkgs/development/python-modules/xdoctest/default.nix
new file mode 100644
index 00000000000..357e605d853
--- /dev/null
+++ b/pkgs/development/python-modules/xdoctest/default.nix
@@ -0,0 +1,48 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, pythonOlder
+, setuptools
+, wheel
+, pytestCheckHook
+}:
+
+buildPythonPackage rec {
+  pname = "xdoctest";
+  version = "1.1.2";
+  pyproject = true;
+
+  disabled = pythonOlder "3.6";
+
+  src = fetchFromGitHub {
+    owner = "Erotemic";
+    repo = "xdoctest";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-yTu5ldr9TkpYRP8hjgUPpexBVLjaK2gfPvISjMJLY74=";
+  };
+
+  nativeBuildInputs = [
+    setuptools
+    wheel
+  ];
+
+  nativeCheckInputs = [
+    pytestCheckHook
+  ];
+
+  preCheck = ''
+    export HOME=$TMPDIR
+    export PATH=$out/bin:$PATH
+  '';
+
+  pythonImportsCheck = [ "xdoctest" ];
+
+  meta = with lib; {
+    description = "A rewrite of Python's builtin doctest module (with pytest plugin integration) with AST instead of REGEX";
+    homepage = "https://github.com/Erotemic/xdoctest";
+    changelog = "https://github.com/Erotemic/xdoctest/blob/${src.rev}/CHANGELOG.md";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ natsukium ];
+    mainProgram = "xdoctest";
+  };
+}