From 472f3c60c46cd2d0b47c059602a1a75b308758e4 Mon Sep 17 00:00:00 2001 From: Simon Merrick Date: Thu, 16 May 2019 16:52:27 +1200 Subject: [PATCH] Convert setup to use pbr Remove redundant Manifest file Move configuration to setup.cfg Upadate atuhor and contact informaion Change python 3.5 classifier to python 3.6 Grab package version programtically from pbr gitignore venv and vscode directories. Change-Id: Iff11f5ca9ddc40e98849c384441db73e5b034ac7 --- .gitignore | 2 ++ MANIFEST.in | 9 ------- adjutant/version.py | 18 +++++++++++++ setup.cfg | 41 ++++++++++++++++++++++++++++++ setup.py | 62 ++++++++++++--------------------------------- 5 files changed, 77 insertions(+), 55 deletions(-) delete mode 100644 MANIFEST.in create mode 100644 adjutant/version.py create mode 100644 setup.cfg diff --git a/.gitignore b/.gitignore index f8e7ff7..0301f05 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ build/ .tox/* env/* cover/* +.vscode/ +venv/ \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 96c26a5..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,9 +0,0 @@ -include requirements.txt -include test-requirements.txt -include README.md -include package_readme.rst -graft conf -graft adjutant/api/v*/templates -graft adjutant/notifications/templates -graft adjutant/notifications/*/templates - diff --git a/adjutant/version.py b/adjutant/version.py new file mode 100644 index 0000000..70ab071 --- /dev/null +++ b/adjutant/version.py @@ -0,0 +1,18 @@ +# Copyright (C) 2019 Catalyst IT Ltd +# +# 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 pbr.version + +version_info = pbr.version.VersionInfo("python-adjutant") +version_string = version_info.version_string() diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..dc1a710 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,41 @@ +[metadata] +name = python-adjutant +author = OpenStack +author-email = openstack-discuss@lists.openstack.org +summary = An admin task workflow service for openstack. +description-file = package_readme.rst +description-content-type = text/x-rst; charset=UTF-8 +home-page = https://opendev.org/openstack/adjutant +project_urls = + Bug Tracker = https://storyboard.openstack.org/#!/project/openstack/adjutant + Documentation = https://adjutant.readthedocs.io/en/latest/ + Source Code = https://opendev.org/openstack/adjutant +license = Apache-2 +classifier = + Development Status :: 5 - Production/Stable + Intended Audience :: Developers + Intended Audience :: System Administrators + License :: OSI Approved :: Apache Software License + Framework :: Django :: 1.11 + Programming Language :: Python :: 2.7 + Programming Language :: Python :: 3.6 + Environment :: OpenStack + +keywords = + openstack + keystone + users + tasks + registration + workflow + +[build_sphinx] +builders = html, man +source-dir = doc/source +build-dir = doc/build +all-files = 1 +warning-is-error = 1 + +[entry_points] +console_scripts = + adjutant-api = adjutant:management_command diff --git a/setup.py b/setup.py index b0af6e9..14c18b8 100644 --- a/setup.py +++ b/setup.py @@ -1,50 +1,20 @@ -from setuptools import setup, find_packages +# Copyright (C) 2019 Catalyst IT Ltd +# +# 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. -with open('requirements.txt') as f: - required = f.readlines() - -with open('package_readme.rst') as file: - long_description = file.read() +from setuptools import setup setup( - name='python-adjutant', - - version='0.2.2', - description='An admin task workflow service for openstack.', - long_description=long_description, - url='https://github.com/catalyst/adjutant', - author='Adrian Turjak', - author_email='adriant@catalyst.net.nz', - license='Apache 2.0', - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Developers', - 'Intended Audience :: System Administrators', - 'License :: OSI Approved :: Apache Software License', - 'Framework :: Django :: 1.11', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.5', - 'Environment :: OpenStack', - ], - - command_options={ - 'build_sphinx': { - 'build_dir': ('setup.py', 'doc/build'), - 'source_dir': ('setup.py', 'doc/source'), - } - }, - - keywords='openstack keystone users tasks registration workflow', - packages=find_packages(), - package_data={ - 'adjutant': [ - 'api/v*/templates/*.txt', - 'notifications/templates/*.txt', - 'notifications/*/templates/*.txt']}, - install_requires=required, - entry_points={ - 'console_scripts': [ - 'adjutant-api = adjutant:management_command', - ], - } + setup_requires=['pbr'], + pbr=True, )