Skip to content
Snippets Groups Projects
Commit 9aef1dc3 authored by Eduardo Sousa's avatar Eduardo Sousa
Browse files

Adding setup.py to charm-generator


Change-Id: I1ba69e255727703ed2f25b4f3dbabd53685573f4
Signed-off-by: default avatarEduardo Sousa <esousa@whitestack.com>
parent 0eab83f6
No related branches found
No related tags found
No related merge requests found
Showing
with 124 additions and 11 deletions
# Copyright 2019 Whitestack, LLC
#
# 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.
#
# For those usages not covered by the Apache License, Version 2.0 please
# contact: esousa@whitestack.com or glavado@whitestack.com
##
from generator.generator import main
if __name__ == '__main__':
main()
# Copyright 2019 Whitestack, LLC
#
# 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.
#
# For those usages not covered by the Apache License, Version 2.0 please
# contact: esousa@whitestack.com or glavado@whitestack.com
##
from .generator import main
main()
......@@ -16,13 +16,15 @@
# contact: esousa@whitestack.com or glavado@whitestack.com
##
__version__ = '1.0.0'
import argparse
import logging
import sys
from datetime import datetime
from generators.ansible_generator import AnsibleGenerator
from .generators.ansible_generator import AnsibleGenerator
def configure_logger(args):
......@@ -165,7 +167,3 @@ def main():
generator.generate()
logger.info('Generation process complete.')
if __name__ == "__main__":
main()
......@@ -26,7 +26,7 @@ from jinja2 import Environment, PackageLoader
class ActionsGenerator:
LOGGER = logging.getLogger()
ENV = Environment(loader=PackageLoader('actions', 'templates'))
ENV = Environment(loader=PackageLoader('generator.actions', 'templates'))
def __init__(self, metadata, actions, license=None, options=None):
"""
......
......@@ -23,13 +23,13 @@ import sys
from jinja2 import Environment, PackageLoader
from generators.actions_generator import ActionsGenerator
from generators.metadata_generator import MetadataGenerator
from generator.generators.actions_generator import ActionsGenerator
from generator.generators.metadata_generator import MetadataGenerator
class AnsibleGenerator:
LOGGER = logging.getLogger()
ENV = Environment(loader=PackageLoader('ansible-charm', 'templates'))
ENV = Environment(loader=PackageLoader('generator.ansible-charm', 'templates'))
def __init__(self, metadata, license=None, options=None):
"""
......
......@@ -28,7 +28,7 @@ from jinja2 import Environment, PackageLoader
class MetadataGenerator:
LOGGER = logging.getLogger()
ENV = Environment(loader=PackageLoader('metadata', 'templates'))
ENV = Environment(loader=PackageLoader('generator.metadata', 'templates'))
def __init__(self, metadata, license=None, options=None):
"""
......
# Copyright 2019 Whitestack, LLC
#
# 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.
#
# For those usages not covered by the Apache License, Version 2.0 please
# contact: esousa@whitestack.com or glavado@whitestack.com
##
Jinja2==2.10
Jinja2>=2.10
# Copyright 2019 Whitestack, LLC
#
# 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.
#
# For those usages not covered by the Apache License, Version 2.0 please
# contact: esousa@whitestack.com or glavado@whitestack.com
##
import re
import setuptools
version = re.search(
r'^__version__\s*=\s*["\'](.*)["\']',
open('generator/generator.py').read(),
re.MULTILINE).group(1)
with open('README.md', 'r') as f:
long_description = f.read()
setuptools.setup(
name='osm-charm-generator',
packages=setuptools.find_packages(),
entry_points={
"console_scripts": ['osm-charm-generator = generator.generator:main']
},
version=version,
author='Eduardo Sousa',
author_email='esousa@whitestack.com',
description='OSM Charm Generator using Ansible',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://osm.etsi.org',
install_requires=[
'Jinja2>=2.10'
],
classifiers=[
'Programming Language :: Python :: 3 :: Only',
'License :: OSI Approved :: Apache Software License',
'Operating System :: POSIX :: Linux',
'Environment :: Console',
'Intended Audience :: Telecommunications Industry',
'Natural Language :: English',
'Topic :: Software Development :: Code Generators'
]
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment