Browse Source

Add cookiecutter-generated files for project

Use cookiecutter (https://git.openstack.org/openstack-dev/cookiecutter)
to generate config for tox so we can generate docs, run pep8, etc.
Also move CONTRIBUTING.rst to the root of the repository in keeping
with what seems to be the standard location. This move allows us to
easily generate the docs. Also include a tiny fix to allow pep8 to
run cleanly.

Change-Id: Ifbfc6d85c7b02bf4ab989974b491a3a1ae6f0900
tags/0.0.1
Jenkins 4 years ago
parent
commit
2a9d49d9bc
17 changed files with 301 additions and 3 deletions
  1. 53
    2
      .gitignore
  2. 3
    0
      .mailmap
  3. 0
    0
      CONTRIBUTING.rst
  4. 4
    0
      HACKING.rst
  5. 6
    0
      MANIFEST.in
  6. 2
    0
      babel.cfg
  7. 75
    0
      doc/source/conf.py
  8. 4
    0
      doc/source/contributing.rst
  9. 18
    0
      doc/source/index.rst
  10. 1
    0
      doc/source/readme.rst
  11. 6
    0
      openstack-common.conf
  12. 1
    1
      playbooks/library/os_ironic_node.py
  13. 3
    0
      requirements.txt
  14. 44
    0
      setup.cfg
  15. 30
    0
      setup.py
  16. 15
    0
      test-requirements.txt
  17. 36
    0
      tox.ini

+ 53
- 2
.gitignore View File

@@ -1,3 +1,54 @@
1
-*~
2
-.*.sw?
1
+*.py[cod]
2
+
3
+# C extensions
4
+*.so
5
+
6
+# Packages
7
+*.egg
8
+*.egg-info
9
+dist
10
+build
11
+eggs
12
+parts
13
+bin
14
+var
15
+sdist
16
+develop-eggs
17
+.installed.cfg
18
+lib
19
+lib64
20
+
21
+# Installer logs
22
+pip-log.txt
23
+
24
+# Unit test / coverage reports
25
+.coverage
26
+.tox
27
+nosetests.xml
28
+.testrepository
29
+.venv
30
+
31
+# Translations
32
+*.mo
33
+
34
+# Mr Developer
35
+.mr.developer.cfg
36
+.project
37
+.pydevproject
38
+
39
+# Complexity
40
+output/*.html
41
+output/*/index.html
42
+
43
+# Sphinx
44
+_build
3 45
 doc/build
46
+
47
+# pbr generates these
48
+AUTHORS
49
+ChangeLog
50
+
51
+# Editors
52
+*~
53
+.*.swp
54
+.*sw?

+ 3
- 0
.mailmap View File

@@ -0,0 +1,3 @@
1
+# Format is:
2
+# <preferred e-mail> <other e-mail 1>
3
+# <preferred e-mail> <other e-mail 2>

doc/source/dev/CONTRIBUTING.rst → CONTRIBUTING.rst View File


+ 4
- 0
HACKING.rst View File

@@ -0,0 +1,4 @@
1
+bifrost Style Commandments
2
+===============================================
3
+
4
+Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/

+ 6
- 0
MANIFEST.in View File

@@ -0,0 +1,6 @@
1
+include AUTHORS
2
+include ChangeLog
3
+exclude .gitignore
4
+exclude .gitreview
5
+
6
+global-exclude *.pyc

+ 2
- 0
babel.cfg View File

@@ -0,0 +1,2 @@
1
+[python: **.py]
2
+

+ 75
- 0
doc/source/conf.py View File

@@ -0,0 +1,75 @@
1
+# -*- coding: utf-8 -*-
2
+# Licensed under the Apache License, Version 2.0 (the "License");
3
+# you may not use this file except in compliance with the License.
4
+# You may obtain a copy of the License at
5
+#
6
+#    http://www.apache.org/licenses/LICENSE-2.0
7
+#
8
+# Unless required by applicable law or agreed to in writing, software
9
+# distributed under the License is distributed on an "AS IS" BASIS,
10
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
11
+# implied.
12
+# See the License for the specific language governing permissions and
13
+# limitations under the License.
14
+
15
+import os
16
+import sys
17
+
18
+sys.path.insert(0, os.path.abspath('../..'))
19
+# -- General configuration ----------------------------------------------------
20
+
21
+# Add any Sphinx extension module names here, as strings. They can be
22
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
23
+extensions = [
24
+    'sphinx.ext.autodoc',
25
+    #'sphinx.ext.intersphinx',
26
+    'oslosphinx'
27
+]
28
+
29
+# autodoc generation is a bit aggressive and a nuisance when doing heavy
30
+# text edit cycles.
31
+# execute "export SPHINX_DEBUG=1" in your terminal to disable
32
+
33
+# The suffix of source filenames.
34
+source_suffix = '.rst'
35
+
36
+# The master toctree document.
37
+master_doc = 'index'
38
+
39
+# General information about the project.
40
+project = u'bifrost'
41
+copyright = u'2015, OpenStack Foundation'
42
+
43
+# If true, '()' will be appended to :func: etc. cross-reference text.
44
+add_function_parentheses = True
45
+
46
+# If true, the current module name will be prepended to all description
47
+# unit titles (such as .. function::).
48
+add_module_names = True
49
+
50
+# The name of the Pygments (syntax highlighting) style to use.
51
+pygments_style = 'sphinx'
52
+
53
+# -- Options for HTML output --------------------------------------------------
54
+
55
+# The theme to use for HTML and HTML Help pages.  Major themes that come with
56
+# Sphinx are currently 'default' and 'sphinxdoc'.
57
+# html_theme_path = ["."]
58
+# html_theme = '_theme'
59
+# html_static_path = ['static']
60
+
61
+# Output file base name for HTML help builder.
62
+htmlhelp_basename = '%sdoc' % project
63
+
64
+# Grouping the document tree into LaTeX files. List of tuples
65
+# (source start file, target name, title, author, documentclass
66
+# [howto/manual]).
67
+latex_documents = [
68
+    ('index',
69
+     '%s.tex' % project,
70
+     u'%s Documentation' % project,
71
+     u'OpenStack Foundation', 'manual'),
72
+]
73
+
74
+# Example configuration for intersphinx: refer to the Python standard library.
75
+#intersphinx_mapping = {'http://docs.python.org/': None}

+ 4
- 0
doc/source/contributing.rst View File

@@ -0,0 +1,4 @@
1
+============
2
+Contributing
3
+============
4
+.. include:: ../../CONTRIBUTING.rst

+ 18
- 0
doc/source/index.rst View File

@@ -0,0 +1,18 @@
1
+Welcome to bifrost's documentation!
2
+========================================================
3
+
4
+Contents:
5
+
6
+.. toctree::
7
+   :maxdepth: 2
8
+
9
+   readme
10
+   contributing
11
+
12
+Indices and tables
13
+==================
14
+
15
+* :ref:`genindex`
16
+* :ref:`modindex`
17
+* :ref:`search`
18
+

+ 1
- 0
doc/source/readme.rst View File

@@ -0,0 +1 @@
1
+.. include:: ../../README.rst

+ 6
- 0
openstack-common.conf View File

@@ -0,0 +1,6 @@
1
+[DEFAULT]
2
+
3
+# The list of modules to copy from oslo-incubator.git
4
+
5
+# The base module to hold the copy of openstack.common
6
+base=bifrost

+ 1
- 1
playbooks/library/os_ironic_node.py View File

@@ -183,7 +183,7 @@ def _check_set_maintenance(module, cloud, node):
183 183
 def _check_set_power_state(module, cloud, node):
184 184
     if 'power on' in str(node['power_state']):
185 185
         if _is_false(module.params['power']):
186
-        # User has requested the node be powered off.
186
+            # User has requested the node be powered off.
187 187
             cloud.set_machine_power_off(node['uuid'])
188 188
             module.exit_json(changed=True, msg="Power requested off")
189 189
     if 'power off' in str(node['power_state']):

+ 3
- 0
requirements.txt View File

@@ -1,3 +1,6 @@
1 1
 PyYAML
2 2
 jinja2
3 3
 pip>=7.0
4
+
5
+pbr>=0.6,!=0.7,<1.0
6
+Babel>=1.3

+ 44
- 0
setup.cfg View File

@@ -0,0 +1,44 @@
1
+[metadata]
2
+name = bifrost
3
+summary = Deployment of physical machines using OpenStack Ironic and Ansible
4
+description-file =
5
+    README.rst
6
+author = OpenStack
7
+author-email = openstack-dev@lists.openstack.org
8
+home-page = http://www.openstack.org/
9
+classifier =
10
+    Environment :: OpenStack
11
+    Intended Audience :: Information Technology
12
+    Intended Audience :: System Administrators
13
+    License :: OSI Approved :: Apache Software License
14
+    Operating System :: POSIX :: Linux
15
+    Programming Language :: Python
16
+    Programming Language :: Python :: 2
17
+    Programming Language :: Python :: 2.7
18
+    Programming Language :: Python :: 2.6
19
+
20
+[files]
21
+packages =
22
+    bifrost
23
+
24
+[build_sphinx]
25
+source-dir = doc/source
26
+build-dir = doc/build
27
+all_files = 1
28
+
29
+[upload_sphinx]
30
+upload-dir = doc/build/html
31
+
32
+[compile_catalog]
33
+directory = bifrost/locale
34
+domain = bifrost
35
+
36
+[update_catalog]
37
+domain = bifrost
38
+output_dir = bifrost/locale
39
+input_file = bifrost/locale/bifrost.pot
40
+
41
+[extract_messages]
42
+keywords = _ gettext ngettext l_ lazy_gettext
43
+mapping_file = babel.cfg
44
+output_file = bifrost/locale/bifrost.pot

+ 30
- 0
setup.py View File

@@ -0,0 +1,30 @@
1
+#!/usr/bin/env python
2
+# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
3
+#
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7
+#
8
+#    http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13
+# implied.
14
+# See the License for the specific language governing permissions and
15
+# limitations under the License.
16
+
17
+# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
18
+import setuptools
19
+
20
+# In python < 2.7.4, a lazy loading of package `pbr` will break
21
+# setuptools if some other modules registered functions in `atexit`.
22
+# solution from: http://bugs.python.org/issue15881#msg170215
23
+try:
24
+    import multiprocessing  # noqa
25
+except ImportError:
26
+    pass
27
+
28
+setuptools.setup(
29
+    setup_requires=['pbr'],
30
+    pbr=True)

+ 15
- 0
test-requirements.txt View File

@@ -0,0 +1,15 @@
1
+# The order of packages is significant, because pip processes them in the order
2
+# of appearance. Changing the order has an impact on the overall integration
3
+# process, which may cause wedges in the gate later.
4
+
5
+hacking<0.11,>=0.10.0
6
+
7
+coverage>=3.6
8
+discover
9
+python-subunit>=0.0.18
10
+sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3
11
+oslosphinx>=2.2.0  # Apache-2.0
12
+oslotest>=1.2.0  # Apache-2.0
13
+testrepository>=0.0.18
14
+testscenarios>=0.4
15
+testtools>=0.9.36,!=1.2.0

+ 36
- 0
tox.ini View File

@@ -0,0 +1,36 @@
1
+[tox]
2
+minversion = 1.6
3
+envlist = docs,pep8
4
+skipsdist = True
5
+
6
+[testenv]
7
+usedevelop = True
8
+install_command = pip install -U {opts} {packages}
9
+setenv =
10
+   VIRTUAL_ENV={envdir}
11
+deps = -r{toxinidir}/requirements.txt
12
+       -r{toxinidir}/test-requirements.txt
13
+commands = python setup.py test --slowest --testr-args='{posargs}'
14
+
15
+[testenv:pep8]
16
+commands = flake8
17
+
18
+[testenv:venv]
19
+commands = {posargs}
20
+
21
+[testenv:cover]
22
+commands = python setup.py test --coverage --testr-args='{posargs}'
23
+
24
+[testenv:docs]
25
+commands = python setup.py build_sphinx
26
+
27
+[testenv:debug]
28
+commands = oslo_debug_helper {posargs}
29
+
30
+[flake8]
31
+# E123, E125 skipped as they are invalid PEP-8.
32
+
33
+show-source = True
34
+ignore = E123,E125,F403,H102,H303
35
+builtins = _
36
+exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build

Loading…
Cancel
Save