Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 840305
Collapse All | Expand All

(-)a/www-apps/nikola/files/nikola-8.1.3-doit-auto.patch (+91 lines)
Line 0 Link Here
1
https://bugs.gentoo.org/840305
2
Patch from upstream:
3
4
commit a4c67b38c0faef6e04a3f2dcd1a26e592ae8f27c
5
Author: Chris Warrick <kwpolska@gmail.com>
6
Date:   Fri Apr 22 20:36:26 2022 +0200
7
8
    Fix #3612 — doit 0.36.0 compatibility
9
10
--- a/nikola/__main__.py
11
+++ b/nikola/__main__.py
12
@@ -36,8 +36,7 @@
13
 from collections import defaultdict
14
 
15
 from blinker import signal
16
-from doit.cmd_auto import Auto as DoitAuto
17
-from doit.cmd_base import TaskLoader, _wrap
18
+from doit.cmd_base import TaskLoader2, _wrap
19
 from doit.cmd_clean import Clean as DoitClean
20
 from doit.cmd_completion import TabCompletion
21
 from doit.cmd_help import Help as DoitHelp
22
@@ -247,31 +246,41 @@ def clean_tasks(self, tasks, dryrun, *a):
23
 
24
 # Nikola has its own "auto" commands that uses livereload.
25
 # Expose original doit "auto" command as "doit_auto".
26
-DoitAuto.name = 'doit_auto'
27
+# doit_auto is not available with doit>=0.36.0.
28
+try:
29
+    from doit.cmd_auto import Auto as DoitAuto
30
+    DoitAuto.name = 'doit_auto'
31
+except ImportError:
32
+    DoitAuto = None
33
 
34
 
35
-class NikolaTaskLoader(TaskLoader):
36
+class NikolaTaskLoader(TaskLoader2):
37
     """Nikola-specific task loader."""
38
 
39
     def __init__(self, nikola, quiet=False):
40
         """Initialize the loader."""
41
+        super().__init__()
42
         self.nikola = nikola
43
         self.quiet = quiet
44
 
45
-    def load_tasks(self, cmd, opt_values, pos_args):
46
-        """Load Nikola tasks."""
47
+    def load_doit_config(self):
48
+        """Load doit configuration."""
49
         if self.quiet:
50
-            DOIT_CONFIG = {
51
+            doit_config = {
52
                 'verbosity': 0,
53
                 'reporter': 'zero',
54
             }
55
         else:
56
-            DOIT_CONFIG = {
57
+            doit_config = {
58
                 'reporter': ExecutedOnlyReporter,
59
                 'outfile': sys.stderr,
60
             }
61
-        DOIT_CONFIG['default_tasks'] = ['render_site', 'post_render']
62
-        DOIT_CONFIG.update(self.nikola._doit_config)
63
+        doit_config['default_tasks'] = ['render_site', 'post_render']
64
+        doit_config.update(self.nikola._doit_config)
65
+        return doit_config
66
+
67
+    def load_tasks(self, cmd, pos_args):
68
+        """Load Nikola tasks."""
69
         try:
70
             tasks = generate_tasks(
71
                 'render_site',
72
@@ -286,15 +295,17 @@ def load_tasks(self, cmd, opt_values, pos_args):
73
                 raise
74
             _print_exception()
75
             sys.exit(3)
76
-        return tasks + latetasks, DOIT_CONFIG
77
+        return tasks + latetasks
78
 
79
 
80
 class DoitNikola(DoitMain):
81
     """Nikola-specific implementation of DoitMain."""
82
 
83
     # overwite help command
84
-    DOIT_CMDS = list(DoitMain.DOIT_CMDS) + [Help, Build, Clean, DoitAuto]
85
+    DOIT_CMDS = list(DoitMain.DOIT_CMDS) + [Help, Build, Clean]
86
     TASK_LOADER = NikolaTaskLoader
87
+    if DoitAuto is not None:
88
+        DOIT_CMDS.append(DoitAuto)
89
 
90
     def __init__(self, nikola, quiet=False):
91
         """Initialzie DoitNikola."""
(-)a/www-apps/nikola/nikola-8.1.3-r1.ebuild (-1 / +62 lines)
Line 0 Link Here
0
- 
1
# Copyright 1999-2022 Gentoo Authors
2
# Distributed under the terms of the GNU General Public License v2
3
4
EAPI=7
5
PYTHON_COMPAT=( python3_{8,9} )
6
DISTUTILS_USE_SETUPTOOLS=rdepend
7
8
inherit distutils-r1
9
10
MY_PN="Nikola"
11
MY_P="${MY_PN}-${PV}"
12
13
DESCRIPTION="A static website and blog generator"
14
HOMEPAGE="https://getnikola.com/"
15
SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
16
17
LICENSE="MIT Apache-2.0 CC0-1.0 public-domain"
18
SLOT="0"
19
KEYWORDS="~amd64 ~riscv"
20
IUSE="assets charts hyphenation ipython jinja server watchdog webmedia"
21
REQUIRED_USE="server? ( watchdog )"
22
RESTRICT="test" # needs coveralls
23
24
DEPEND=">=dev-python/docutils-0.13[${PYTHON_USEDEP}]" # needs rst2man to build manpage
25
RDEPEND="${DEPEND}
26
	>=dev-python/Babel-2.6.0[${PYTHON_USEDEP}]
27
	>=dev-python/blinker-1.3[${PYTHON_USEDEP}]
28
	>=dev-python/doit-0.32[${PYTHON_USEDEP}]
29
	>=dev-python/lxml-3.3.5[${PYTHON_USEDEP}]
30
	>=dev-python/mako-1.0[${PYTHON_USEDEP}]
31
	>=dev-python/markdown-3.0.0[${PYTHON_USEDEP}]
32
	>=dev-python/natsort-3.5.2[${PYTHON_USEDEP}]
33
	>=dev-python/piexif-1.0.3[${PYTHON_USEDEP}]
34
	>=dev-python/pygments-1.6[${PYTHON_USEDEP}]
35
	>=dev-python/PyRSS2Gen-1.1[${PYTHON_USEDEP}]
36
	>=dev-python/python-dateutil-2.6.0[${PYTHON_USEDEP}]
37
	>=dev-python/requests-2.2.0[${PYTHON_USEDEP}]
38
	>=dev-python/unidecode-0.04.16[${PYTHON_USEDEP}]
39
	>=dev-python/yapsy-1.11.223[${PYTHON_USEDEP}]
40
	dev-python/pillow[jpeg,${PYTHON_USEDEP}]
41
	dev-python/cloudpickle[${PYTHON_USEDEP}]
42
	assets? ( >=dev-python/webassets-0.10.1[${PYTHON_USEDEP}] )
43
	charts? ( >=dev-python/pygal-2.0.1[${PYTHON_USEDEP}] )
44
	hyphenation? ( >=dev-python/pyphen-0.9.1[${PYTHON_USEDEP}] )
45
	ipython? ( >=dev-python/ipython-2.0.0[notebook,${PYTHON_USEDEP}] )
46
	jinja? ( >=dev-python/jinja-2.7.2[${PYTHON_USEDEP}] )
47
	server? ( dev-python/aiohttp[${PYTHON_USEDEP}] )
48
	watchdog? ( >=dev-python/watchdog-0.8.3[${PYTHON_USEDEP}] )
49
	webmedia? ( >=dev-python/micawber-0.3.0[${PYTHON_USEDEP}] )"
50
51
S="${WORKDIR}/${MY_P}"
52
PATCHES=( "${FILESDIR}/${P}-doit-auto.patch" )
53
54
src_install() {
55
	distutils-r1_src_install
56
57
	# hackish way to remove docs that ended up in the wrong place
58
	rm -rv "${ED}/usr/share/doc/${PN}" || die
59
60
	dodoc AUTHORS.txt CHANGES.txt README.rst docs/*.rst
61
	gunzip "${ED}/usr/share/man/man1/${PN}.1.gz" || die
62
}

Return to bug 840305