manual: clean up build and make compatible with python 3.7

This commit is contained in:
Sebastien Bourdeauducq 2019-02-26 17:11:16 +08:00
parent 0d05d4b813
commit f65bcbcbb2
1 changed files with 5 additions and 12 deletions

View File

@ -15,9 +15,9 @@
import sys import sys
import os import os
from unittest.mock import Mock
import sphinx_rtd_theme import sphinx_rtd_theme
from unittest.mock import MagicMock
# Hack-patch Sphinx so that ARTIQ-Python types are correctly printed # Hack-patch Sphinx so that ARTIQ-Python types are correctly printed
@ -26,21 +26,14 @@ from sphinx.ext import autodoc
autodoc.repr = str autodoc.repr = str
class Mock(MagicMock): mock_modules = ["artiq.gui.waitingspinnerwidget",
@classmethod
def __getattr__(cls, name):
if name == "_mock_methods":
return None
return Mock()
mock_modules = ["artiq.gui.moninj",
"artiq.gui.waitingspinnerwidget",
"artiq.gui.flowlayout", "artiq.gui.flowlayout",
"artiq.compiler.module",
"artiq.compiler.embedding",
"quamash", "pyqtgraph", "matplotlib", "quamash", "pyqtgraph", "matplotlib",
"numpy", "dateutil", "dateutil.parser", "prettytable", "PyQt5", "numpy", "dateutil", "dateutil.parser", "prettytable", "PyQt5",
"h5py", "serial", "scipy", "scipy.interpolate", "asyncserial", "h5py", "serial", "scipy", "scipy.interpolate", "asyncserial",
"llvmlite_artiq", "Levenshtein", "aiohttp"] "llvmlite_artiq", "Levenshtein", "aiohttp", "pythonparser"]
for module in mock_modules: for module in mock_modules:
sys.modules[module] = Mock() sys.modules[module] = Mock()