From 4e880e72409b49fc0d160cb206811dce04661db4 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Sat, 7 Jan 2023 16:58:13 -0500 Subject: [PATCH] python3.pkgs.sphinx-version-warning: init at unstable-2019-08-10 --- .../sphinx-version-warning/default.nix | 59 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 61 insertions(+) create mode 100644 pkgs/development/python-modules/sphinx-version-warning/default.nix diff --git a/pkgs/development/python-modules/sphinx-version-warning/default.nix b/pkgs/development/python-modules/sphinx-version-warning/default.nix new file mode 100644 index 000000000000..bf57d4f2fd83 --- /dev/null +++ b/pkgs/development/python-modules/sphinx-version-warning/default.nix @@ -0,0 +1,59 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, fetchpatch +, pythonImportsCheckHook +, sphinx +, sphinxHook +, sphinxcontrib-autoapi +, sphinx-rtd-theme +, sphinx-tabs +, sphinx-prompt +, sphinxemoji +}: + +# Latest tagged release release "1.1.2" (Nov 2018) does not contain +# documenation, it was added in commits Aug 10, 2019. Repository does not have +# any activity since then. +buildPythonPackage rec { + pname = "sphinx-version-warning"; + version = "unstable-2019-08-10"; + outputs = [ "out" "doc" ]; + + src = fetchFromGitHub { + owner = "humitos"; + repo = "sphinx-version-warning"; + rev = "a82156c2ea08e5feab406514d0ccd9d48a345f48"; + hash = "sha256-WnJYMk1gPLT0dBn7lmxVDNVkLYkDCgQOtM9fQ3kc6k0="; + }; + + # It tries to write to file relative to it own location at runtime + # and gets permission denied, since Nix store is immutable. + patches = [ + (fetchpatch { + url = "https://github.com/humitos/sphinx-version-warning/commit/cb1b47becf2a0d3b2570ca9929f42f7d7e472b6f.patch"; + hash = "sha256-Vj0QAHIBmc0VxE+TTmJePzvr5nc45Sn2qqM+C/pkgtM="; + }) + ]; + + nativeBuildInputs = [ + pythonImportsCheckHook + sphinxHook + sphinxcontrib-autoapi + sphinx-rtd-theme + sphinx-tabs + sphinx-prompt + sphinxemoji + ]; + + propagatedBuildInputs = [ sphinx ]; + + pythonImportsCheck = [ "versionwarning" ]; + + meta = with lib; { + description = "A sphinx extension to show a warning banner at the top of your documentation"; + homepage = "https://github.com/humitos/sphinx-version-warning"; + license = licenses.mit; + maintainers = with maintainers; [ kaction ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8b7f40d40a1e..f4db72c86179 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10848,6 +10848,8 @@ self: super: with self; { sphinx-testing = callPackage ../development/python-modules/sphinx-testing { }; + sphinx-version-warning = callPackage ../development/python-modules/sphinx-version-warning { }; + sphinxext-opengraph = callPackage ../development/python-modules/sphinxext-opengraph { }; spidev = callPackage ../development/python-modules/spidev { };