From af2e4fcee46a0440e71f5312792111dbc310fb8b Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Mon, 3 Sep 2018 20:56:21 +0000 Subject: [PATCH] Apply OpenStack Cookiecutter template Change-Id: I7172220a2b40cb856080e958bd4a340975449181 --- .coveragerc | 6 + .gitignore | 72 +++-- .gitreview | 4 + .mailmap | 3 + .stestr.conf | 3 + .zuul.yaml | 3 + CONTRIBUTING.rst | 119 +-------- HACKING.rst | 4 + LICENSE | 26 -- README.rst | 76 +----- babel.cfg | 2 + doc/requirements.txt | 4 + doc/source/admin/index.rst | 5 + doc/source/conf.py | 238 ++++------------- doc/source/configuration/index.rst | 5 + doc/source/contributor/contributing.rst | 4 + doc/source/contributor/index.rst | 9 + doc/source/index.rst | 24 +- doc/source/library/index.rst | 7 + doc/source/readme.rst | 1 + doc/source/reference/index.rst | 5 + doc/source/user/index.rst | 5 + os_ken/__init__.py | 19 ++ os_ken/tests/__init__.py | 0 os_ken/tests/base.py | 23 ++ os_ken/tests/test_os_ken.py | 28 ++ releasenotes/notes/.placeholder | 0 releasenotes/source/_static/.placeholder | 0 releasenotes/source/_templates/.placeholder | 0 releasenotes/source/conf.py | 281 ++++++++++++++++++++ releasenotes/source/index.rst | 8 + releasenotes/source/unreleased.rst | 5 + requirements.txt | 14 + setup.cfg | 68 ++--- setup.py | 23 +- test-requirements.txt | 17 ++ tox.ini | 99 +++---- 37 files changed, 679 insertions(+), 531 deletions(-) create mode 100644 .coveragerc create mode 100644 .gitreview create mode 100644 .mailmap create mode 100644 .stestr.conf create mode 100644 .zuul.yaml create mode 100644 HACKING.rst create mode 100644 babel.cfg create mode 100644 doc/requirements.txt create mode 100644 doc/source/admin/index.rst mode change 100644 => 100755 doc/source/conf.py create mode 100644 doc/source/configuration/index.rst create mode 100644 doc/source/contributor/contributing.rst create mode 100644 doc/source/contributor/index.rst create mode 100644 doc/source/library/index.rst create mode 100644 doc/source/readme.rst create mode 100644 doc/source/reference/index.rst create mode 100644 doc/source/user/index.rst create mode 100644 os_ken/__init__.py create mode 100644 os_ken/tests/__init__.py create mode 100644 os_ken/tests/base.py create mode 100644 os_ken/tests/test_os_ken.py create mode 100644 releasenotes/notes/.placeholder create mode 100644 releasenotes/source/_static/.placeholder create mode 100644 releasenotes/source/_templates/.placeholder create mode 100644 releasenotes/source/conf.py create mode 100644 releasenotes/source/index.rst create mode 100644 releasenotes/source/unreleased.rst create mode 100644 requirements.txt create mode 100644 test-requirements.txt diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..efafbd26 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,6 @@ +[run] +branch = True +source = os_ken + +[report] +ignore_errors = True diff --git a/.gitignore b/.gitignore index 3388eb14..59b35f50 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,59 @@ -*.py[co] -*~ -*.egg-info/ -build/ -dist/ +*.py[cod] -GTAGS -GRTAGS -GPATH -GSYMS -*.log -.venv/ -.tox/ -.coverage -covhtml/ -coverage.xml +# C extensions +*.so + +# Packages +*.egg* +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg +lib +lib64 + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +cover/ +.coverage* +!.coveragerc +.tox nosetests.xml +.testrepository +.stestr +.venv + +# Translations +*.mo + +# Mr Developer +.mr.developer.cfg +.project +.pydevproject + +# Complexity +output/*.html +output/*/index.html + +# Sphinx +doc/build + +# pbr generates these +AUTHORS +ChangeLog + +# Editors +*~ +.*.swp +.*sw? + +# Files created by releasenotes build +releasenotes/build diff --git a/.gitreview b/.gitreview new file mode 100644 index 00000000..5bc58447 --- /dev/null +++ b/.gitreview @@ -0,0 +1,4 @@ +[gerrit] +host=review.openstack.org +port=29418 +project=openstack/os-ken.git diff --git a/.mailmap b/.mailmap new file mode 100644 index 00000000..516ae6fe --- /dev/null +++ b/.mailmap @@ -0,0 +1,3 @@ +# Format is: +# +# diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 00000000..22f9d4d7 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=${OS_TEST_PATH:-./os_ken/tests} +top_dir=./ diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 00000000..e7c200ac --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,3 @@ +- project: + templates: + - noop-jobs diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 11387509..10841ba7 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -1,114 +1,15 @@ -******************************* -How to Get Your Change Into Ryu -******************************* +If you would like to contribute to the development of OpenStack, you must +follow the steps in this page: -Submitting a change -=================== + http://docs.openstack.org/infra/manual/developers.html -Send patches to ryu-devel@lists.sourceforge.net. Please don't use "Pull -Request" on GitHub. We expect you to send patches in "git-format-patch" -style. +If you already have a good understanding of how the system works and your +OpenStack accounts are set up, you can skip to the development workflow +section of this documentation to learn how changes to OpenStack should be +submitted for review via the Gerrit tool: -.. code-block:: bash + http://docs.openstack.org/infra/manual/developers.html#development-workflow - # "N" means the number of commits to be included - $ git format-patch -s HEAD~N +Pull requests submitted through GitHub will be ignored. - # To add cover (e.g., [PATCH 0/X]), specify "--cover-letter" option - $ git format-patch -s --cover-letter HEAD~N - - # You can send patches by "git send-email" command - $ git send-email --to="ryu-devel@lists.sourceforge.net" *.patch - -Please check your changes with autopep8, pycodestyle(pep8) and running -unit tests to make sure that they don't break the existing features. -The following command does all for you. - -.. code-block:: bash - - # Install dependencies of tests - $ pip install -r tools/test-requires - - # Execute autopep8 - # Also, it is convenient to add settings of your editor or IDE for - # applying autopep8 automatically. - $ autopep8 --recursive --in-place ryu/ - - # Execute unit tests and pycodestyle(pep8) - $ ./run_tests.sh - -Of course, you are encouraged to add unit tests when you add new -features (it's not a must though). - -Python version and libraries -============================ -* Python 2.7, 3.4, 3.5: - - Ryu supports multiple Python version. CI tests on Travis-CI is running - on these versions. - -* standard library + widely used library: - - Basically widely used == OpenStack adopted. - As usual there are exceptions. Or python binding library for other - component. - -Coding style guide -================== -* pep8: - - As python is used, PEP8 is would be hopefully mandatory for - https://www.python.org/dev/peps/pep-0008/ - -* pylint: - - Although pylint is useful for finding bugs, but pylint score not very - important for now because we're still at early development stage. - https://www.pylint.org/ - -* Google python style guide is very helpful: - http://google.github.io/styleguide/pyguide.html - -* Guidelines derived from Guido's Recommendations: - - ============================= ================= ======== - Type Public Internal - ============================= ================= ======== - Packages lower_with_under - Modules lower_with_under _lower_with_under - Classes CapWords _CapWords - Exceptions CapWords - Functions lower_with_under() _lower_with_under() - Global/Class Constants CAPS_WITH_UNDER _CAPS_WITH_UNDER - Global/Class Variables lower_with_under _lower_with_under - Instance Variables lower_with_under _lower_with_under (protected) or __lower_with_under (private) - Method Names lower_with_under() _lower_with_under() (protected) or __lower_with_under() (private) - Function/Method Parameters lower_with_under - Local Variables lower_with_under - ============================= ================= ======== - -* OpenStack Nova style guide: - https://github.com/openstack/nova/blob/master/HACKING.rst - -* JSON files: - - Ryu source tree has JSON files under ryu/tests/unit/ofproto/json. - They are used by unit tests. To make patches easier to read, - they are normalized using tools/normalize_json.py. Please re-run - the script before committing changes to these JSON files. - -Reference -========= -* Python Essential Reference, 4th Edition [Amazon] - * Paperback: 717 pages - * Publisher: Addison-Wesley Professional; 4 edition (July 19, 2009) - * Language: English - * ISBN-10: 0672329786 - * ISBN-13: 978-0672329784 - -* The Python Standard Library by Example (Developer's Library) - * Paperback: 1344 pages - * Publisher: Addison-Wesley Professional; 1 edition (June 11, 2011) - * Language: English - * ISBN-10: 0321767349 - * ISBN-13: 978-0321767349 +Bugs should be filed on Launchpad: https://bugs.launchpad.net/neutron diff --git a/HACKING.rst b/HACKING.rst new file mode 100644 index 00000000..bf1f8483 --- /dev/null +++ b/HACKING.rst @@ -0,0 +1,4 @@ +os-ken Style Commandments +=============================================== + +Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/ diff --git a/LICENSE b/LICENSE index d6456956..68c771a0 100644 --- a/LICENSE +++ b/LICENSE @@ -174,29 +174,3 @@ incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/README.rst b/README.rst index 1a54ae7c..ed9b09ec 100644 --- a/README.rst +++ b/README.rst @@ -1,69 +1,13 @@ -What's Ryu -========== -Ryu is a component-based software defined networking framework. +====== +os-ken +====== -Ryu provides software components with well defined API that make it -easy for developers to create new network management and control -applications. Ryu supports various protocols for managing network -devices, such as OpenFlow, Netconf, OF-config, etc. About OpenFlow, -Ryu supports fully 1.0, 1.2, 1.3, 1.4, 1.5 and Nicira Extensions. +A component-based software defined networking framework in OpenStack. -All of the code is freely available under the Apache 2.0 license. Ryu -is fully written in Python. +This is a fork of the Ryu library tailored for OpenStack Neutron. - -Quick Start -=========== -Installing Ryu is quite easy:: - - % pip install ryu - -If you prefer to install Ryu from the source code:: - - % git clone git://github.com/osrg/ryu.git - % cd ryu; pip install . - -If you want to write your Ryu application, have a look at -`Writing ryu application `_ document. -After writing your application, just type:: - - % ryu-manager yourapp.py - - -Optional Requirements -===================== - -Some functionalities of ryu requires extra packages: - -- OF-Config requires lxml and ncclient -- NETCONF requires paramiko -- BGP speaker (SSH console) requires paramiko -- Zebra protocol service (database) requires SQLAlchemy - -If you want to use the functionalities, please install requirements:: - - % pip install -r tools/optional-requires - -Please refer to tools/optional-requires for details. - - -Prerequisites -============= -If you got some error messages at installation step, please confirm -dependencies for building required Python packages. - -On Ubuntu(16.04 LTS or later):: - - % apt install gcc python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev zlib1g-dev - - -Support -======= -Ryu Official site is ``_. - -If you have any -questions, suggestions, and patches, the mailing list is available at -`ryu-devel ML -`_. -`The ML archive at Gmane `_ -is also available. +* License: Apache License, Version 2.0 +* Documentation: https://docs.openstack.org/os-ken/latest/ +* Source: https://git.openstack.org/cgit/openstack/os-ken +* Bugs: https://bugs.launchpad.net/os-ken +* Release Notes: https://docs.openstack.org/releasenotes/os-ken diff --git a/babel.cfg b/babel.cfg new file mode 100644 index 00000000..15cd6cb7 --- /dev/null +++ b/babel.cfg @@ -0,0 +1,2 @@ +[python: **.py] + diff --git a/doc/requirements.txt b/doc/requirements.txt new file mode 100644 index 00000000..afd3597a --- /dev/null +++ b/doc/requirements.txt @@ -0,0 +1,4 @@ +sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD +openstackdocstheme>=1.18.1 # Apache-2.0 +# releasenotes +reno>=2.5.0 # Apache-2.0 diff --git a/doc/source/admin/index.rst b/doc/source/admin/index.rst new file mode 100644 index 00000000..9fc72f32 --- /dev/null +++ b/doc/source/admin/index.rst @@ -0,0 +1,5 @@ +==================== +Administrators guide +==================== + +Administrators guide of os-ken. diff --git a/doc/source/conf.py b/doc/source/conf.py old mode 100644 new mode 100755 index 23b11874..a67e782c --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -1,224 +1,82 @@ # -*- 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 # -# ryu documentation build configuration file, created by -# sphinx-quickstart on Mon Dec 5 15:38:48 2011. +# http://www.apache.org/licenses/LICENSE-2.0 # -# 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. +# 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 sys, os +import os +import sys -# 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. sys.path.insert(0, os.path.abspath('../..')) -sys.path.insert(0, os.path.abspath('.')) +# -- General configuration ---------------------------------------------------- -from ryu import version as ryu_version +# 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', + 'openstackdocstheme', + #'sphinx.ext.intersphinx', +] -# -- 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' ] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +# autodoc generation is a bit aggressive and a nuisance when doing heavy +# text edit cycles. +# execute "export SPHINX_DEBUG=1" in your terminal to disable # The suffix of source filenames. source_suffix = '.rst' -# The encoding of source files. -#source_encoding = 'utf-8-sig' - # The master toctree document. master_doc = 'index' # General information about the project. -project = u'Ryu' -copyright = u'2011-2014 Nippon Telegraph and Telephone Corporation' +project = u'os-ken' +copyright = u'2018, OpenStack Developers' -# 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 = ryu_version -# The full version, including alpha/beta/rc tags. -release = ryu_version - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -#language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = [] - -# The reST default role (used for this markup: `text`) to use for all documents. -#default_role = None +# openstackdocstheme options +repository_name = 'openstack/os-ken' +bug_project = 'neutron' +bug_tag = '' +html_last_updated_fmt = '%Y-%m-%d %H:%M' # If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True +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 - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False +add_module_names = True # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' -# A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] +# -- Options for HTML output -------------------------------------------------- - -# -- 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 = 'sphinx_rtd_theme' - -# 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 themes here, relative to this directory. -#html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -#html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -#html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -#html_favicon = None - -# 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'] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True -# (Deprecated since version 1.6) - -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} - -# If false, no module index is generated. -#html_domain_indices = True - -# If false, no index is generated. -#html_use_index = True - -# If true, the index is split into individual pages for each letter. -#html_split_index = False - -# If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -#html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None +# 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 = '_theme' +# html_static_path = ['static'] +html_theme = 'openstackdocs' # Output file base name for HTML help builder. -htmlhelp_basename = 'ryudoc' - - -# -- Options for LaTeX output -------------------------------------------------- - -# The paper size ('letter' or 'a4'). -#latex_paper_size = 'letter' - -# The font size ('10pt', '11pt' or '12pt'). -#latex_font_size = '10pt' +htmlhelp_basename = '%sdoc' % project # Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass [howto/manual]). +# (source start file, target name, title, author, documentclass +# [howto/manual]). latex_documents = [ - ('index', 'ryu.tex', u'ryu Documentation', - u'ryu development team', 'manual'), + ('index', + '%s.tex' % project, + u'%s Documentation' % project, + u'OpenStack Developers', 'manual'), ] -# The name of an image file (relative to this directory) to place at the top of -# the title page. -#latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -#latex_use_parts = False - -# If true, show page references after internal links. -#latex_show_pagerefs = False - -# If true, show URL addresses after external links. -#latex_show_urls = False - -# Additional stuff for the LaTeX preamble. -#latex_preamble = '' - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# If false, no module index is generated. -#latex_domain_indices = True - - -# -- Options for manual page output -------------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ('index', 'ryu', u'ryu Documentation', - [u'Ryu development team'], 8), - ('man/ryu', 'ryu', u'management for Ryu application', - [u'Ryu development team'], 8), - ('man/ryu_manager', 'ryu-manager', 'management for Ryu application', - [u'Ryu development team'], 8), -] +# Example configuration for intersphinx: refer to the Python standard library. +#intersphinx_mapping = {'http://docs.python.org/': None} diff --git a/doc/source/configuration/index.rst b/doc/source/configuration/index.rst new file mode 100644 index 00000000..70cb48d8 --- /dev/null +++ b/doc/source/configuration/index.rst @@ -0,0 +1,5 @@ +============= +Configuration +============= + +Configuration of os-ken. diff --git a/doc/source/contributor/contributing.rst b/doc/source/contributor/contributing.rst new file mode 100644 index 00000000..2aa07077 --- /dev/null +++ b/doc/source/contributor/contributing.rst @@ -0,0 +1,4 @@ +============ +Contributing +============ +.. include:: ../../../CONTRIBUTING.rst diff --git a/doc/source/contributor/index.rst b/doc/source/contributor/index.rst new file mode 100644 index 00000000..036e4494 --- /dev/null +++ b/doc/source/contributor/index.rst @@ -0,0 +1,9 @@ +=========================== + Contributor Documentation +=========================== + +.. toctree:: + :maxdepth: 2 + + contributing + diff --git a/doc/source/index.rst b/doc/source/index.rst index 3d318046..072e506c 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -1,23 +1,24 @@ -.. ryu documentation master file, created by - sphinx-quickstart on Mon Dec 5 15:38:48 2011. +.. os-ken documentation master file, created by + sphinx-quickstart on Tue Jul 9 22:26:36 2013. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -************************************************ -Welcome to RYU the Network Operating System(NOS) -************************************************ +====================================== +Welcome to the documentation of os_ken +====================================== Contents: .. toctree:: :maxdepth: 2 - getting_started.rst - developing.rst - configuration.rst - tests.rst - snort_integrate.rst - app.rst + readme + library/index + contributor/index + configuration/index + user/index + admin/index + reference/index Indices and tables ================== @@ -25,4 +26,3 @@ Indices and tables * :ref:`genindex` * :ref:`modindex` * :ref:`search` - diff --git a/doc/source/library/index.rst b/doc/source/library/index.rst new file mode 100644 index 00000000..cf27fa01 --- /dev/null +++ b/doc/source/library/index.rst @@ -0,0 +1,7 @@ +======== +Usage +======== + +To use os-ken in a project:: + + import os_ken diff --git a/doc/source/readme.rst b/doc/source/readme.rst new file mode 100644 index 00000000..a6210d3d --- /dev/null +++ b/doc/source/readme.rst @@ -0,0 +1 @@ +.. include:: ../../README.rst diff --git a/doc/source/reference/index.rst b/doc/source/reference/index.rst new file mode 100644 index 00000000..e4d110e6 --- /dev/null +++ b/doc/source/reference/index.rst @@ -0,0 +1,5 @@ +========== +References +========== + +References of os-ken. diff --git a/doc/source/user/index.rst b/doc/source/user/index.rst new file mode 100644 index 00000000..9168a548 --- /dev/null +++ b/doc/source/user/index.rst @@ -0,0 +1,5 @@ +=========== +Users guide +=========== + +Users guide of os-ken. diff --git a/os_ken/__init__.py b/os_ken/__init__.py new file mode 100644 index 00000000..e23eca05 --- /dev/null +++ b/os_ken/__init__.py @@ -0,0 +1,19 @@ +# -*- 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 pbr.version + + +__version__ = pbr.version.VersionInfo( + 'os-ken').version_string() diff --git a/os_ken/tests/__init__.py b/os_ken/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/os_ken/tests/base.py b/os_ken/tests/base.py new file mode 100644 index 00000000..1c30cdb5 --- /dev/null +++ b/os_ken/tests/base.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- + +# Copyright 2010-2011 OpenStack Foundation +# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. +# +# 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. + +from oslotest import base + + +class TestCase(base.BaseTestCase): + + """Test case base class for all unit tests.""" diff --git a/os_ken/tests/test_os_ken.py b/os_ken/tests/test_os_ken.py new file mode 100644 index 00000000..1f27312a --- /dev/null +++ b/os_ken/tests/test_os_ken.py @@ -0,0 +1,28 @@ +# -*- 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. + +""" +test_os_ken +---------------------------------- + +Tests for `os_ken` module. +""" + +from os_ken.tests import base + + +class TestOs_ken(base.TestCase): + + def test_something(self): + pass diff --git a/releasenotes/notes/.placeholder b/releasenotes/notes/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/releasenotes/source/_static/.placeholder b/releasenotes/source/_static/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/releasenotes/source/_templates/.placeholder b/releasenotes/source/_templates/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py new file mode 100644 index 00000000..1265fcd4 --- /dev/null +++ b/releasenotes/source/conf.py @@ -0,0 +1,281 @@ +# -*- 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. + +# 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. +# sys.path.insert(0, os.path.abspath('.')) + +# -- 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 = [ + 'openstackdocstheme', + 'reno.sphinxext', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +# source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'os_ken Release Notes' +copyright = u'2018, OpenStack Developers' + +# openstackdocstheme options +repository_name = 'openstack/os-ken' +bug_project = 'neutron' +bug_tag = '' +html_last_updated_fmt = '%Y-%m-%d %H:%M' + +# 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. +# The full version, including alpha/beta/rc tags. +release = '' +# The short X.Y version. +version = '' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +# today = '' +# Else, today_fmt is used as the format for a strftime call. +# today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = [] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# default_role = None + +# 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 + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +# show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +# modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +# keep_warnings = False + + +# -- 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 = 'openstackdocs' + +# 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 themes here, relative to this directory. +# html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +# html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +# html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +# html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# html_favicon = None + +# 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'] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +# html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +# html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +# html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +# html_additional_pages = {} + +# If false, no module index is generated. +# html_domain_indices = True + +# If false, no index is generated. +# html_use_index = True + +# If true, the index is split into individual pages for each letter. +# html_split_index = False + +# If true, links to the reST sources are added to the pages. +# html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +# html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +# html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +# html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +# html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'os_kenReleaseNotesdoc' + + +# -- 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': '', +} + +# 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 = [ + ('index', 'os_kenReleaseNotes.tex', + u'os_ken Release Notes Documentation', + u'OpenStack Foundation', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +# latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +# latex_use_parts = False + +# If true, show page references after internal links. +# latex_show_pagerefs = False + +# If true, show URL addresses after external links. +# latex_show_urls = False + +# Documents to append as an appendix to all manuals. +# latex_appendices = [] + +# If false, no module index is generated. +# latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'os_kenrereleasenotes', + u'os_ken Release Notes Documentation', + [u'OpenStack Foundation'], 1) +] + +# If true, show URL addresses after external links. +# man_show_urls = False + + +# -- 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 = [ + ('index', 'os_ken ReleaseNotes', + u'os_ken Release Notes Documentation', + u'OpenStack Foundation', 'os_kenReleaseNotes', + 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +# texinfo_appendices = [] + +# If false, no module index is generated. +# texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +# texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +# texinfo_no_detailmenu = False + +# -- Options for Internationalization output ------------------------------ +locale_dirs = ['locale/'] diff --git a/releasenotes/source/index.rst b/releasenotes/source/index.rst new file mode 100644 index 00000000..7f5f1d91 --- /dev/null +++ b/releasenotes/source/index.rst @@ -0,0 +1,8 @@ +============================================ + os_ken Release Notes +============================================ + +.. toctree:: + :maxdepth: 1 + + unreleased diff --git a/releasenotes/source/unreleased.rst b/releasenotes/source/unreleased.rst new file mode 100644 index 00000000..cd22aabc --- /dev/null +++ b/releasenotes/source/unreleased.rst @@ -0,0 +1,5 @@ +============================== + Current Series Release Notes +============================== + +.. release-notes:: diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..a631f64f --- /dev/null +++ b/requirements.txt @@ -0,0 +1,14 @@ +# 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. + +pbr>=2.0 # Apache-2.0 +eventlet!=0.18.3,>=0.18.2,!=0.20.1,!=0.21.0,!=0.23.0 +msgpack>=0.3.0 # RPC library, BGP speaker(net_cntl) +netaddr +oslo.config>=2.5.0 +ovs>=2.6.0 # OVSDB +routes # wsgi +six>=1.4.0 +tinyrpc # RPC library, BGP speaker(net_cntl) +webob>=1.2 # wsgi diff --git a/setup.cfg b/setup.cfg index 898a7c1d..44e49892 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,57 +1,37 @@ [metadata] -name = ryu -summary = Component-based Software-defined Networking Framework -license = Apache License 2.0 -author = Ryu project team -author-email = ryu-devel@lists.sourceforge.net -home-page = http://osrg.github.io/ryu/ -description-file = README.rst -platform = any +name = os-ken +summary = A component-based software defined networking framework for OpenStack. +description-file = + README.rst +author = OpenStack +author-email = openstack-dev@lists.openstack.org +home-page = http://www.openstack.org/ classifier = - Development Status :: 5 - Production/Stable + Environment :: OpenStack + Intended Audience :: Information Technology + Intended Audience :: System Administrators License :: OSI Approved :: Apache Software License - Topic :: System :: Networking - Natural Language :: English + Operating System :: POSIX :: Linux Programming Language :: Python + Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 - Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Operating System :: Unix -keywords = - openflow - openvswitch - openstack [files] packages = - ryu -data_files = - etc/ryu = - etc/ryu/ryu.conf + os_ken -[build_sphinx] -all_files = 1 -build-dir = doc/build -source-dir = doc/source +[compile_catalog] +directory = os_ken/locale +domain = os_ken -[bdist_rpm] -Release = 1 -Group = Applications/Accessories -Requires = python-eventlet, python-routes, python-webob, python-paramiko, python-netaddr, python-lxml, python-oslo-config, python-msgpack -doc_files = LICENSE - MANIFEST.in - README.rst - CONTRIBUTING.rst - doc/ +[update_catalog] +domain = os_ken +output_dir = os_ken/locale +input_file = os_ken/locale/os_ken.pot -[global] -setup-hooks = - ryu.hooks.setup_hook - -[entry_points] -console_scripts = - ryu-manager = ryu.cmd.manager:main - ryu = ryu.cmd.ryu_base:main +[extract_messages] +keywords = _ gettext ngettext l_ lazy_gettext +mapping_file = babel.cfg +output_file = os_ken/locale/os_ken.pot diff --git a/setup.py b/setup.py index cf2a404d..056c16c2 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ -# Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation. -# Copyright (C) 2011 Isaku Yamahata +# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,17 +13,17 @@ # See the License for the specific language governing permissions and # limitations under the License. -# a bug workaround. http://bugs.python.org/issue15881 +# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT +import setuptools + +# In python < 2.7.4, a lazy loading of package `pbr` will break +# setuptools if some other modules registered functions in `atexit`. +# solution from: http://bugs.python.org/issue15881#msg170215 try: - import multiprocessing + import multiprocessing # noqa except ImportError: pass -import setuptools -import ryu.hooks - - -ryu.hooks.save_orig() -setuptools.setup(name='ryu', - setup_requires=['pbr'], - pbr=True) +setuptools.setup( + setup_requires=['pbr'], + pbr=True) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 00000000..7e9616e8 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,17 @@ +# 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>=0.12.0,<0.13 # Apache-2.0 + +coverage>=4.0,!=4.4 # Apache-2.0 +python-subunit>=0.0.18 # Apache-2.0/BSD +oslotest>=1.10.0 # Apache-2.0 +stestr>=1.0.0 # Apache-2.0 +testtools>=1.4.0 # MIT +autopep8 +mock +nose +pycodestyle +pylint +formencode diff --git a/tox.ini b/tox.ini index 65136233..2eb36681 100644 --- a/tox.ini +++ b/tox.ini @@ -1,67 +1,52 @@ [tox] -envlist = py27,py34,py35,py36,py37,pypy,pycodestyle,autopep8 +minversion = 2.0 +envlist = py35,py27,pep8 +skipsdist = True [testenv] -deps = - -U - -r{toxinidir}/tools/pip-requires - --no-cache-dir usedevelop = True -passenv= NOSE_VERBOSE -# Note: To check whether tools/pip-requires satisfies the requirements -# for running Ryu, the following runs ryu-manager berfore installing -# the addtional requirements. +install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} +setenv = + VIRTUAL_ENV={envdir} + PYTHONWARNINGS=default::DeprecationWarning + OS_STDOUT_CAPTURE=1 + OS_STDERR_CAPTURE=1 + OS_TEST_TIMEOUT=60 +deps = -r{toxinidir}/test-requirements.txt +commands = stestr run {posargs} + +[testenv:pep8] +commands = flake8 {posargs} + +[testenv:venv] +commands = {posargs} + +[testenv:cover] +setenv = + VIRTUAL_ENV={envdir} + PYTHON=coverage run --source os_ken --parallel-mode commands = - ryu-manager ryu/tests/unit/cmd/dummy_openflow_app.py - pip install -r{toxinidir}/tools/optional-requires -r{toxinidir}/tools/test-requires - coverage run --source=ryu ryu/tests/run_tests.py '{posargs}' + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml -[testenv:scenario] +[testenv:docs] +deps = -r{toxinidir}/doc/requirements.txt +commands = sphinx-build -W -b html doc/source doc/build/html + +[testenv:releasenotes] +deps = {[testenv:docs]deps} commands = - python ryu/tests/integrated/run_test.py + sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html -[testenv:py27] -commands = - {[testenv]commands} - {[testenv:scenario]commands} +[testenv:debug] +commands = oslo_debug_helper {posargs} -[testenv:py36] -commands = - {[testenv]commands} - {[testenv:scenario]commands} +[flake8] +# E123, E125 skipped as they are invalid PEP-8. -[testenv:pycodestyle] -deps = - -U - --no-cache-dir - pycodestyle -commands = - pycodestyle - -[testenv:autopep8] -# If some errors displayed with this test, please reformat codes with the -# following command first. -# $ autopep8 --recursive --in-place ryu/ -whitelist_externals=bash -deps = - -U - --no-cache-dir - autopep8 -commands = - bash -c 'test -z "$(autopep8 --recursive --diff ryu/)"' - -[pycodestyle] -exclude = pbr-*,.venv,.tox,.git,doc,dist,tools,vcsversion.py,.pyc,ryu/contrib -# W503: line break before binary operator -# W504: line break after binary operator -# E116: unexpected indentation (comment) -# E402: module level import not at top of file -# E501: line too long (>79 characters) -# E722: do not use bare except, specify exception instead -# E731: do not assign a lambda expression, use a def -# E741: do not use variables named 'l', 'O', or 'I' -ignore = W503,W504,E116,E402,E501,E722,E731,E741 - -[pep8] -exclude = pbr-*,.venv,.tox,.git,doc,dist,tools,vcsversion.py,.pyc,ryu/contrib -ignore = W503,E116,E402,E501,E722,E731,E741 +show-source = True +ignore = E123,E125 +builtins = _ +exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build