From 8a967b16dc2ffd60bc19bee09f45e665ddcc9a81 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 2 Jul 2012 17:19:06 -0400 Subject: Fix up openstack-common build. Ironically enough, even though the code to manage this is in openstack-common, openstack-common wasn't using it. This patch fixes doc generation, as well as setuptools-git integration and versioning. Change-Id: Ifb74ad539832d8cec4a536a96221eea8fb7527d2 --- MANIFEST.in | 10 +++++---- doc/source/conf.py | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ doc/source/index.rst | 17 +++++++++++++++ setup.cfg | 13 +++++++----- setup.py | 37 ++++++++++++++++++++++---------- tools/test-requires | 2 ++ 6 files changed, 119 insertions(+), 20 deletions(-) create mode 100644 doc/source/conf.py create mode 100644 doc/source/index.rst diff --git a/MANIFEST.in b/MANIFEST.in index c601e54..c978a52 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,6 @@ -include HACKING.rst -include requirements.txt -include tox.ini -include tools/* +include AUTHORS +include ChangeLog +exclude .gitignore +exclude .gitreview + +global-exclude *.pyc diff --git a/doc/source/conf.py b/doc/source/conf.py new file mode 100644 index 0000000..5849d98 --- /dev/null +++ b/doc/source/conf.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +# + +import sys, os + +project = 'openstack-common' + +# -- 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 = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx'] + +# 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 + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +copyright = u'OpenStack LLC' + +# 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 = 'sphinx' + +# -- 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 = 'nature' + +# 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 LLC', 'manual'), +] + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {'http://docs.python.org/': None} diff --git a/doc/source/index.rst b/doc/source/index.rst new file mode 100644 index 0000000..5e25c9b --- /dev/null +++ b/doc/source/index.rst @@ -0,0 +1,17 @@ +OpenStack Common Code +===================== + +Code shared for common tasks across OpenStack. Contents: + +.. toctree:: + :maxdepth: 1 + + api/autoindex + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + diff --git a/setup.cfg b/setup.cfg index 5a4689c..6471a4e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,8 +5,11 @@ # openstack-nose https://github.com/jkoelker/openstack-nose verbosity=2 detailed-errors=1 -with-openstack=1 -openstack-red=0.05 -openstack-yellow=0.025 -openstack-show-elapsed=1 -openstack-color=1 + +[build_sphinx] +source-dir = doc/source +build-dir = doc/build +all_files = 1 + +[upload_sphinx] +upload-dir = doc/build/html diff --git a/setup.py b/setup.py index b731e85..76161fb 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,29 @@ -from setuptools import setup, find_packages -from openstack.common.setup import parse_requirements -from openstack.common.setup import parse_dependency_links -from openstack.common.setup import write_requirements +#!/usr/bin/python +# -*- encoding: utf-8 -*- +# Copyright (c) 2012 OpenStack, LLC. +# +# 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 setuptools -version = '0.1' +from openstack.common import setup -requires = parse_requirements() -depend_links = parse_dependency_links() -write_requirements() +requires = setup.parse_requirements() +depend_links = setup.parse_dependency_links() -setup(name='openstack.common', - version=version, +setuptools.setup(name='openstack.common', + version=setup.get_post_version('openstack'), description="Common components for Openstack", long_description="Common components for Openstack " "including paster templates.", @@ -26,11 +38,14 @@ setup(name='openstack.common', author_email='openstack@lists.launchpad.net', url='http://www.openstack.org/', license='Apache Software License', - packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), + packages=setuptools.find_packages(exclude=['ez_setup', + 'examples', 'tests']), include_package_data=True, + cmdclass=setup.get_cmdclass(), zip_safe=True, install_requires=requires, dependency_links=depend_links, + setup_requires=['setuptools-git>=0.4'], entry_points=""" # -*- Entry points: -*- """, diff --git a/tools/test-requires b/tools/test-requires index 499397e..3be79ee 100644 --- a/tools/test-requires +++ b/tools/test-requires @@ -10,4 +10,6 @@ nosexcover openstack.nose_plugin pep8==0.6.1 pylint +setuptools-git>=0.4 +sphinx webtest -- cgit