* [PATCH 1/3] python: fix documentation build with python 3.7
@ 2019-02-11 18:22 Jani Nikula
2019-02-11 18:22 ` [PATCH 2/3] python: fix documentation title underline Jani Nikula
2019-02-11 18:22 ` [PATCH 3/3] python: fix threads.__str__ automethod documentation Jani Nikula
0 siblings, 2 replies; 3+ messages in thread
From: Jani Nikula @ 2019-02-11 18:22 UTC (permalink / raw)
To: notmuch
From: Jani Nikula <jani.nikula@intel.com>
The simplistic mocking in conf.py falls short on python 3.7. Just use
unittest.mock instead.
Fixes:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/sphinx/config.py", line 368, in eval_config_file
execfile_(filename, namespace)
File "/usr/lib/python3/dist-packages/sphinx/util/pycompat.py", line 150, in execfile_
exec_(code, _globals)
File "/path/to/notmuch/bindings/python/docs/source/conf.py", line 39, in <module>
from notmuch import __VERSION__,__AUTHOR__
File "/path/to/notmuch/bindings/python/notmuch/__init__.py", line 54, in <module>
from .database import Database
File "/path/to/notmuch/bindings/python/notmuch/database.py", line 25, in <module>
from .globals import (
File "/path/to/notmuch/bindings/python/notmuch/globals.py", line 48, in <module>
class NotmuchDatabaseS(Structure):
TypeError: __mro_entries__ must return a tuple
---
bindings/python/docs/source/conf.py | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/bindings/python/docs/source/conf.py b/bindings/python/docs/source/conf.py
index 5b901c4ec4d8..8b43c5ca3f9f 100644
--- a/bindings/python/docs/source/conf.py
+++ b/bindings/python/docs/source/conf.py
@@ -13,22 +13,13 @@
import sys, os
+from unittest.mock import Mock
+
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0,os.path.abspath('../..'))
-class Mock(object):
- def __init__(self, *args, **kwargs):
- pass
-
- def __call__(self, *args, **kwargs):
- return Mock()
-
- @classmethod
- def __getattr__(self, name):
- return Mock() if name not in ('__file__', '__path__') else '/dev/null'
-
MOCK_MODULES = [
'ctypes',
]
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/3] python: fix documentation title underline
2019-02-11 18:22 [PATCH 1/3] python: fix documentation build with python 3.7 Jani Nikula
@ 2019-02-11 18:22 ` Jani Nikula
2019-02-11 18:22 ` [PATCH 3/3] python: fix threads.__str__ automethod documentation Jani Nikula
1 sibling, 0 replies; 3+ messages in thread
From: Jani Nikula @ 2019-02-11 18:22 UTC (permalink / raw)
To: notmuch
Fix documentation build sphinx warning:
filesystem.rst:18: WARNING: Title underline too short.
---
bindings/python/docs/source/filesystem.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bindings/python/docs/source/filesystem.rst b/bindings/python/docs/source/filesystem.rst
index 558c93de592a..13fe11946c46 100644
--- a/bindings/python/docs/source/filesystem.rst
+++ b/bindings/python/docs/source/filesystem.rst
@@ -15,7 +15,7 @@ Files and directories
instead.
:class:`Directory` -- A directory entry in the database
-------------------------------------------------------
+-------------------------------------------------------
.. autoclass:: Directory
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 3/3] python: fix threads.__str__ automethod documentation
2019-02-11 18:22 [PATCH 1/3] python: fix documentation build with python 3.7 Jani Nikula
2019-02-11 18:22 ` [PATCH 2/3] python: fix documentation title underline Jani Nikula
@ 2019-02-11 18:22 ` Jani Nikula
1 sibling, 0 replies; 3+ messages in thread
From: Jani Nikula @ 2019-02-11 18:22 UTC (permalink / raw)
To: notmuch
Indent the directive properly to attach it to Threads autoclass
documentation.
Fixes:
WARNING: don't know which module to import for autodocumenting
'__str__' (try placing a "module" or "currentmodule" directive in the
document, or giving an explicit module name)
---
bindings/python/docs/source/threads.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bindings/python/docs/source/threads.rst b/bindings/python/docs/source/threads.rst
index 4324ac82a389..46ce5be5412a 100644
--- a/bindings/python/docs/source/threads.rst
+++ b/bindings/python/docs/source/threads.rst
@@ -11,4 +11,4 @@
iterator and broke list(Threads()). Use `len(list(msgs))`
instead.
-.. automethod:: __str__
+ .. automethod:: __str__
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-02-11 18:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-11 18:22 [PATCH 1/3] python: fix documentation build with python 3.7 Jani Nikula
2019-02-11 18:22 ` [PATCH 2/3] python: fix documentation title underline Jani Nikula
2019-02-11 18:22 ` [PATCH 3/3] python: fix threads.__str__ automethod documentation Jani Nikula
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).