use pbr replace setuptools

This commit is contained in:
weiyu 2016-01-12 11:12:15 +08:00
parent a1d2c07c47
commit d42bd26126
4 changed files with 68 additions and 54 deletions

View File

@ -1,4 +0,0 @@
include etc/*
include doc/*
include LICENSE
include README.md

View File

@ -1,3 +1,4 @@
pbr
jsonrpclib
netaddr
mock

43
setup.cfg Normal file
View File

@ -0,0 +1,43 @@
[metadata]
name = stetho
summary = Stetho is a sophisticated debug bridge for OpenStack Neutron.
description-file =
README.md
author = "UnitedStackSDN"
author-email = unitedstack-sdn@googlegroups.com
home-page = https://www.ustack.com/
classifier =
Environment :: OpenStack
Intended Audience :: Information Technology
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.7
Programming Language :: Python :: 2.6
[global]
setup-hooks =
pbr.hooks.setup_hook
[files]
packages =
stetho
[entry_points]
console_scripts =
stetho = stetho.stethoclient.shell:main
stetho-agent = stetho.agent.agent:main
[egg_info]
tag_build =
tag_date = 0
tag_svn_revision = 0
[wheel]
universal = 1
[pbr]
autodoc_index_modules = 1
warnerrors = true

View File

@ -1,56 +1,30 @@
# Copyright 2015 UnitedStack, Inc.
# All Rights Reserved.
#!/usr/bin/env python
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# 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
# 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
# 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.
# 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 sys
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
import setuptools
from setuptools import setup, find_packages
# In python < 2.7.4, a lazy loading of package `pbr` will break
# setuptools if some other modules registered functions in `atexit`.
# solution from: http://bugs.python.org/issue15881#msg170215
try:
import multiprocessing # noqa
except ImportError:
pass
# In CentOS6.5, the version of python is 2.6, and in CentOS7 the version of
# python is 2.7. So we can according by the python version to put the
# stetho-agent script to the right place.
#
# If in CentOS6.5, the init script should be placed in "/etc/init.d/"
# If in CentOS7, the init script should be placed in "/etc/systemd/system/"
CENTOS6 = '/etc/init.d/'
CENTOS7 = '/etc/systemd/system/'
CENTOS6_SCRIPT = 'etc/init.d/stetho-agent'
CENTOS7_SCRIPT = 'etc/init.d/stetho-agent.service'
PYTHON_VERSION = '2.6' if '2.6' in sys.version else '2.7'
AGENT_INIT_SCRIPT = CENTOS6 if PYTHON_VERSION == '2.6' else CENTOS7
SCRIPT_LOCATION = CENTOS6_SCRIPT if PYTHON_VERSION == '2.6' else CENTOS7_SCRIPT
setup(name='stetho',
version="0.1.0",
packages = find_packages(),
zip_safe = False,
description = "stetho",
author = "UnitedStackSDN",
author_email = "unitedstack-sdn@googlegroups.com",
license = "APL",
keywords = ("stetho", "egg"),
platforms = "Independant",
url = "https://www.ustack.com",
data_files=[
('/etc/stetho', ['etc/stetho.conf']),
(AGENT_INIT_SCRIPT, [SCRIPT_LOCATION]),
],
entry_points={
'console_scripts': [
'stetho = stetho.stethoclient.shell:main',
'stetho-agent = stetho.agent.agent:main',
]
}
)
setuptools.setup(
setup_requires=['pbr'],
pbr=True)