blob: f3f642d768303caefa9cea7ecc7786b8daff2d0f [file] [log] [blame]
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
from setuptools import setup, find_packages
import ast
import os
_this_dir = os.path.dirname(__file__)
def read_vars(path):
ret = {}
with open(path) as f:
for n in ast.walk(ast.parse(f.read())):
if isinstance(n, ast.Module):
ret['__doc__'] = ast.get_docstring(n)
elif isinstance(n, ast.Assign):
if isinstance(n.targets[0], ast.Name) and isinstance(n.value, ast.Str):
ret[n.targets[0].id] = n.value.s
return ret
NAME = 'expect_tests'
VARS = read_vars(os.path.join(_this_dir, NAME, '__init__.py'))
REQUIREMENTS = open(os.path.join(_this_dir, 'requirements.txt')).readlines()
setup(
name=NAME,
version=VARS['__version__'],
description=VARS['__doc__'].splitlines()[0],
long_description=open('README.md').read(),
author=VARS['__author__'],
author_email=VARS['__email__'],
url=VARS['__url__'],
packages=find_packages(),
install_requires=REQUIREMENTS,
scripts=['scripts/expect_tests'],
)