Skip to content

Commit

Permalink
install 'openapi_client_udm' package from test-pypi to be able to bui…
Browse files Browse the repository at this point in the history
…ld Python module doc
  • Loading branch information
dansan committed Nov 23, 2019
1 parent 3a189be commit ded935b
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 20 deletions.
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ Don't forget to update the OpenAPI client library before running the test agains

$ update_openapi_client --generator <docker|java> $UCS_HOST

To get the IP address of the UCS Docker container run::

$ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' udm_rest_only

Logging
-------
Expand Down
29 changes: 25 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,40 @@
import sys
from pathlib import Path

from version import __version__

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

# get version information without importing project
proj_path = Path(__file__).parent.parent
sys.path.append(str(proj_path / "udm_rest_client"))
print(sys.path)
from version import __version__
# install 'openapi_client_udm' package from test-pypi to be able to build
# Python module doc
try:
import openapi_client_udm
except ImportError:
print("Installing 'openapi_client_udm' package from test-pypi...")
try:
from pip import main as pip_main
except ImportError:
from pip._internal import main as pip_main
pip_main.main(
[
"install",
"--compile",
"--upgrade",
"--index-url",
"https://test.pypi.org/simple/",
"openapi-client-udm",
]
)

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

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

# 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 @@ -82,8 +105,6 @@
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False

autodoc_mock_imports = ["openapi_client_udm"]

# -- Options for HTML output -------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
Expand Down
38 changes: 23 additions & 15 deletions docs/udm_rest_client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,47 @@ udm\_rest\_client.base module
-----------------------------

.. automodule:: udm_rest_client.base
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:

udm\_rest\_client.base\_http module
-----------------------------------

.. automodule:: udm_rest_client.base_http
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:

udm\_rest\_client.exceptions module
-----------------------------------

.. automodule:: udm_rest_client.exceptions
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:

udm\_rest\_client.udm module
----------------------------

.. automodule:: udm_rest_client.udm
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:

udm\_rest\_client.version module
--------------------------------

.. automodule:: udm_rest_client.version
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: udm_rest_client
:members:
:undoc-members:
:show-inheritance:
:members:
:undoc-members:
:show-inheritance:
5 changes: 4 additions & 1 deletion udm_rest_client/udm.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@
) from exc

# that code doesn't work when something goes wrong:
del openapi_client_udm.rest.RESTClientObject.__del__
try:
del openapi_client_udm.rest.RESTClientObject.__del__
except AttributeError:
pass


class UDM:
Expand Down

0 comments on commit ded935b

Please sign in to comment.