summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2021-05-08 14:34:58 +0200
committerJonathan Ringer <jonringer@users.noreply.github.com>2021-05-08 10:24:51 -0700
commit20549cae36c7bbc07fc7fd318b9da63190995383 (patch)
treefde0c8d4a889d46165f54ead1dc44d086e93b521 /pkgs
parent9651084620116914e420e6a329d3a19ff00850a0 (diff)
python3Packages.sphinx: fix build, enable tests, cleanup
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/sphinx/default.nix92
1 files changed, 50 insertions, 42 deletions
diff --git a/pkgs/development/python-modules/sphinx/default.nix b/pkgs/development/python-modules/sphinx/default.nix
index 8168e4e037552..8d6567b3e9163 100644
--- a/pkgs/development/python-modules/sphinx/default.nix
+++ b/pkgs/development/python-modules/sphinx/default.nix
@@ -1,24 +1,18 @@
 { lib
 , buildPythonPackage
-, fetchPypi
-, pytest
-, simplejson
-, mock
-, glibcLocales
-, html5lib
 , pythonOlder
-, enum34
-, python
+, fetchFromGitHub
+# propagatedBuildInputs
+, Babel
+, alabaster
 , docutils
+, imagesize
 , jinja2
+, packaging
 , pygments
-, alabaster
-, Babel
-, snowballstemmer
-, six
-, whoosh
-, imagesize
 , requests
+, setuptools
+, snowballstemmer
 , sphinxcontrib-applehelp
 , sphinxcontrib-devhelp
 , sphinxcontrib-htmlhelp
@@ -26,56 +20,70 @@
 , sphinxcontrib-qthelp
 , sphinxcontrib-serializinghtml
 , sphinxcontrib-websupport
-, typing ? null
-, setuptools
-, packaging
+# check phase
+, html5lib
+, imagemagick
+, pytestCheckHook
+, typed-ast
 }:
 
 buildPythonPackage rec {
   pname = "sphinx";
   version = "3.5.4";
-  src = fetchPypi {
-    pname = "Sphinx";
-    inherit version;
-    sha256 = "19010b7b9fa0dc7756a6e105b2aacd3a80f798af3c25c273be64d7beeb482cb1";
+  disabled = pythonOlder "3.5";
+
+  src = fetchFromGitHub {
+    owner = "sphinx-doc";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1xjii3dl01rq8x2bsxc6zywiy1s7arfgxrg5l8ml54w1748shadd";
   };
-  LC_ALL = "en_US.UTF-8";
 
-  checkInputs = [ pytest ];
-  buildInputs = [ simplejson mock glibcLocales html5lib ] ++ lib.optional (pythonOlder "3.4") enum34;
-  # Disable two tests that require network access.
-  checkPhase = ''
-    cd tests; ${python.interpreter} run.py --ignore py35 -k 'not test_defaults and not test_anchors_ignored'
-  '';
   propagatedBuildInputs = [
+    Babel
+    alabaster
     docutils
+    imagesize
     jinja2
-    pygments
-    alabaster
-    Babel
     packaging
+    pygments
+    requests
     setuptools
     snowballstemmer
-    six
-    whoosh
-    imagesize
-    requests
     sphinxcontrib-applehelp
     sphinxcontrib-devhelp
     sphinxcontrib-htmlhelp
     sphinxcontrib-jsmath
     sphinxcontrib-qthelp
     sphinxcontrib-serializinghtml
+    # extra[docs]
     sphinxcontrib-websupport
-  ] ++ lib.optional (pythonOlder "3.5") typing;
+  ];
+
+  checkInputs = [
+    imagemagick
+    html5lib
+    pytestCheckHook
+  ] ++ lib.optionals (pythonOlder "3.8") [
+    typed-ast
+  ];
 
-  # Lots of tests. Needs network as well at some point.
-  doCheck = false;
+  disabledTests = [
+    # requires network access
+    "test_anchors_ignored"
+    "test_defaults"
+    "test_defaults_json"
+    "test_latex_images"
+  ];
 
-  meta = {
-    description = "A tool that makes it easy to create intelligent and beautiful documentation for Python projects";
+  meta = with lib; {
+    description = "Python documentation generator";
+    longDescription = ''
+      A tool that makes it easy to create intelligent and beautiful
+      documentation for Python projects
+    '';
     homepage = "https://www.sphinx-doc.org";
-    license = lib.licenses.bsd3;
-    maintainers = with lib.maintainers; [ nand0p ];
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ nand0p ];
   };
 }