From d5d7097ce064a9711cd7415d100db2560ef7ff08 Mon Sep 17 00:00:00 2001 From: Mickael JEZEQUEL Date: Tue, 6 Mar 2018 16:57:15 +0100 Subject: add PyPI package setup for validation-scripts Change-Id: Idba084a548b53ae2d133d76906c265983f277e4c Issue-ID: VNFSDK-39 Signed-off-by: Mickael JEZEQUEL --- assembly.xml | 39 ------------------------- pom.xml | 43 ++++++--------------------- validation-scripts/assembly.xml | 41 ++++++++++++++++++++++++++ validation-scripts/pom.xml | 60 ++++++++++++++++++++++++++++++++++++++ validation-scripts/setup.py | 64 +++++++++++++++++++++++++++++++++++++++++ validation-scripts/version.py | 1 + 6 files changed, 175 insertions(+), 73 deletions(-) delete mode 100644 assembly.xml create mode 100644 validation-scripts/assembly.xml create mode 100644 validation-scripts/pom.xml create mode 100644 validation-scripts/setup.py create mode 100644 validation-scripts/version.py diff --git a/assembly.xml b/assembly.xml deleted file mode 100644 index e73d3f4..0000000 --- a/assembly.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - vnfsdk - - zip - - - - - validation-scripts/LICENSE.txt - validation-scripts/README.md - requirements.txt - setup.py - validation-scripts/ice_validator/** - - - **/*.pyc - - - - . - diff --git a/pom.xml b/pom.xml index ad7e6b3..0632691 100644 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,6 @@ 4.0.0 - pom - org.onap.oparent oparent @@ -26,36 +24,13 @@ under the License. org.onap.vnfsdk.ice - vnf-sdk-ice-scripts + vnf-sdk-ice + pom + + vnfsdk-ice + HEAT template validation - vnfsdk-ice-scripts - python scripts for HEAT template validation - - py - Python - **/*.py - false - - - - - maven-assembly-plugin - - false - - assembly.xml - - - - - make-assembly - package - - single - - - - - - + + validation-scripts + diff --git a/validation-scripts/assembly.xml b/validation-scripts/assembly.xml new file mode 100644 index 0000000..5a20fc3 --- /dev/null +++ b/validation-scripts/assembly.xml @@ -0,0 +1,41 @@ + + + vnfsdk + + zip + + + + . + + LICENSE.txt + README.md + requirements.txt + tox.ini + *.py + ice_validator/**/*.py + + + **/*.pyc + + + + . + diff --git a/validation-scripts/pom.xml b/validation-scripts/pom.xml new file mode 100644 index 0000000..a08f8af --- /dev/null +++ b/validation-scripts/pom.xml @@ -0,0 +1,60 @@ + + + + 4.0.0 + + org.onap.oparent + oparent + 1.0.0-SNAPSHOT + ../../oparent + + + org.onap.vnfsdk.ice + vnf-sdk-ice-scripts + pom + + vnfsdk-ice-scripts + python scripts for HEAT template validation + + py + Python + **/*.py + false + + + + + maven-assembly-plugin + + false + + assembly.xml + + + + + make-assembly + package + + single + + + + + + + diff --git a/validation-scripts/setup.py b/validation-scripts/setup.py new file mode 100644 index 0000000..3023df8 --- /dev/null +++ b/validation-scripts/setup.py @@ -0,0 +1,64 @@ +#!/usr/bin/env python + +# +# Copyright (c) 2018 Orange. 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. +# + +import os +from setuptools import setup, find_packages +import sys + +if sys.version_info < (2, 7): + sys.exit('VNF SDK requires Python 2.7+') + +root_dir = os.path.dirname(__file__) +install_requires = [] +extras_require = {} + +with open(os.path.join(root_dir, 'requirements.txt')) as requirements: + for requirement in requirements.readlines(): + # get rid of comments or trailing comments + requirement = requirement.split('#')[0].strip() + if not requirement: + continue # skip empty and comment lines + # dependencies which use environment markers have to go in as + # conditional dependencies under "extra_require", see more at: + # https://wheel.readthedocs.io/en/latest/index.html#defining-conditional-dependencies + if ';' in requirement: + package, condition = requirement.split(';') + cond_name = ':{0}'.format(condition.strip()) + extras_require.setdefault(cond_name, []) + extras_require[cond_name].append(package.strip()) + else: + install_requires.append(requirement) + +# read __version__ +exec(open('./version.py').read()) + +setup( + name='vnfsdk-ice-scripts', + version= __version__, + description='VNF SDK Heat validation scripts', + license='Apache License Version 2.0', + url='http://onap.org/', + + packages=find_packages('.'), + + package_dir={'ice_validator': 'ice_validator'}, + + include_package_data=True, + install_requires=install_requires, + extras_require=extras_require) + diff --git a/validation-scripts/version.py b/validation-scripts/version.py new file mode 100644 index 0000000..1f356cc --- /dev/null +++ b/validation-scripts/version.py @@ -0,0 +1 @@ +__version__ = '1.0.0' -- cgit 1.2.3-korg