diff options
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | django-openstack/django_openstack/version.py | 43 | ||||
-rwxr-xr-x | django-openstack/setup.py | 5 | ||||
-rw-r--r-- | doc/source/conf.py | 5 | ||||
-rw-r--r-- | doc/source/index.rst | 22 | ||||
-rw-r--r-- | doc/source/testing.rst | 32 | ||||
-rwxr-xr-x | run_tests.sh | 26 | ||||
-rwxr-xr-x | setup.py | 64 |
8 files changed, 123 insertions, 78 deletions
@@ -63,7 +63,7 @@ The source is maintained in the `doc/source` folder using * Building Automatically:: - $ python setup.py build_sphinx + $ ./run_tests.sh --docs * Building Manually:: @@ -71,4 +71,4 @@ The source is maintained in the `doc/source` folder using $ python doc/generate_autodoc_index.py $ sphinx-build -b html doc/source build/sphinx/html -Results in `doc/build/html` directory +Results are in the `build/sphinx/html` directory diff --git a/django-openstack/django_openstack/version.py b/django-openstack/django_openstack/version.py new file mode 100644 index 00000000..707782a0 --- /dev/null +++ b/django-openstack/django_openstack/version.py @@ -0,0 +1,43 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2011 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. + +version_info = {'branch_nick': u'LOCALBRANCH', + 'revision_id': 'LOCALREVISION', + 'revno': 0} + + +NOVA_VERSION = ['2012', '1'] +YEAR, COUNT = NOVA_VERSION +FINAL = False # This becomes true at Release Candidate time + + +def canonical_version_string(): + return '.'.join([YEAR, COUNT]) + + +def version_string(): + if FINAL: + return canonical_version_string() + else: + return '%s-dev' % (canonical_version_string(),) + + +def vcs_version_string(): + return '%s:%s' % (version_info['branch_nick'], version_info['revision_id']) + + +def version_string_with_vcs(): + return '%s-%s' % (canonical_version_string(), vcs_version_string()) diff --git a/django-openstack/setup.py b/django-openstack/setup.py index 1571ae42..2e3f46c0 100755 --- a/django-openstack/setup.py +++ b/django-openstack/setup.py @@ -20,14 +20,15 @@ import os from setuptools import setup, find_packages, findall +from django_openstack import version def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name = "django-openstack", - version = "0.4", - url = 'https://launchpad.net/django-openstack/', + version = version.canonical_version_string(), + url = 'https://github.com/openstack/horizon/', license = 'Apache 2.0', description = "A Django interface for OpenStack.", long_description = read('README'), diff --git a/doc/source/conf.py b/doc/source/conf.py index d296042a..164c6560 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -12,6 +12,7 @@ # serve to show the default. import sys, os +from django_openstack import version as horizon_version # 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 @@ -56,9 +57,9 @@ copyright = u'2011, OpenStack, LLC' # built documents. # # The short X.Y version. -version = '1.0' +version = horizon_version.canonical_version_string() # The full version, including alpha/beta/rc tags. -release = '1.0' +release = horizon_version.canonical_version_string() # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/source/index.rst b/doc/source/index.rst index 33e91eb4..cb6e3278 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -14,6 +14,7 @@ License for the specific language governing permissions and limitations under the License. +======================== Horizon for Contributors ======================== @@ -23,11 +24,32 @@ interface to OpenStack services including Nova, Swift, Keystone, and Quantum. This document describes horizon for contributors of the project. +Project Structure +================= + +This project is a bit different from other Openstack projects in that it has +two very distinct components underneath it: + +* django-openstack +* openstack-dashboard + +Django-openstack holds the generic libraries and components that can be +used in any Django project. In testing, this component is set up with +buildout (see run_tests.sh), and any dependencies that get added need to +be added to the django-openstack/buildout.cfg file. + +Openstack-dashboard is a reference django project that uses django-openstack +and is built with a virtualenv and tested through that environment. If +depdendencies are added that the reference django project needs, they +should be added to openstack-dashboard/tools/pip-requires. + Contents: +--------- .. toctree:: :maxdepth: 1 + testing Developer Docs -------------- diff --git a/doc/source/testing.rst b/doc/source/testing.rst new file mode 100644 index 00000000..bab32a82 --- /dev/null +++ b/doc/source/testing.rst @@ -0,0 +1,32 @@ +.. + Copyright 2011 OpenStack, LLC + All Rights Reserved. + + 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. + +===================== +Testing the Dashboard +===================== + +Testing the dashbaord is a bit more complex due to having the two projects +in the same repository. + +The run_tests.sh script invokes tests and analysis on both of these +components in it's process, and is what Jenkins uses to verify the +stability of the project. + +To run the tests:: + + $ ./run_tests.sh + + diff --git a/run_tests.sh b/run_tests.sh index 3f628d2d..94950878 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -13,6 +13,7 @@ function usage { echo " been added." echo " -p, --pep8 Just run pep8" echo " -y, --pylint Just run pylint" + echo " --docs Just build the documentation" echo " -h, --help Print this usage message" echo "" echo "Note: with no options specified, the script will try to run the tests in" @@ -30,6 +31,7 @@ function process_option { -p|--pep8) let just_pep8=1;; -y|--pylint) let just_pylint=1;; -f|--force) let force=1;; + --docs) let just_docs=1;; *) testargs="$testargs $1" esac } @@ -59,6 +61,16 @@ function run_pep8 { ${django_wrapper} pep8 $PEP8_OPTIONS $PEP8_INCLUDE | perl -ple 's/: ([WE]\d+)/: [$1]/' > pep8.txt } +function run_sphinx { + echo "Building sphinx..." + echo "${django_wrapper} export DJANGO_SETTINGS_MODULE=local.local_settings" + ${django_wrapper} export DJANGO_SETTINGS_MODULE=local.local_settings + echo "${django_wrapper} python doc/generate_autodoc_index.py" + ${django_wrapper} python doc/generate_autodoc_index.py + echo "${django_wrapper} sphinx-build -b html doc/source build/sphinx/html" + ${django_wrapper} sphinx-build -b html doc/source build/sphinx/html +} + # DEFAULTS FOR RUN_TESTS.SH # @@ -73,6 +85,7 @@ django_wrapper="" dashboard_wrapper="" just_pep8=0 just_pylint=0 +just_docs=0 # PROCESS ARGUMENTS, OVERRIDE DEFAULTS for arg in "$@"; do @@ -138,16 +151,13 @@ function run_tests { exit $(($OPENSTACK_RESULT || $DASHBOARD_RESULT)) } +if [ $just_docs -eq 1 ]; then + run_sphinx + exit $? +fi + if [ $just_pep8 -eq 1 ]; then run_pep8 - -#capability discovery - -#capability discovery -#store & compare arista -> Mongo - quarantine -#SMBios probes -#store & compare arista -> Mongo - quarantine -#SMBios probes exit $? fi diff --git a/setup.py b/setup.py deleted file mode 100755 index d2eedbe3..00000000 --- a/setup.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/python -# Copyright (c) 2010-2011 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 os -import subprocess - -from setuptools import setup, find_packages - -cmdclass = {} - -# If Sphinx is installed on the box running setup.py, -# enable setup.py to build the documentation, otherwise, -# just ignore it -try: - from sphinx.setup_command import BuildDoc - - if 'DJANGO_SETTINGS_MODULE' not in os.environ: - os.environ['DJANGO_SETTINGS_MODULE'] = 'local.local_settings' - class local_BuildDoc(BuildDoc): - def run(self): - base_dir = os.path.dirname(os.path.abspath(__file__)) - subprocess.Popen(["python", "generate_autodoc_index.py"], - cwd=os.path.join(base_dir, "doc")).communicate() - for builder in ['html']: # ,'man' - self.builder = builder - self.finalize_options() - BuildDoc.run(self) - cmdclass['build_sphinx'] = local_BuildDoc - -except: - pass - -setup( - name='horizon', - version='2011.3', - description="OpenStack Dashboard", - license='Apache License (2.0)', - classifiers=["Programming Language :: Python"], - keywords='dashboard openstack', - author='OpenStack, LLC.', - author_email='openstack@lists.launchpad.net', - url='http://www.openstack.org', - include_package_data=True, - packages=find_packages(exclude=['test', 'bin']), - scripts=[], - zip_safe=False, - cmdclass=cmdclass, - install_requires=['setuptools'], - test_suite='nose.collector', - entry_points={}, - ) |