diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst new file mode 100644 index 0000000..a0636bc --- /dev/null +++ b/CONTRIBUTING.rst @@ -0,0 +1,16 @@ +If you would like to contribute to the development of OpenStack, +you must follow the steps in this page: + + https://docs.openstack.org/infra/manual/developers.html + +Once those steps have been completed, changes to OpenStack +should be submitted for review via the Gerrit tool, following +the workflow documented at: + + https://docs.openstack.org/infra/manual/developers.html#development-workflow + +Pull requests submitted through GitHub will be ignored. + +Bugs should be filed on Launchpad, not GitHub: + + https://bugs.launchpad.net/oslo.metrics diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 0000000..9284390 --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,12 @@ +# The order of packages is significant, because pip processes them in the order +# of appearance. Changing the order has an impact on the overall integration +# process, which may cause wedges in the gate later. + +# For generating sphinx documentation +openstackdocstheme>=1.18.1 # Apache-2.0 +sphinx>=1.8.0,!=2.1.0 # BSD +reno>=2.5.0 # Apache-2.0 +sphinxcontrib-apidoc>=0.2.0 # BSD + +# For autodoc builds +oslotest>=3.2.0 # Apache-2.0 diff --git a/doc/source/conf.py b/doc/source/conf.py new file mode 100755 index 0000000..caebc5f --- /dev/null +++ b/doc/source/conf.py @@ -0,0 +1,89 @@ +# -*- coding: utf-8 -*- +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import sys + +sys.path.insert(0, os.path.abspath('../..')) +# -- General configuration ---------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = [ + 'sphinxcontrib.apidoc', + 'sphinx.ext.intersphinx', + 'openstackdocstheme', + 'oslo_config.sphinxext', +] + +# openstackdocstheme options +openstackdocs_repo_name = 'openstack/oslo.metrics' +openstackdocs_bug_project = 'oslo.metrics' +openstackdocs_bug_tag = '' + +# sphinxcontrib.apidoc options +apidoc_module_dir = '../../oslo_metrics' +apidoc_output_dir = 'reference/api' +apidoc_excluded_paths = [ + 'tests' +] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'oslo.metrics' +copyright = u'2014, OpenStack Foundation' + +# If true, '()' will be appended to :func: etc. cross-reference text. +add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +add_module_names = True + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'native' + +# A list of ignored prefixes for module index sorting. +modindex_common_prefix = ['oslo_metrics.'] + +# -- Options for HTML output -------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. Major themes that come with +# Sphinx are currently 'default' and 'sphinxdoc'. +# html_theme_path = ["."] +html_theme = 'openstackdocs' +# html_static_path = ['static'] + +# Output file base name for HTML help builder. +htmlhelp_basename = '%sdoc' % project + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass +# [howto/manual]). +latex_documents = [ + ('index', + '%s.tex' % project, + u'%s Documentation' % project, + u'OpenStack Foundation', 'manual'), +] + +intersphinx_mapping = { + 'python': ('https://docs.python.org/', None), + 'osloconfig': ('http://docs.openstack.org/oslo.config/latest/', None), +} diff --git a/doc/source/contributor/index.rst b/doc/source/contributor/index.rst new file mode 100644 index 0000000..3d4ceb4 --- /dev/null +++ b/doc/source/contributor/index.rst @@ -0,0 +1,5 @@ +============ +Contributing +============ + +.. include:: ../../../CONTRIBUTING.rst diff --git a/doc/source/index.rst b/doc/source/index.rst new file mode 100644 index 0000000..54a4668 --- /dev/null +++ b/doc/source/index.rst @@ -0,0 +1,33 @@ +============ +oslo.metrics +============ + +This Oslo metrics API supports collecting metrics data from other Oslo +libraries and exposing the metrics data to monitoring system. + +Contents +======== + +.. toctree:: + :maxdepth: 2 + + install/index + contributor/index + reference/api/modules + user/index + + +Release Notes +============= + +Read also the `oslo.metrics Release Notes +`_. + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + diff --git a/doc/source/install/index.rst b/doc/source/install/index.rst new file mode 100644 index 0000000..581f27e --- /dev/null +++ b/doc/source/install/index.rst @@ -0,0 +1,7 @@ +============ +Installation +============ + +At the command line:: + + $ pip install oslo.metrics diff --git a/doc/source/user/history.rst b/doc/source/user/history.rst new file mode 100644 index 0000000..f69be70 --- /dev/null +++ b/doc/source/user/history.rst @@ -0,0 +1 @@ +.. include:: ../../../ChangeLog diff --git a/doc/source/user/index.rst b/doc/source/user/index.rst new file mode 100644 index 0000000..7ef7f54 --- /dev/null +++ b/doc/source/user/index.rst @@ -0,0 +1,13 @@ +================== +Using oslo.metrics +================== + +.. toctree:: + :maxdepth: 2 + + usage + +.. toctree:: + :maxdepth: 1 + + history diff --git a/doc/source/user/usage.rst b/doc/source/user/usage.rst new file mode 100644 index 0000000..c17f726 --- /dev/null +++ b/doc/source/user/usage.rst @@ -0,0 +1,8 @@ +===== +Usage +===== + +A simple example of oslo.metrics in use:: + + $ oslo-metrics + 2020-06-11 15:59:53.459 5435 INFO oslo.metrics.__main__ [-] Start oslo.metrics diff --git a/test-requirements.txt b/test-requirements.txt index 2d79b25..0ca55ed 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,7 +1,7 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking>=3.0,<3.1.0 # Apache-2.0 +hacking>=3.0.1,<3.1.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0 # Bandit security code scanner bandit>=1.1.0,<1.6.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index fe2f152..6b8d5d3 100644 --- a/tox.ini +++ b/tox.ini @@ -25,16 +25,16 @@ commands = [testenv:venv] commands = {posargs} +[testenv:docs] +whitelist_externals = rm +deps = + -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} + -r{toxinidir}/doc/requirements.txt +commands = + rm -fr doc/build + sphinx-build -W --keep-going -b html doc/source doc/build/html + # NOTE(hberaud): Not yet activated -#[testenv:docs] -#whitelist_externals = rm -#deps = -# -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -# -r{toxinidir}/doc/requirements.txt -#commands = -# rm -fr doc/build -# sphinx-build -W --keep-going -b html doc/source doc/build/html -# #[testenv:cover] #setenv = # PYTHON=coverage run --source oslo_cache --parallel-mode