Skip to content

Commit

Permalink
Adding formatter for python files in tools/format.py (triton-inferenc…
Browse files Browse the repository at this point in the history
…e-server#1783)

* Add formatter for python files in the format script

* Formatted files with the default yapf settings

* New formatting

* Using google standard for formatting files
  • Loading branch information
tanmayv25 authored Jul 11, 2020
1 parent bc350e3 commit f7a5a0a
Show file tree
Hide file tree
Showing 90 changed files with 10,814 additions and 5,915 deletions.
84 changes: 43 additions & 41 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@

if not git_sha:
try:
git_sha = subprocess.check_output(["git", "log", "--pretty=format:'%h'", "-n1"]).decode('ascii').replace("'","").strip()
git_sha = subprocess.check_output(
["git", "log", "--pretty=format:'%h'",
"-n1"]).decode('ascii').replace("'", "").strip()
except:
git_sha = u'0000000'

Expand Down Expand Up @@ -93,13 +95,8 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.mathjax',
'sphinx.ext.napoleon',
'sphinx.ext.ifconfig',
'sphinx.ext.extlinks',
'nbsphinx',
'breathe',
'sphinx.ext.autodoc', 'sphinx.ext.mathjax', 'sphinx.ext.napoleon',
'sphinx.ext.ifconfig', 'sphinx.ext.extlinks', 'nbsphinx', 'breathe',
'exhale'
]

Expand Down Expand Up @@ -131,24 +128,29 @@
pygments_style = 'sphinx'

# Setup the breathe extension
breathe_projects = {
"BreatheTritonServer": "./doxyoutput/xml"
}
breathe_projects = {"BreatheTritonServer": "./doxyoutput/xml"}
breathe_default_project = "BreatheTritonServer"

# Setup the exhale extension
exhale_args = {
# These arguments are required
"containmentFolder": "./cpp_api",
"rootFileName": "cpp_api_root.rst",
"rootFileTitle": "C++ API",
"doxygenStripFromPath": "..",
"containmentFolder":
"./cpp_api",
"rootFileName":
"cpp_api_root.rst",
"rootFileTitle":
"C++ API",
"doxygenStripFromPath":
"..",
# Suggested optional arguments
"createTreeView": True,
"createTreeView":
True,
# TIP: if using the sphinx-bootstrap-theme, you need
# "treeViewIsBootstrap": True,
"exhaleExecutesDoxygen": True,
"exhaleDoxygenStdin": textwrap.dedent('''
"exhaleExecutesDoxygen":
True,
"exhaleDoxygenStdin":
textwrap.dedent('''
JAVADOC_AUTOBRIEF = YES
INPUT = ../src/core/tritonserver.h ../src/clients/c++/library/common.h ../src/clients/c++/library/grpc_client.h ../src/clients/c++/library/http_client.h ../src/backends/custom/custom.h ../src/custom/sdk/custom_instance.h
''')
Expand All @@ -160,7 +162,6 @@
# Tell sphinx what the pygments highlight language should be.
highlight_language = 'text'


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

# The theme to use for HTML and HTML Help pages. See the documentation for
Expand All @@ -174,10 +175,14 @@
# documentation.
#
html_theme_options = {
'canonical_url': 'https://docs.nvidia.com/deeplearning/triton-inference-server/user-guide/docs/index.html',
'collapse_navigation': False,
'display_version': True,
'logo_only': False,
'canonical_url':
'https://docs.nvidia.com/deeplearning/triton-inference-server/user-guide/docs/index.html',
'collapse_navigation':
False,
'display_version':
True,
'logo_only':
False,
}

# Add any paths that contain custom static files (such as style sheets) here,
Expand All @@ -195,13 +200,11 @@
#
# html_sidebars = {}


# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'NVIDIATritonServerdoc'


# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
Expand All @@ -226,38 +229,37 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'NVIDIATritonServer.tex', u'NVIDIA Triton Inference Server Documentation',
u'NVIDIA Corporation', 'manual'),
(master_doc, 'NVIDIATritonServer.tex',
u'NVIDIA Triton Inference Server Documentation', u'NVIDIA Corporation',
'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, 'nvidiatritonserver', u'NVIDIA Triton Inference Server Documentation',
[author], 1)
]

man_pages = [(master_doc, 'nvidiatritonserver',
u'NVIDIA Triton Inference Server 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, 'NVIDIATritonServer', u'NVIDIA Triton Inference Server Documentation',
author, 'NVIDIATritonServer', 'ML/DL inference server',
'Miscellaneous'),
(master_doc, 'NVIDIATritonServer',
u'NVIDIA Triton Inference Server Documentation', author,
'NVIDIATritonServer', 'ML/DL inference server', 'Miscellaneous'),
]


# -- Extension configuration -------------------------------------------------
extlinks = {'issue': ('https://github.com/NVIDIA/triton-inference-server/issues/%s',
'issue '),
'fileref': ('https://github.com/NVIDIA/triton-inference-server/tree/' +
(git_sha if git_sha != u'0000000' else "master") + '/%s', ''),}
extlinks = {
'issue': ('https://github.com/NVIDIA/triton-inference-server/issues/%s',
'issue '),
'fileref': ('https://github.com/NVIDIA/triton-inference-server/tree/' +
(git_sha if git_sha != u'0000000' else "master") + '/%s', ''),
}


def setup(app):
# If envvar is set then the file is expected to contain a script
Expand Down
Loading

0 comments on commit f7a5a0a

Please sign in to comment.