blob: 5662afd660085ac3878e687e4c547854de191978 [file] [log] [blame]
Zack Williams73a12852018-09-05 15:33:35 -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
Zack Williams5c2ea232019-01-30 15:23:01 -070015from __future__ import absolute_import
16
17import os
18from shutil import copyfile
19
20from setuptools import setup
Zack Williams73a12852018-09-05 15:33:35 -070021
22
23def readme():
Zack Williams045b63d2019-01-22 16:30:57 -070024 with open("README.rst") as f:
Zack Williams73a12852018-09-05 15:33:35 -070025 return f.read()
26
27
Zack Williams5c2ea232019-01-30 15:23:01 -070028def version():
29 # Copy VERSION file of parent to module directory if not found
30 if not os.path.exists("xoskafka/VERSION"):
31 copyfile("../../VERSION", "xoskafka/VERSION")
32 with open("xoskafka/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(
Zack Williams045b63d2019-01-22 16:30:57 -070046 name="xoskafka",
Zack Williams5c2ea232019-01-30 15:23:01 -070047 version=version(),
Zack Williams045b63d2019-01-22 16:30:57 -070048 description="Wrapper around kafka for XOS",
Zack Williams73a12852018-09-05 15:33:35 -070049 long_description=readme(),
Zack Williams045b63d2019-01-22 16:30:57 -070050 author="Zack Williams",
51 author_email="zdw@opennetworking.org",
Zack Williams5c2ea232019-01-30 15:23:01 -070052 classifiers=["License :: OSI Approved :: Apache Software License"],
Zack Williams045b63d2019-01-22 16:30:57 -070053 license="Apache v2",
Zack Williams5c2ea232019-01-30 15:23:01 -070054 packages=["xoskafka"],
55 install_requires=parse_requirements("requirements.txt"),
Zack Williams73a12852018-09-05 15:33:35 -070056 include_package_data=True,
Zack Williams045b63d2019-01-22 16:30:57 -070057)