at 23.05-pre 2.0 kB view raw
1{ lib 2, buildPythonPackage 3, fetchPypi 4, pytest 5, simplejson 6, mock 7, glibcLocales 8, html5lib 9, pythonOlder 10, enum34 11, python 12, docutils 13, jinja2 14, pygments 15, alabaster 16, babel 17, snowballstemmer 18, six 19, sqlalchemy 20, whoosh 21, imagesize 22, requests 23, typing 24, sphinxcontrib-websupport 25, setuptools 26}: 27 28buildPythonPackage rec { 29 pname = "sphinx"; 30 version = "1.8.5"; 31 src = fetchPypi { 32 pname = "Sphinx"; 33 inherit version; 34 sha256 = "c7658aab75c920288a8cf6f09f244c6cfdae30d82d803ac1634d9f223a80ca08"; 35 }; 36 LC_ALL = "en_US.UTF-8"; 37 38 checkInputs = [ pytest ]; 39 buildInputs = [ simplejson mock glibcLocales html5lib ] ++ lib.optional (pythonOlder "3.4") enum34; 40 # Disable two tests that require network access. 41 checkPhase = '' 42 cd tests; ${python.interpreter} run.py --ignore py35 -k 'not test_defaults and not test_anchors_ignored' 43 ''; 44 propagatedBuildInputs = [ 45 docutils 46 jinja2 47 pygments 48 alabaster 49 babel 50 setuptools 51 snowballstemmer 52 six 53 sphinxcontrib-websupport 54 sqlalchemy 55 whoosh 56 imagesize 57 requests 58 ] ++ lib.optional (pythonOlder "3.5") typing; 59 60 # Lots of tests. Needs network as well at some point. 61 doCheck = false; 62 63 patches = [ 64 # Since pygments 2.5, PythonLexer refers to python3. If we want to use 65 # python2, we need to explicitly specify Python2Lexer. 66 # Not upstreamed since there doesn't seem to be any upstream maintenance 67 # branch for 1.8 (and this patch doesn't make any sense for 2.x). 68 ./python2-lexer.patch 69 ]; 70 # https://github.com/NixOS/nixpkgs/issues/22501 71 # Do not run `python sphinx-build arguments` but `sphinx-build arguments`. 72 postPatch = '' 73 substituteInPlace sphinx/make_mode.py --replace "sys.executable, " "" 74 ''; 75 76 meta = { 77 description = "A tool that makes it easy to create intelligent and beautiful documentation for Python projects"; 78 homepage = "http://sphinx.pocoo.org/"; 79 license = lib.licenses.bsd3; 80 maintainers = with lib.maintainers; [ ]; 81 }; 82}