2021-12-26 17:43:05 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
2021-05-20 23:08:51 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
# propagatedBuildInputs
|
2022-05-18 14:49:53 +00:00
|
|
|
, babel
|
2021-05-20 23:08:51 +00:00
|
|
|
, alabaster
|
2020-04-24 23:36:52 +00:00
|
|
|
, docutils
|
2021-05-20 23:08:51 +00:00
|
|
|
, imagesize
|
2022-02-10 20:34:41 +00:00
|
|
|
, importlib-metadata
|
2020-04-24 23:36:52 +00:00
|
|
|
, jinja2
|
2021-05-20 23:08:51 +00:00
|
|
|
, packaging
|
2020-04-24 23:36:52 +00:00
|
|
|
, pygments
|
|
|
|
, requests
|
2021-05-20 23:08:51 +00:00
|
|
|
, snowballstemmer
|
2022-02-10 20:34:41 +00:00
|
|
|
, sphinxcontrib-apidoc
|
2020-04-24 23:36:52 +00:00
|
|
|
, sphinxcontrib-applehelp
|
|
|
|
, sphinxcontrib-devhelp
|
|
|
|
, sphinxcontrib-htmlhelp
|
|
|
|
, sphinxcontrib-jsmath
|
|
|
|
, sphinxcontrib-qthelp
|
|
|
|
, sphinxcontrib-serializinghtml
|
|
|
|
, sphinxcontrib-websupport
|
2021-05-20 23:08:51 +00:00
|
|
|
# check phase
|
|
|
|
, html5lib
|
|
|
|
, pytestCheckHook
|
|
|
|
, typed-ast
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "sphinx";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "4.5.0";
|
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sphinx-doc";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-04-27 09:35:20 +00:00
|
|
|
sha256 = "sha256-Lw9yZWCQpt02SL/McWPcyFRfVhQHC0TejcYRbVw+VxY=";
|
2021-12-26 17:43:05 +00:00
|
|
|
extraPostFetch = ''
|
|
|
|
cd $out
|
|
|
|
mv tests/roots/test-images/testimäge.png \
|
|
|
|
tests/roots/test-images/testimæge.png
|
|
|
|
patch -p1 < ${./0001-test-images-Use-normalization-equivalent-character.patch}
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "docutils>=0.14,<0.18" "docutils>=0.14"
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
# remove impurity caused by date inclusion
|
|
|
|
# https://github.com/sphinx-doc/sphinx/blob/master/setup.cfg#L4-L6
|
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace "tag_build = .dev" "" \
|
|
|
|
--replace "tag_date = true" ""
|
2022-04-27 09:35:20 +00:00
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-05-18 14:49:53 +00:00
|
|
|
babel
|
2021-05-20 23:08:51 +00:00
|
|
|
alabaster
|
2020-04-24 23:36:52 +00:00
|
|
|
docutils
|
2021-05-20 23:08:51 +00:00
|
|
|
imagesize
|
2020-04-24 23:36:52 +00:00
|
|
|
jinja2
|
2021-04-05 15:23:46 +00:00
|
|
|
packaging
|
2021-05-20 23:08:51 +00:00
|
|
|
pygments
|
|
|
|
requests
|
2020-04-24 23:36:52 +00:00
|
|
|
snowballstemmer
|
|
|
|
sphinxcontrib-applehelp
|
|
|
|
sphinxcontrib-devhelp
|
|
|
|
sphinxcontrib-htmlhelp
|
|
|
|
sphinxcontrib-jsmath
|
|
|
|
sphinxcontrib-qthelp
|
|
|
|
sphinxcontrib-serializinghtml
|
2021-05-20 23:08:51 +00:00
|
|
|
# extra[docs]
|
2020-04-24 23:36:52 +00:00
|
|
|
sphinxcontrib-websupport
|
2022-02-10 20:34:41 +00:00
|
|
|
|
|
|
|
# extra plugins which are otherwise not found by sphinx-build
|
|
|
|
sphinxcontrib-apidoc
|
|
|
|
] ++ lib.optionals (pythonOlder "3.10") [
|
|
|
|
importlib-metadata
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
html5lib
|
|
|
|
pytestCheckHook
|
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
typed-ast
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
disabledTests = [
|
|
|
|
# requires network access
|
|
|
|
"test_anchors_ignored"
|
|
|
|
"test_defaults"
|
|
|
|
"test_defaults_json"
|
|
|
|
"test_latex_images"
|
2021-09-26 12:46:18 +00:00
|
|
|
|
|
|
|
# requires imagemagick (increases build closure size), doesn't
|
|
|
|
# test anything substantial
|
|
|
|
"test_ext_imgconverter"
|
2021-12-26 17:43:05 +00:00
|
|
|
] ++ lib.optional stdenv.isDarwin [
|
|
|
|
# Due to lack of network sandboxing can't guarantee port 7777 isn't bound
|
|
|
|
"test_inspect_main_url"
|
|
|
|
"test_auth_header_uses_first_match"
|
2022-04-15 01:41:22 +00:00
|
|
|
"test_linkcheck_allowed_redirects"
|
2021-12-26 17:43:05 +00:00
|
|
|
"test_linkcheck_request_headers"
|
|
|
|
"test_linkcheck_request_headers_no_slash"
|
|
|
|
"test_follows_redirects_on_HEAD"
|
2022-04-15 01:41:22 +00:00
|
|
|
"test_get_after_head_raises_connection_error"
|
2021-12-26 17:43:05 +00:00
|
|
|
"test_invalid_ssl"
|
|
|
|
"test_connect_to_selfsigned_with_tls_verify_false"
|
|
|
|
"test_connect_to_selfsigned_with_tls_cacerts"
|
|
|
|
"test_connect_to_selfsigned_with_requests_env_var"
|
|
|
|
"test_connect_to_selfsigned_nonexistent_cert_file"
|
|
|
|
"test_TooManyRedirects_on_HEAD"
|
|
|
|
"test_too_many_requests_retry_after_int_del"
|
|
|
|
"test_too_many_requests_retry_after_HTTP_date"
|
|
|
|
"test_too_many_requests_retry_after_without_header"
|
|
|
|
"test_too_many_requests_user_timeout"
|
|
|
|
"test_raises_for_invalid_status"
|
|
|
|
"test_auth_header_no_match"
|
|
|
|
"test_follows_redirects_on_GET"
|
|
|
|
"test_connect_to_selfsigned_fails"
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
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 = licenses.bsd3;
|
2022-02-10 20:34:41 +00:00
|
|
|
maintainers = teams.sphinx.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|