Skip to content

Commit

Permalink
fix RTD build: don't import project before configuration (autodoc_moc…
Browse files Browse the repository at this point in the history
…k_imports) is read
  • Loading branch information
dansan committed Nov 23, 2019
1 parent 092af54 commit 3a189be
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
14 changes: 8 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,19 @@
#
import os
import sys
from pathlib import Path

sys.path.insert(0, os.path.abspath(".."))

import udm_rest_client # isort:skip

proj_path = Path(__file__).parent.parent
sys.path.append(str(proj_path / "udm_rest_client"))
print(sys.path)
from version import __version__

# -- General configuration ---------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
needs_sphinx = '1.3' # autodoc_mock_imports >=1.3

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
Expand Down Expand Up @@ -58,9 +60,9 @@
# the built documents.
#
# The short X.Y version.
version = udm_rest_client.__version__
version = __version__
# The full version, including alpha/beta/rc tags.
release = udm_rest_client.__version__
release = __version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
16 changes: 8 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ commit = True
tag = True

[bumpversion:file:setup.py]
search = version='{current_version}'
replace = version='{new_version}'
search = version="{current_version}"
replace = version="{new_version}"

[bumpversion:file:udm_rest_client/__init__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'
[bumpversion:file:udm_rest_client/version.py]
search = __version__ = "{current_version}"
replace = __version__ = "{new_version}"

[bdist_wheel]
universal = 1
Expand All @@ -20,7 +20,6 @@ max-line-length = 90
ignore = E203, E501, W503

[aliases]
# Define setup.py command aliases here
test = pytest

[tool:pytest]
Expand All @@ -29,8 +28,9 @@ addopts = --verbose --showlocals

[coverage:report]
exclude_lines =
pragma: no cover
raise NotImplementedError
pragma: no cover
raise NotImplementedError

[isort]
known_third_party = docker

5 changes: 1 addition & 4 deletions udm_rest_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
UnknownModuleType,
)
from .udm import UDM
from .version import __author__, __email__, __version__

__all__ = [
"UDM",
Expand All @@ -34,7 +35,3 @@
"UnknownModuleType",
"APICommunicationError",
]

__author__ = """Daniel Troeder"""
__email__ = "troeder@univention.de"
__version__ = "0.1.0"
3 changes: 3 additions & 0 deletions udm_rest_client/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
__author__ = """Daniel Troeder"""
__email__ = "troeder@univention.de"
__version__ = "0.1.0"

0 comments on commit 3a189be

Please sign in to comment.