From a23066fa1436c21c74e80b812f94b19901c59e40 Mon Sep 17 00:00:00 2001 From: Shashank Reddy Boyapally Date: Mon, 15 Jan 2024 14:27:15 -0500 Subject: [PATCH] added setup.py for packaging --- fmatch/__init__.py | 1 - fmatch/matcher.py | 8 ++------ setup.py | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 setup.py diff --git a/fmatch/__init__.py b/fmatch/__init__.py index 4e0b627..1f6f729 100644 --- a/fmatch/__init__.py +++ b/fmatch/__init__.py @@ -1,3 +1,2 @@ """This file is the init file of the matcher package which is used as to match and query data from elastic server""" -from fmatch.matcher import Matcher diff --git a/fmatch/matcher.py b/fmatch/matcher.py index 955aa27..3e12eef 100644 --- a/fmatch/matcher.py +++ b/fmatch/matcher.py @@ -7,7 +7,6 @@ from elasticsearch.exceptions import NotFoundError # pylint: disable=import-error import pandas as pd -import yaml @@ -16,13 +15,10 @@ class Matcher: """ Matcher """ - def __init__(self, configpath="config.yaml", index="perf_scale_ci"): + def __init__(self, index="perf_scale_ci"): self.index = index self.es_url = ES_URL - with open(configpath, 'r',encoding='UTF-8') as file: - data = yaml.safe_load(file) - self.es = Elasticsearch([self.es_url], http_auth=[ - data['username'], data['password']], timeout=30) + self.es = Elasticsearch(self.es_url, timeout=30) self.data = None def get_metadata_by_uuid(self, uuid, index=None): diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..fd5e0a2 --- /dev/null +++ b/setup.py @@ -0,0 +1,32 @@ +""" +setup file for fmatch package +""" +from setuptools import setup, find_packages + + +VERSION = '0.0.1' +DESCRIPTION = 'Common package for matching runs with provided metadata' +# pylint: disable= line-too-long +LONG_DESCRIPTION = "A package that allows to match metadata and get runs and create csv files with queried metrics" + +# Setting up +setup( + name="fmatch", + version=VERSION, + author="sboyapal", + author_email="sboyapal@redhat.com", + description=DESCRIPTION, + long_description_content_type="text/x-rst", + long_description=LONG_DESCRIPTION, + packages=find_packages(), + install_requires=['elasticsearch7==7.13.0', 'elasticsearch', 'pyyaml','pandas'], + keywords=['python', 'matching', 'red hat', 'perf-scale', 'matcher', 'orion'], + classifiers=[ + "Development Status :: 1 - Planning", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3", + "Operating System :: Unix", + "Operating System :: MacOS :: MacOS X", + "Operating System :: Microsoft :: Windows", + ] +)