blob: 1e0311d5fadcdc8a4fc6a638836b029d7dc5aff6 [file] [log] [blame]
Illyoung Choi5d59ab62019-06-24 16:15:27 -07001# Copyright 2018-present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15from __future__ import absolute_import
16
17import os
18from shutil import copyfile
19
20from setuptools import setup
21
22
23def readme():
24 with open("README.rst") as f:
25 return f.read()
26
27
28def version():
29 # Copy VERSION file of parent to module directory if not found
30 if not os.path.exists("cordworkflowessenceextractor/VERSION"):
31 copyfile("../../VERSION", "cordworkflowessenceextractor/VERSION")
32 with open("cordworkflowessenceextractor/VERSION") as f:
33 return f.read().strip()
34
35
36def parse_requirements(filename):
37 # parse a requirements.txt file, allowing for blank lines and comments
38 requirements = []
39 for line in open(filename):
40 if line and not line.startswith("#"):
41 requirements.append(line)
42 return requirements
43
44
45setup(
46 name="cordworkflowessenceextractor",
47 version=version(),
48 description="Extract workflow essence from airflow workflow code",
49 long_description=readme(),
50 author="Illyoung Choi",
51 author_email="iychoi@opennetworking.org",
52 classifiers=["License :: OSI Approved :: Apache Software License"],
53 license="Apache v2",
54 packages=["cordworkflowessenceextractor"],
55 install_requires=parse_requirements("requirements.txt"),
56 include_package_data=True,
57)