about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/rstcheck
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-12-06 19:57:55 +0000
committerAlyssa Ross <hi@alyssa.is>2023-02-08 13:48:30 +0000
commitbf3aadfdd39aa197e18bade671fab6726349ffa4 (patch)
tree698567af766ed441d757b57a7b21e68d4a342a2b /nixpkgs/pkgs/development/python-modules/rstcheck
parentf4afc5a01d9539ce09e47494e679c51f80723d07 (diff)
parent99665eb45f58d959d2cb9e49ddb960c79d596f33 (diff)
downloadnixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.gz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.bz2
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.lz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.xz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.zst
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.zip
Merge commit '99665eb45f58d959d2cb9e49ddb960c79d596f33'
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/rstcheck')
-rw-r--r--nixpkgs/pkgs/development/python-modules/rstcheck/default.nix63
1 files changed, 57 insertions, 6 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/rstcheck/default.nix b/nixpkgs/pkgs/development/python-modules/rstcheck/default.nix
index 606b2879908e..b5a3ccefc08c 100644
--- a/nixpkgs/pkgs/development/python-modules/rstcheck/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/rstcheck/default.nix
@@ -1,18 +1,69 @@
-{ lib, fetchFromGitHub, buildPythonPackage, docutils }:
+{ lib
+, buildPythonPackage
+, colorama
+, docutils
+, fetchFromGitHub
+, importlib-metadata
+, poetry-core
+, pydantic
+, pytestCheckHook
+, pythonOlder
+, rstcheck-core
+, shellingham
+, typer
+, types-docutils
+, typing-extensions
+}:
 
 buildPythonPackage rec {
   pname = "rstcheck";
-  version = "3.3.1";
+  version = "6.0.0.post1";
+  format = "pyproject";
+
+  disabled = pythonOlder "3.7";
 
   src = fetchFromGitHub {
-    owner = "myint";
+    owner = "rstcheck";
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256-4AhENuT+LtUMCi+aaI/rKa2gHti8sKGLdVGjdRithXI=";
+    hash = "sha256-Ljg1cciT9qKL9xtBxQ8OLygDpV/1yR5XiJOzHrLr6xw=";
   };
 
-  pythonImportsCheck = [ "rstcheck" ];
-  propagatedBuildInputs = [ docutils ];
+  nativeBuildInputs = [
+    poetry-core
+  ];
+
+  propagatedBuildInputs = [
+    colorama
+    docutils
+    rstcheck-core
+    shellingham
+    types-docutils
+    typing-extensions
+    pydantic
+    typer
+  ] ++ lib.optionals (pythonOlder "3.8") [
+    typing-extensions
+    importlib-metadata
+  ];
+
+  checkInputs = [
+    pytestCheckHook
+  ];
+
+  postPatch = ''
+    substituteInPlace pyproject.toml \
+      --replace 'types-docutils = ">=0.18, <0.19"' 'types-docutils = ">=0.18"'
+  '';
+
+  pythonImportsCheck = [
+    "rstcheck"
+  ];
+
+  preCheck = ''
+    # The tests need to find and call the rstcheck executable
+    export PATH="$PATH:$out/bin";
+  '';
 
   meta = with lib; {
     description = "Checks syntax of reStructuredText and code blocks nested within it";