Fixed readthedocs

This commit is contained in:
Éloi Rivard 2020-11-06 13:47:47 +01:00
parent c99e87c530
commit 0addeed925
4 changed files with 35 additions and 15 deletions

View file

@ -16,8 +16,8 @@ It aims to be very light, simple to install and simple to maintain. Its main fea
<div align="center">
<img src="doc/_static/login.png" width="225" alt="Canaille" />
<img src="doc/_static/consent.png" width="225" alt="Canaille" />
<img src="doc/_static/profile.png" width="225" alt="Canaille" />
<img src="doc/_static/consent.png" width="225" alt="Canaille" />
</div>
# Documentation

View file

@ -1,17 +1,32 @@
#!/usr/bin/env python3
import configparser
import mock
import os
import sys
import pkg_resources
sys.path.insert(0, os.path.abspath("../.."))
sys.path.insert(0, os.path.abspath("../../canaille"))
sys.path.insert(0, os.path.abspath(".."))
sys.path.insert(0, os.path.abspath("../canaille"))
import canaille
# Readthedocs does not support C modules, so
# we have to mock them.
class Mock(mock.MagicMock):
@classmethod
def __getattr__(cls, name):
return mock.MagicMock()
MOCK_MODULES = ["ldap"]
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
config = configparser.ConfigParser()
config.read("../setup.cfg")
# -- General configuration ------------------------------------------------
rqmt = pkg_resources.require("canaille")[0]
extensions = [
"sphinx.ext.autodoc",
@ -30,14 +45,12 @@ project = "canaille"
copyright = "2020, Yaal"
author = "Yaal"
version = "%s.%s" % tuple(map(int, rqmt.version.split(".")[:2]))
release = rqmt.version
release = config["metadata"]["version"]
version = "%s.%s" % tuple(map(int, release.split(".")[:2]))
language = None
exclude_patterns = []
pygments_style = "sphinx"
todo_include_todos = False
autodoc_mock_imports = ["ldap"]
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),

View file

@ -19,14 +19,13 @@ Screenshots
:width: 225
:alt: Login
.. image:: _static/consent.png
:width: 225
:alt: Consent
.. image:: _static/profile.png
:width: 225
:alt: Profile
.. image:: _static/consent.png
:width: 225
:alt: Consent
Table of contents
=================

View file

@ -1,4 +1,12 @@
--editable .
authlib
click
email_validator
flask
flask-babel
flask-wtf
mock
sentry-sdk[flask]
sphinx
sphinx-rtd-theme
sphinx-issues
toml