From d44dfd7526b389aaee9486352d042a2688c4c7eb Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Wed, 17 Apr 2019 10:53:12 -0500 Subject: [PATCH] Implements PBR for packaging Spyglass will soon have its plugins separated from its main repo. Many other OpenStack repositories that utilize plugins have implemented Python Build Reasonableness to manage their entry points for plugins. As Spyglass will be managing plugins, it makes sense to stay uniform with other projects and implement PBR. Implements PBR using setup.py and setup.cfg files. Changes README to correct file extension. Freezes PIP requirements file. Moves YAPF configuration into setup.cfg file. Change-Id: I48ac5aeb3e544d3da7ce25bd9b827d8fd9c4e108 --- .style.yapf | 6 --- README.md => README.rst | 0 requirements.txt | 9 +++-- setup.cfg | 38 +++++++++++++++++++ setup.py | 33 +--------------- .../plugins/formation/__init__.py | 0 .../plugins/{ => formation}/formation.py | 0 7 files changed, 45 insertions(+), 41 deletions(-) delete mode 100644 .style.yapf rename README.md => README.rst (100%) create mode 100644 setup.cfg create mode 100644 spyglass/data_extractor/plugins/formation/__init__.py rename spyglass/data_extractor/plugins/{ => formation}/formation.py (100%) diff --git a/.style.yapf b/.style.yapf deleted file mode 100644 index 7dca927..0000000 --- a/.style.yapf +++ /dev/null @@ -1,6 +0,0 @@ -[style] -based_on_style = pep8 -allow_split_before_dict_value = false -blank_line_before_nested_class_or_def = true -blank_line_before_module_docstring = true -split_before_logical_operator = false diff --git a/README.md b/README.rst similarity index 100% rename from README.md rename to README.rst diff --git a/requirements.txt b/requirements.txt index dd596be..f76faae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,8 @@ +click==7.0 jinja2==2.10 -jsonschema -netaddr +jsonschema==3.0.1 openpyxl==2.5.4 +netaddr==0.7.19 pyyaml==3.12 -requests -click \ No newline at end of file +requests==2.21.0 +six==1.12.0 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..13ab373 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,38 @@ +[metadata] +name = spyglass +version = 0.0.1 +summary = Airship Manifest Generation +description = Tool to generate Airship documents from data sources +description-file = README.rst +author = The Airship Authors +author-email = airship-discuss@lists.airshipit.org +home-page = https://opendev.org/airship/spyglass +license = Apache-2 +requires-python = >=3.5 +classifier = + Intended Audience :: Information Technology + Intended Audience :: System Administrators + License :: OSI Approved :: Apache Software License + Operating System :: POSIX :: Linux + Programming Language :: Python + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 + +[files] +packages = + spyglass + +[entry_points] +console_scripts = + spyglass = spyglass.cli:main +data_extractor_plugins = + tugboat = spyglass.data_extractor.plugins.tugboat.tugboat:TugboatPlugin + formation = spyglass.data_extractor.plugins.formation.formation:FormationPlugin + +[yapf] +based_on_style = pep8 +allow_split_before_dict_value = false +blank_line_before_nested_class_or_def = true +blank_line_before_module_docstring = true +split_before_logical_operator = false diff --git a/setup.py b/setup.py index 2537c43..eebb692 100755 --- a/setup.py +++ b/setup.py @@ -12,35 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from setuptools import find_packages -from setuptools import setup +import setuptools -setup( - name='spyglass', - version='0.0.1', - description='Generate Airship specific yaml manifests from data sources', - url='https://opendev.org/airship/spyglass.git', - python_requires='>=3.5.0', - license='Apache 2.0', - packages=find_packages(), - install_requires=[ - 'jsonschema', - 'Click', - 'openpyxl', - 'netaddr', - 'pyyaml', - 'jinja2', - ], - entry_points={ - 'console_scripts': [ - 'spyglass=spyglass.cli:main', - ], - 'data_extractor_plugins': [ - 'formation=' - 'spyglass.data_extractor.plugins.formation:FormationPlugin', - 'tugboat=' - 'spyglass.data_extractor.plugins.tugboat.tugboat:TugboatPlugin', - ] - }, - include_package_data=True, -) +setuptools.setup(setup_requires=['pbr>=2.0.0'], pbr=True) diff --git a/spyglass/data_extractor/plugins/formation/__init__.py b/spyglass/data_extractor/plugins/formation/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/spyglass/data_extractor/plugins/formation.py b/spyglass/data_extractor/plugins/formation/formation.py similarity index 100% rename from spyglass/data_extractor/plugins/formation.py rename to spyglass/data_extractor/plugins/formation/formation.py