Remove usage of pbr

Anvil has conflicts with pbr when it's used in setup.py
and its usage in anvil doesn't really seem useful or applicable
given the amount of pain it causes during packaging and later pip
usage (dependencies downloaded and introspected will themselves
fail due to the wrong version of pbr that anvil pulled in).

So instead of using it, just switch back to using a simpler
setup.py file with usage of nosetests for testing (since we
don't need parallel tests for anvils tests) to avoid the
problems that pbr has caused.

Change-Id: I6d3c09a927434abf07fc025638a0860e44b029fa
This commit is contained in:
Joshua Harlow 2014-03-22 19:26:18 -07:00
parent a9333843e0
commit 6760f922e0
9 changed files with 74 additions and 104 deletions

View File

@ -1,8 +0,0 @@
[DEFAULT]
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-160} \
${PYTHON:-python} -m subunit.run discover -t ./ ./anvil/tests $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -1,6 +1,9 @@
include AUTHORS include README.rst
include ChangeLog include HACKING.md
include requirements.txt
include test-requirements.txt
include LICENSE
exclude .gitignore exclude .gitignore
exclude .gitreview exclude .gitreview
global-exclude *.pyc global-exclude *.pyc

View File

@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
ANVIL_VERSION = ['2013', '1', None] ANVIL_VERSION = ['2014', '1', None]
YEAR, COUNT, REVISION = ANVIL_VERSION YEAR, COUNT, REVISION = ANVIL_VERSION
FINAL = False # May never be final ;) FINAL = False # May never be final ;)

View File

@ -12,8 +12,7 @@ profile=no
# Add <file or directory> to the black list. It should be a base name, not a # Add <file or directory> to the black list. It should be a base name, not a
# path. You may set this option multiple times. # path. You may set this option multiple times.
ignore=anvil/tests/
# ignore=
# Pickle collected data for later comparisons. # Pickle collected data for later comparisons.
persistent=yes persistent=yes
@ -270,4 +269,4 @@ max-attributes=12
min-public-methods=0 min-public-methods=0
# Maximum number of public methods for a class (see R0904). # Maximum number of public methods for a class (see R0904).
max-public-methods=80 max-public-methods=100

View File

@ -1,7 +1,3 @@
# Anvil should not depend on anything that will cause issues when running
# egg_info on the downloaded dependencies, pbr seems to be the one case that
# currently causes an issue (since it is not directly used for anvil runtime
# it is placed in test-requirements for the time being).
cheetah>=2.4.4 cheetah>=2.4.4
iniparse iniparse
iso8601>=0.1.8 iso8601>=0.1.8

View File

@ -1,47 +0,0 @@
[metadata]
name = anvil
version = 2013.2
summary = A tool to forge raw OpenStack into a productive tool
description-file =
README.rst
author = OpenStack Foundation
author-email = openstack-dev@lists.openstack.org
home-page = http://anvil.readthedocs.org/
classifier =
Development Status :: 4 - Beta
Environment :: Console
Environment :: OpenStack
Intended Audience :: Information Technology
Intended Audience :: Developers
Intended Audience :: System Administrators
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.6
Programming Language :: Python :: 2.7
[global]
setup-hooks =
pbr.hooks.setup_hook
[files]
packages =
anvil
scripts =
tools/multipip
tools/py2rpm
tools/specprint
tools/yyoom
[nosetests]
verbosity=2
[build_sphinx]
source-dir = docs/source
build-dir = docs/build
all_files = 1
[upload_sphinx]
upload-dir = docs/build/html

66
setup.py Normal file → Executable file
View File

@ -1,21 +1,65 @@
#!/usr/bin/env python #!/usr/bin/env python
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
# Copyright (C) 2014 Yahoo! Inc. All Rights Reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License"); you may
# you may not use this file except in compliance with the License. # not use this file except in compliance with the License. You may obtain
# You may obtain a copy of the License at # a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# implied. # License for the specific language governing permissions and limitations
# See the License for the specific language governing permissions and # under the License.
# limitations under the License.
import setuptools import setuptools
from anvil import version
def read_requires(filename):
requires = []
with open(filename, "rb") as fh:
for line in fh:
line = line.strip()
if not line or line.startswith("#"):
continue
requires.append(line)
return requires
setuptools.setup( setuptools.setup(
setup_requires=['pbr'], name='anvil',
pbr=True) description='A tool to forge raw OpenStack into a productive tool',
author='OpenStack Foundation',
author_email='anvil-dev@lists.launchpad.net',
url='http://anvil.readthedocs.org/',
long_description=open("README.rst", 'rb').read(),
packages=setuptools.find_packages(),
license='Apache Software License',
version=version.version_string(),
scripts=[
"tools/yyoom",
"tools/py2rpm",
"tools/multipip",
"tools/specprint",
],
install_requires=read_requires("requirements.txt"),
tests_require=read_requires("test-requirements.txt"),
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
'Environment :: OpenStack',
'Intended Audience :: Information Technology',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
],
)

View File

@ -1,16 +1,5 @@
# Install bounded pep8/pyflakes first, then let flake8 install
pep8==1.4.5
pyflakes>=0.7.2,<0.7.4
flake8==2.0
pylint==0.25.2 pylint==0.25.2
hacking>=0.8.0,<0.9 hacking>=0.8.0,<0.9
mock>=1.0 mock>=1.0
# This is only needed for running anvils setup.py which is not done nose
# during running of anvil, but is done during testing or package testtools>=0.9.34
# creation...
#
# Using it in the created virtualenv causes conflict with
# other openstack packages (running there setup.py egg_info will break)
# so placing it here means that we will avoid such conflicts in the first
# place.
pbr>=0.5.21,<1.0

18
tox.ini
View File

@ -1,7 +1,6 @@
[tox] [tox]
minversion = 1.6
skipdist = True skipdist = True
envlist = py26,py27,pep8 envlist = py26,py27,pep8,pylint
[testenv] [testenv]
usedevelop = True usedevelop = True
@ -9,11 +8,7 @@ install_command = pip install {opts} {packages}
setenv = VIRTUAL_ENV={envdir} setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
discover commands = nosetests {posargs}
python-subunit>=0.0.18
testtools>=0.9.34
testrepository>=0.0.17
commands = python setup.py testr --slowest --testr-args='{posargs}'
[tox:jenkins] [tox:jenkins]
downloadcache = ~/cache/pip downloadcache = ~/cache/pip
@ -28,11 +23,6 @@ deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt -r{toxinidir}/test-requirements.txt
commands = pylint --rcfile=pylintrc anvil commands = pylint --rcfile=pylintrc anvil
[testenv:cover]
deps = {[testenv]deps}
coverage>=3.6
commands = python setup.py testr --coverage --testr-args='{posargs}'
[testenv:venv] [testenv:venv]
commands = {posargs} commands = {posargs}
@ -40,3 +30,7 @@ commands = {posargs}
ignore = H102,H302,E501 ignore = H102,H302,E501
builtins = _ builtins = _
exclude = .venv,.tox,dist,doc,*egg,.git,build exclude = .venv,.tox,dist,doc,*egg,.git,build
[nosetests]
verbosity = 2
detailed-errors = 1