2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, flit-core
|
|
|
|
, pythonOlder
|
|
|
|
, docutils
|
|
|
|
, jinja2
|
|
|
|
, markdown-it-py
|
|
|
|
, mdit-py-plugins
|
|
|
|
, pyyaml
|
|
|
|
, sphinx
|
|
|
|
, typing-extensions
|
|
|
|
, beautifulsoup4
|
|
|
|
, pytest-param-files
|
|
|
|
, pytest-regressions
|
|
|
|
, sphinx-pytest
|
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "myst-parser";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "0.18.1";
|
|
|
|
format = "pyproject";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "executablebooks";
|
|
|
|
repo = pname;
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
sha256 = "sha256-wgRZwafAF05LtwjH6SVKzsY7bKeZ6lUlM3dB5PdOn1E=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
2023-01-20 10:41:00 +00:00
|
|
|
--replace "docutils>=0.15,<0.19" "docutils>=0.15" \
|
|
|
|
--replace "sphinx>=4,<6" "sphinx"
|
2022-08-12 12:06:08 +00:00
|
|
|
'';
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
nativeBuildInputs = [ flit-core ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
docutils
|
|
|
|
jinja2
|
|
|
|
mdit-py-plugins
|
|
|
|
markdown-it-py
|
|
|
|
pyyaml
|
|
|
|
sphinx
|
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "myst_parser" ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-06-16 17:23:12 +00:00
|
|
|
beautifulsoup4
|
|
|
|
pytest-param-files
|
|
|
|
pytest-regressions
|
|
|
|
sphinx-pytest
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# AssertionError due to different files
|
|
|
|
"test_basic"
|
|
|
|
"test_footnotes"
|
|
|
|
"test_gettext_html"
|
|
|
|
"test_fieldlist_extension"
|
2022-08-12 12:06:08 +00:00
|
|
|
# docutils 0.19 expectation mismatches
|
|
|
|
"test_docutils_roles"
|
2023-01-20 10:41:00 +00:00
|
|
|
# sphinx 6.0 expectation mismatches
|
|
|
|
"test_sphinx_directives"
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Sphinx and Docutils extension to parse MyST";
|
|
|
|
homepage = "https://myst-parser.readthedocs.io/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ loicreynier ];
|
|
|
|
};
|
|
|
|
}
|