1- { stdenv
2- , lib
1+ { lib
2+ , stdenv
33, buildPythonPackage
44, pythonOlder
55, fetchFromGitHub
3030
3131# check phase
3232, cython
33+ , filelock
3334, html5lib
3435, pytestCheckHook
35- , typed-ast
3636} :
3737
3838buildPythonPackage rec {
3939 pname = "sphinx" ;
40- version = "5.3.0 " ;
40+ version = "7.2.6 " ;
4141 format = "pyproject" ;
42-
43- disabled = pythonOlder "3.6" ;
42+ disabled = pythonOlder "3.9" ;
4443
4544 src = fetchFromGitHub {
4645 owner = "sphinx-doc" ;
47- repo = pname ;
46+ repo = "sphinx" ;
4847 rev = "refs/tags/v${ version } " ;
49- hash = "sha256-80bVg1rfBebgSOKbWkzP84vpm39iLgM8lWlVD64nSsQ=" ;
5048 postFetch = ''
51- cd $out
52- mv tests/roots/test-images/testimäge.png \
53- tests/roots/test-images/testimæge.png
54- patch -p1 < ${ ./0001-test-images-Use-normalization-equivalent-character.patch }
49+ # Change ä to æ in file names, since ä can be encoded multiple ways on different
50+ # filesystems, leading to different hashes on different platforms.
51+ cd "$out";
52+ mv tests/roots/test-images/{testimäge,testimæge}.png
53+ sed -i 's/testimäge/testimæge/g' tests/{test_build*.py,roots/test-images/index.rst}
5554 '' ;
55+ hash = "sha256-IjpRGeGpGfzrEvwIKtuu2l1S74w8W+AbqDOGnWwtRck=" ;
5656 } ;
5757
5858 nativeBuildInputs = [
5959 flit-core
6060 ] ;
6161
6262 propagatedBuildInputs = [
63- babel
6463 alabaster
64+ babel
6565 docutils
6666 imagesize
6767 jinja2
@@ -84,66 +84,22 @@ buildPythonPackage rec {
8484 importlib-metadata
8585 ] ;
8686
87+ __darwinAllowLocalNetworking = true ;
88+
8789 nativeCheckInputs = [
8890 cython
91+ filelock
8992 html5lib
9093 pytestCheckHook
91- ] ++ lib . optionals ( pythonOlder "3.8" ) [
92- typed-ast
9394 ] ;
9495
9596 preCheck = ''
96- export HOME=$(mktemp -d)
97+ export HOME=$TMPDIR
9798 '' ;
9899
99100 disabledTests = [
100101 # requires network access
101- "test_anchors_ignored"
102- "test_defaults"
103- "test_defaults_json"
104102 "test_latex_images"
105-
106- # requires imagemagick (increases build closure size), doesn't
107- # test anything substantial
108- "test_ext_imgconverter"
109-
110- # fails with pygments 2.14
111- # TODO remove for sphinx 6
112- "test_viewcode"
113- "test_additional_targets_should_be_translated"
114- "test_additional_targets_should_not_be_translated"
115-
116- # sphinx.errors.VersionRequirementError: The alabaster extension
117- # used by this project needs at least Sphinx v1.6; it therefore
118- # cannot be built with this version.
119- "test_needs_sphinx"
120-
121- # Likely due to pygments 2.14 update
122- # AssertionError: assert '5:11:17\u202fAM' == '5:11:17 AM'
123- "test_format_date"
124- ] ++ lib . optionals stdenv . isDarwin [
125- # Due to lack of network sandboxing can't guarantee port 7777 isn't bound
126- "test_inspect_main_url"
127- "test_auth_header_uses_first_match"
128- "test_linkcheck_allowed_redirects"
129- "test_linkcheck_request_headers"
130- "test_linkcheck_request_headers_no_slash"
131- "test_follows_redirects_on_HEAD"
132- "test_get_after_head_raises_connection_error"
133- "test_invalid_ssl"
134- "test_connect_to_selfsigned_with_tls_verify_false"
135- "test_connect_to_selfsigned_with_tls_cacerts"
136- "test_connect_to_selfsigned_with_requests_env_var"
137- "test_connect_to_selfsigned_nonexistent_cert_file"
138- "test_TooManyRedirects_on_HEAD"
139- "test_too_many_requests_retry_after_int_del"
140- "test_too_many_requests_retry_after_HTTP_date"
141- "test_too_many_requests_retry_after_without_header"
142- "test_too_many_requests_user_timeout"
143- "test_raises_for_invalid_status"
144- "test_auth_header_no_match"
145- "test_follows_redirects_on_GET"
146- "test_connect_to_selfsigned_fails"
147103 ] ++ lib . optionals isPyPy [
148104 # PyPy has not __builtins__ which get asserted
149105 # https://doc.pypy.org/en/latest/cpython_differences.html#miscellaneous
@@ -159,14 +115,39 @@ buildPythonPackage rec {
159115 "test_partialfunction"
160116 ] ;
161117
162- meta = with lib ; {
118+ meta = {
163119 description = "Python documentation generator" ;
164120 longDescription = ''
165- A tool that makes it easy to create intelligent and beautiful
166- documentation for Python projects
121+ Sphinx makes it easy to create intelligent and beautiful documentation.
122+
123+ Here are some of Sphinx’s major features:
124+ - Output formats: HTML (including Windows HTML Help), LaTeX (for printable
125+ PDF versions), ePub, Texinfo, manual pages, plain text
126+ - Extensive cross-references: semantic markup and automatic links for
127+ functions, classes, citations, glossary terms and similar pieces of
128+ information
129+ - Hierarchical structure: easy definition of a document tree, with
130+ automatic links to siblings, parents and children
131+ - Automatic indices: general index as well as a language-specific module
132+ indices
133+ - Code handling: automatic highlighting using the Pygments highlighter
134+ - Extensions: automatic testing of code snippets, inclusion of docstrings
135+ from Python modules (API docs) via built-in extensions, and much more
136+ functionality via third-party extensions.
137+ - Themes: modify the look and feel of outputs via creating themes, and
138+ re-use many third-party themes.
139+ - Contributed extensions: dozens of extensions contributed by users; most
140+ of them installable from PyPI.
141+
142+ Sphinx uses the reStructuredText markup language by default, and can read
143+ MyST markdown via third-party extensions. Both of these are powerful and
144+ straightforward to use, and have functionality for complex documentation
145+ and publishing workflows. They both build upon Docutils to parse and write
146+ documents.
167147 '' ;
168148 homepage = "https://www.sphinx-doc.org" ;
169- license = licenses . bsd3 ;
170- maintainers = teams . sphinx . members ;
149+ changelog = "https://www.sphinx-doc.org/en/master/changes.html" ;
150+ license = lib . licenses . bsd3 ;
151+ maintainers = lib . teams . sphinx . members ;
171152 } ;
172153}
0 commit comments