diff --git a/pkgs/development/python-modules/Nikola/default.nix b/pkgs/development/python-modules/Nikola/default.nix index d8c49c99eba31..17a6e4d6a8996 100644 --- a/pkgs/development/python-modules/Nikola/default.nix +++ b/pkgs/development/python-modules/Nikola/default.nix @@ -1,79 +1,112 @@ { lib -, stdenv +, aiohttp +, Babel +, blinker , buildPythonPackage -, isPy3k -, fetchPypi -, doit -, glibcLocales -, pytest -, pytestcov -, mock -, pygments -, pillow , dateutil , docutils -, Mako -, unidecode +, doit +, fetchPypi +, freezegun +, ghp-import +, hsluv +, html5lib +, ipykernel +, jinja2 , lxml -, Yapsy -, PyRSS2Gen -, Logbook -, blinker -, natsort -, requests -, piexif +, Mako , markdown -, phpserialize -, jinja2 -, Babel -, freezegun -, toml +, micawber +, mock +, natsort , notebook +, phpserialize +, piexif +, pillow +, pygal +, pygments +, pyphen +, PyRSS2Gen +, pytestCheckHook +, pythonOlder +, requests , ruamel_yaml -, aiohttp +, stdenv +, toml +, typogrify +, unidecode , watchdog +, Yapsy }: buildPythonPackage rec { pname = "Nikola"; version = "8.1.3"; - - # Nix contains only Python 3 supported version of doit, which is a dependency - # of Nikola. Python 2 support would require older doit 0.29.0 (which on the - # other hand doesn't support Python 3.3). So, just disable Python 2. - disabled = !isPy3k; - - checkInputs = [ pytest pytestcov mock glibcLocales freezegun ]; - - propagatedBuildInputs = [ - # requirements.txt - doit pygments pillow dateutil docutils Mako markdown unidecode - lxml Yapsy PyRSS2Gen Logbook blinker natsort requests piexif Babel - # requirements-extras.txt - phpserialize jinja2 toml notebook ruamel_yaml aiohttp watchdog - ]; + disabled = pythonOlder "3.5"; src = fetchPypi { inherit pname version; sha256 = "05eac356bb4273cdd05d2dd6ad676226133496c457af91987c3f0d40e2fe57ef"; }; - patchPhase = '' - # upstream added bound so that requires.io doesn't send mails about update - # nikola should work with markdown 3.0: https://github.com/getnikola/nikola/pull/3175#issue-220147596 - sed -i 's/Markdown>.*/Markdown/' requirements.txt - ''; + propagatedBuildInputs = [ + aiohttp + Babel + blinker + dateutil + docutils + doit + ghp-import + hsluv + html5lib + ipykernel + jinja2 + lxml + Mako + markdown + micawber + natsort + notebook + phpserialize + piexif + pillow + pygal + pygments + pyphen + PyRSS2Gen + requests + ruamel_yaml + toml + typogrify + unidecode + watchdog + Yapsy + ]; + + checkInputs = [ + freezegun + mock + pytestCheckHook + ]; - checkPhase = '' - LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" py.test . + postPatch = '' + substituteInPlace setup.cfg \ + --replace "--cov nikola --cov-report term-missing" "" ''; - meta = { + disabledTests = [ + # AssertionError + "test_compiling_markdown" + ]; + + pythonImportsCheck = [ "nikola" ]; + + meta = with lib; { + description = "Static website and blog generator"; homepage = "https://getnikola.com/"; - description = "A modular, fast, simple, static website and blog generator"; - license = lib.licenses.mit; - maintainers = with lib.maintainers; [ jluttine ]; - # all tests fail + license = licenses.mit; + maintainers = with maintainers; [ jluttine ]; + # All tests fail broken = stdenv.isDarwin; }; } diff --git a/pkgs/development/python-modules/hsluv/default.nix b/pkgs/development/python-modules/hsluv/default.nix new file mode 100644 index 0000000000000..b6573db532680 --- /dev/null +++ b/pkgs/development/python-modules/hsluv/default.nix @@ -0,0 +1,32 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "hsluv"; + version = "5.0.2"; + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "hsluv"; + repo = "hsluv-python"; + rev = "v${version}"; + sha256 = "0r0w8ycjwfg3pmzjghzrs0lkam93fzvgiqvrwh3nl9jnqlpw7v7j"; + }; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "hsluv" ]; + + meta = with lib; { + description = "Python implementation of HSLuv"; + homepage = "https://github.com/hsluv/hsluv-python"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index bc88020a7f344..5505c88c369d0 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3111,6 +3111,8 @@ in { hsaudiotag3k = callPackage ../development/python-modules/hsaudiotag3k { }; + hsluv = callPackage ../development/python-modules/hsluv { }; + hstspreload = callPackage ../development/python-modules/hstspreload { }; html2text = callPackage ../development/python-modules/html2text { };