2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
2021-01-15 22:18:51 +00:00
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2021-01-15 22:18:51 +00:00
|
|
|
, isPy27
|
2020-04-24 23:36:52 +00:00
|
|
|
, docopt
|
|
|
|
, easywatch
|
|
|
|
, jinja2
|
2021-01-15 22:18:51 +00:00
|
|
|
, pytestCheckHook
|
2021-02-05 17:12:51 +00:00
|
|
|
, pytest-check
|
|
|
|
, fetchPypi
|
2021-01-15 22:18:51 +00:00
|
|
|
, markdown
|
2021-02-05 17:12:51 +00:00
|
|
|
, sphinx
|
|
|
|
, sphinx_rtd_theme
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "staticjinja";
|
2021-02-05 17:12:51 +00:00
|
|
|
version = "1.0.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
disabled = isPy27; # 0.4.0 drops python2 support
|
|
|
|
|
|
|
|
# For some reason, in pypi the tests get disabled when using
|
|
|
|
# PY_IGNORE_IMPORTMISMATCH, so we just fetch from GitHub
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "staticjinja";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-02-05 17:12:51 +00:00
|
|
|
sha256 = "12rpv5gv64i5j4w98wm1444xnnmarcn3pg783j3fkkzc58lk5wwj";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
jinja2
|
|
|
|
docopt
|
|
|
|
easywatch
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
2021-02-05 17:12:51 +00:00
|
|
|
pytest-check
|
2021-01-15 22:18:51 +00:00
|
|
|
markdown
|
2021-02-05 17:12:51 +00:00
|
|
|
sphinx_rtd_theme
|
|
|
|
sphinx
|
2021-01-15 22:18:51 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
preCheck = ''
|
2021-02-05 17:12:51 +00:00
|
|
|
# Import paths differ by a "build/lib" subdirectory, but the files are
|
|
|
|
# the same, so we ignore import mismatches.
|
2021-01-15 22:18:51 +00:00
|
|
|
export PY_IGNORE_IMPORTMISMATCH=1
|
2021-02-05 17:12:51 +00:00
|
|
|
# The tests need to find and call the installed staticjinja executable
|
|
|
|
export PATH="$PATH:$out/bin";
|
2021-01-15 22:18:51 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A library and cli tool that makes it easy to build static sites using Jinja2";
|
|
|
|
homepage = "https://staticjinja.readthedocs.io/en/latest/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fgaz ];
|
|
|
|
};
|
|
|
|
}
|