diff --git a/.gitignore b/.gitignore index a8eee82b..7023e877 100644 --- a/.gitignore +++ b/.gitignore @@ -6,8 +6,11 @@ build/* build-stamp melange.egg-info .melange-venv +.tox .venv *.sqlite *.log tags *~ +ChangeLog +melange/vcsversion.py diff --git a/MANIFEST.in b/MANIFEST.in index b2563ef8..2a5defb1 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,6 +4,8 @@ include ChangeLog MANIFEST.in pylintrc Authors include melange/db/sqlalchemy/migrate_repo/migrate.cfg include melange/db/sqlalchemy/migrate_repo/README include melange/db/sqlalchemy/migrate_repo/versions/*.sql +include requirements.txt +include tools/* graft doc graft tools graft etc diff --git a/builddeb.sh b/builddeb.sh deleted file mode 100755 index e354dc24..00000000 --- a/builddeb.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -# Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. -# 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. - -dpkg-buildpackage -b -rfakeroot -tc -uc -D - diff --git a/setup.cfg b/setup.cfg index e79c5595..b59e7bce 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,3 +22,15 @@ keywords = _ l_ lazy_gettext mapping_file = babel.cfg output_file = locale/melange.pot +[nosetests] +# NOTE(jkoelker) To run the test suite under nose install the following +# coverage http://pypi.python.org/pypi/coverage +# tissue http://pypi.python.org/pypi/tissue (pep8 checker) +# 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 diff --git a/setup.py b/setup.py index bd8e36e7..8feaadbe 100644 --- a/setup.py +++ b/setup.py @@ -27,6 +27,10 @@ from setuptools import setup gettext.install('melange', unicode=1) from melange.openstack.common.setup import parse_mailmap, str_dict_replace +from melange.openstack.common.setup import parse_requirements +from melange.openstack.common.setup import parse_dependency_links +from melange.openstack.common.setup import write_requirements + from melange import version @@ -93,6 +97,12 @@ try: except: pass +requires = parse_requirements(['requirements.txt', 'tools/pip-requires']) + +depend_links = parse_dependency_links(['requirements.txt', + 'tools/pip-requires']) + +write_requirements() setup(name='melange', version=version.canonical_version_string(), @@ -103,6 +113,8 @@ setup(name='melange', cmdclass=cmdclass, packages=find_packages(exclude=['bin']), include_package_data=True, + install_requires=requires, + dependency_links=depend_links, test_suite='nose.collector', classifiers=[ 'Development Status :: 4 - Beta', diff --git a/tools/install_venv.py b/tools/install_venv.py index 62fc6dc0..6e3406be 100644 --- a/tools/install_venv.py +++ b/tools/install_venv.py @@ -31,6 +31,7 @@ import sys ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) VENV = os.path.join(ROOT, '.venv') PIP_REQUIRES = os.path.join(ROOT, 'tools', 'pip-requires') +TEST_REQUIRES = os.path.join(ROOT, 'tools', 'test-requires') PY_VERSION = "python%s.%s" % (sys.version_info[0], sys.version_info[1]) @@ -103,8 +104,9 @@ def install_dependencies(venv=VENV): # get it in stalled in the right order run_command(['tools/with_venv.sh', 'pip', 'install', '-E', venv, 'greenlet'], redirect_output=False) - run_command(['tools/with_venv.sh', 'pip', 'install', '-E', venv, '-r', - PIP_REQUIRES], redirect_output=False) + for requires in (PIP_REQUIRES, TEST_REQUIRES): + run_command(['tools/with_venv.sh', 'pip', 'install', '-E', venv, '-r', + requires], redirect_output=False) # Tell the virtual env how to "import melange" pthfile = os.path.join(venv, "lib", PY_VERSION, "site-packages", diff --git a/tools/pip-requires b/tools/pip-requires index 4ca4d1b1..4ddf99ed 100644 --- a/tools/pip-requires +++ b/tools/pip-requires @@ -1,19 +1,14 @@ SQLAlchemy -pep8 -pylint eventlet kombu==1.0.4 routes WebOb mox -nose PasteDeploy paste sqlalchemy-migrate netaddr sphinx -coverage -nosexcover webtest factory_boy httplib2 diff --git a/tools/test-requires b/tools/test-requires new file mode 100644 index 00000000..71009cae --- /dev/null +++ b/tools/test-requires @@ -0,0 +1,9 @@ +# Packages needed for dev testing +distribute>=0.6.24 + +coverage +nose +nosexcover +openstack.nose_plugin +pep8 +pylint diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..38a9a16b --- /dev/null +++ b/tox.ini @@ -0,0 +1,37 @@ +[tox] +envlist = py26,py27,pep8 + +[testenv] +setenv = VIRTUAL_ENV={envdir} +deps = -r{toxinidir}/tools/pip-requires +commands = nosetests + +[testenv:pep8] +deps = pep8 +commands = pep8 --repeat --show-source bin melange setup.py + +[testenv:pylint] +deps = pylint +commands = pylint --rcfile=pylintrc --output-format=parseable melange + +[testenv:cover] +commands = nosetests --with-coverage --cover-html --cover-erase --cover-package=melange + +[testenv:sdist] +commands = python setup.py sdist {posargs} + +[testenv:hudson] +downloadcache = ~/cache/pip + +[testenv:jenkins26] +basepython = python2.6 +deps = file://{toxinidir}/.cache.bundle + +[testenv:jenkins27] +basepython = python2.7 +deps = file://{toxinidir}/.cache.bundle + +[testenv:jenkinscover] +deps = file://{toxinidir}/.cache.bundle +commands = nosetests --cover-erase --cover-package=melange --with-xcoverage +