2023-11-16 04:20:00 +00:00
|
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, buildPythonPackage
|
|
|
|
|
, pythonOlder
|
2021-05-20 23:08:51 +00:00
|
|
|
|
, fetchFromGitHub
|
2023-07-15 17:15:38 +00:00
|
|
|
|
, isPyPy
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
|
# nativeBuildInputs
|
|
|
|
|
, flit-core
|
|
|
|
|
|
2021-05-20 23:08:51 +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
|
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
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, sphinxcontrib-applehelp
|
|
|
|
|
, sphinxcontrib-devhelp
|
|
|
|
|
, sphinxcontrib-htmlhelp
|
|
|
|
|
, sphinxcontrib-jsmath
|
|
|
|
|
, sphinxcontrib-qthelp
|
|
|
|
|
, sphinxcontrib-serializinghtml
|
|
|
|
|
, sphinxcontrib-websupport
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
|
# check phase
|
2022-09-09 14:08:57 +00:00
|
|
|
|
, cython
|
2023-11-16 04:20:00 +00:00
|
|
|
|
, filelock
|
2021-05-20 23:08:51 +00:00
|
|
|
|
, html5lib
|
|
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
|
pname = "sphinx";
|
2023-11-16 04:20:00 +00:00
|
|
|
|
version = "7.2.6";
|
2023-01-20 10:41:00 +00:00
|
|
|
|
format = "pyproject";
|
2023-11-16 04:20:00 +00:00
|
|
|
|
disabled = pythonOlder "3.9";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "sphinx-doc";
|
2023-11-16 04:20:00 +00:00
|
|
|
|
repo = "sphinx";
|
2022-08-12 12:06:08 +00:00
|
|
|
|
rev = "refs/tags/v${version}";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
postFetch = ''
|
2023-11-16 04:20:00 +00:00
|
|
|
|
# Change ä to æ in file names, since ä can be encoded multiple ways on different
|
|
|
|
|
# filesystems, leading to different hashes on different platforms.
|
|
|
|
|
cd "$out";
|
|
|
|
|
mv tests/roots/test-images/{testimäge,testimæge}.png
|
|
|
|
|
sed -i 's/testimäge/testimæge/g' tests/{test_build*.py,roots/test-images/index.rst}
|
2021-12-26 17:43:05 +00:00
|
|
|
|
'';
|
2023-11-16 04:20:00 +00:00
|
|
|
|
hash = "sha256-IjpRGeGpGfzrEvwIKtuu2l1S74w8W+AbqDOGnWwtRck=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
|
nativeBuildInputs = [
|
|
|
|
|
flit-core
|
|
|
|
|
];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
|
propagatedBuildInputs = [
|
2021-05-20 23:08:51 +00:00
|
|
|
|
alabaster
|
2023-11-16 04:20:00 +00:00
|
|
|
|
babel
|
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
|
|
|
|
] ++ lib.optionals (pythonOlder "3.10") [
|
|
|
|
|
importlib-metadata
|
2021-05-20 23:08:51 +00:00
|
|
|
|
];
|
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
|
nativeCheckInputs = [
|
2022-09-09 14:08:57 +00:00
|
|
|
|
cython
|
2023-11-16 04:20:00 +00:00
|
|
|
|
filelock
|
2021-05-20 23:08:51 +00:00
|
|
|
|
html5lib
|
|
|
|
|
pytestCheckHook
|
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
|
preCheck = ''
|
2023-11-16 04:20:00 +00:00
|
|
|
|
export HOME=$TMPDIR
|
2022-09-09 14:08:57 +00:00
|
|
|
|
'';
|
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
|
disabledTests = [
|
|
|
|
|
# requires network access
|
|
|
|
|
"test_latex_images"
|
2024-01-13 08:15:51 +00:00
|
|
|
|
# racy
|
|
|
|
|
"test_defaults"
|
|
|
|
|
"test_check_link_response_only"
|
|
|
|
|
"test_anchors_ignored_for_url"
|
|
|
|
|
"test_autodoc_default_options"
|
2023-07-15 17:15:38 +00:00
|
|
|
|
] ++ lib.optionals isPyPy [
|
|
|
|
|
# PyPy has not __builtins__ which get asserted
|
|
|
|
|
# https://doc.pypy.org/en/latest/cpython_differences.html#miscellaneous
|
|
|
|
|
"test_autosummary_generate_content_for_module"
|
|
|
|
|
"test_autosummary_generate_content_for_module_skipped"
|
|
|
|
|
# internals are asserted which are sightly different in PyPy
|
|
|
|
|
"test_autodoc_inherited_members_None"
|
|
|
|
|
"test_automethod_for_builtin"
|
|
|
|
|
"test_builtin_function"
|
|
|
|
|
"test_cython"
|
|
|
|
|
"test_isattributedescriptor"
|
|
|
|
|
"test_methoddescriptor"
|
|
|
|
|
"test_partialfunction"
|
2021-05-20 23:08:51 +00:00
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
|
meta = {
|
2021-05-20 23:08:51 +00:00
|
|
|
|
description = "Python documentation generator";
|
|
|
|
|
longDescription = ''
|
2023-11-16 04:20:00 +00:00
|
|
|
|
Sphinx makes it easy to create intelligent and beautiful documentation.
|
|
|
|
|
|
|
|
|
|
Here are some of Sphinx’s major features:
|
|
|
|
|
- Output formats: HTML (including Windows HTML Help), LaTeX (for printable
|
|
|
|
|
PDF versions), ePub, Texinfo, manual pages, plain text
|
|
|
|
|
- Extensive cross-references: semantic markup and automatic links for
|
|
|
|
|
functions, classes, citations, glossary terms and similar pieces of
|
|
|
|
|
information
|
|
|
|
|
- Hierarchical structure: easy definition of a document tree, with
|
|
|
|
|
automatic links to siblings, parents and children
|
|
|
|
|
- Automatic indices: general index as well as a language-specific module
|
|
|
|
|
indices
|
|
|
|
|
- Code handling: automatic highlighting using the Pygments highlighter
|
|
|
|
|
- Extensions: automatic testing of code snippets, inclusion of docstrings
|
|
|
|
|
from Python modules (API docs) via built-in extensions, and much more
|
|
|
|
|
functionality via third-party extensions.
|
|
|
|
|
- Themes: modify the look and feel of outputs via creating themes, and
|
|
|
|
|
re-use many third-party themes.
|
|
|
|
|
- Contributed extensions: dozens of extensions contributed by users; most
|
|
|
|
|
of them installable from PyPI.
|
|
|
|
|
|
|
|
|
|
Sphinx uses the reStructuredText markup language by default, and can read
|
|
|
|
|
MyST markdown via third-party extensions. Both of these are powerful and
|
|
|
|
|
straightforward to use, and have functionality for complex documentation
|
|
|
|
|
and publishing workflows. They both build upon Docutils to parse and write
|
|
|
|
|
documents.
|
2021-05-20 23:08:51 +00:00
|
|
|
|
'';
|
|
|
|
|
homepage = "https://www.sphinx-doc.org";
|
2023-11-16 04:20:00 +00:00
|
|
|
|
changelog = "https://www.sphinx-doc.org/en/master/changes.html";
|
|
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
|
maintainers = lib.teams.sphinx.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
}
|