Skip to content
Snippets Groups Projects
Commit 48a55e8a authored by Sergey Yakubov's avatar Sergey Yakubov
Browse files

start python docs

parent e0dcc22c
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,7 @@ option(BUILD_TESTS "Uses googletest to build tests" OFF)
option(BUILD_INTEGRATION_TESTS "Include integration tests (CMAKE >3.7 is needed)" OFF)
option(BUILD_DOCS "Uses doxygen to build the documentaion" OFF)
option(BUILD_BROKER "Build broker" OFF)
option(BUILD_PYTHON_DOCS "Uses sphinx to build the Python documentaion" OFF)
option(BUILD_WORKER_TOOLS "Build worker tools" OFF)
option(BUILD_EXAMPLES "Build examples" OFF)
......@@ -93,4 +94,13 @@ if(BUILD_DOCS)
include(doxygen)
endif()
if(BUILD_PYTHON_DOCS)
add_subdirectory (sphinx)
endif()
include(prepare_version)
\ No newline at end of file
......@@ -14,7 +14,7 @@ module = Extension("asapo_producer", ["asapo_producer.pyx"],
language="c++",
)
ext_modules = cythonize([module])
ext_modules = cythonize([module],compiler_directives={'embedsignature': True})
setup(ext_modules = ext_modules,
setup_requires=["numpy","cython>=0.28"],
......
file(COPY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
add_custom_target(
pydoc ALL
COMMAND
make html VERBATIM
WORKING_DIRECTORY sphinx
)
add_dependencies(pydoc python-lib2-producer)
add_dependencies(pydoc python-lib2)
# -*- coding: utf-8 -*-
#
# ASAP::O documentation build configuration file, created by
# sphinx-quickstart on Fri Aug 30 13:31:57 2019.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# 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.
#
import os
import sys
sys.path.insert(0, '/home/yakubov/projects/asapo/cmake-build-debug/worker/api/python')
sys.path.insert(0, '/home/yakubov/projects/asapo/cmake-build-debug/producer/api/python')
import asapo_producer
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# 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.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.ifconfig']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'ASAP::O'
copyright = u'2019, DESY IT'
author = u'DESY IT'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u''
# The full version, including alpha/beta/rc tags.
release = asapo_producer.__version__
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = []
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'classic'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_show_sourcelink = False
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'ASAPOdoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'ASAPO.tex', u'ASAP::O Documentation',
u'DESY IT', 'manual'),
]
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'asapo', u'ASAP::O Documentation',
[author], 1)
]
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'ASAPO', u'ASAP::O Documentation',
author, 'ASAPO', 'One line description of project.',
'Miscellaneous'),
]
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
##################
Consumer
##################
.. automodule:: asapo_worker
:members:
:undoc-members:
:show-inheritance:
.. ASAP::O documentation
ASAP::O documentation
===================================
ASAPO::O
Python API
===================================
.. toctree::
consumer
.. toctree::
producer
##################
Producer
##################
.. automodule:: asapo_producer
:members:
:undoc-members:
:show-inheritance:
......@@ -172,7 +172,7 @@ cdef class PyDataBroker:
del meta['_id']
return meta, None
cdef class PyDataBrokerFactory:
cdef class __PyDataBrokerFactory:
cdef DataBrokerFactory c_factory
def __cinit__(self):
with nogil:
......@@ -198,7 +198,12 @@ cdef class PyDataBrokerFactory:
return broker,None
def create_server_broker(server_name,source_path,beamtime_id,stream,token,timeout):
factory = PyDataBrokerFactory()
"""
:param server_name: Handler to this.
:type server_name: String
:param source_path: The network this node belongs to.
"""
factory = __PyDataBrokerFactory()
return factory.create_server_broker(_bytes(server_name),_bytes(source_path),_bytes(beamtime_id),_bytes(stream),_bytes(token),timeout)
......
......@@ -14,6 +14,7 @@ module = Extension("asapo_worker", ["asapo_worker.pyx"],
language="c++",
)
ext_modules = cythonize([module])
ext_modules = cythonize([module],compiler_directives={'embedsignature': True})
setup(ext_modules = ext_modules)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment