OLD | NEW |
---|---|
(Empty) | |
1 #!/usr/bin/env python | |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | |
3 # Use of this source code is governed by a BSD-style license that can be | |
4 # found in the LICENSE file. | |
5 | |
6 try: | |
7 from setuptools import setup | |
8 except ImportError: | |
9 from distutils.core import setup | |
10 | |
11 import ast | |
12 | |
13 | |
14 def read_vars(path): | |
15 ret = {} | |
16 with open(path) as f: | |
17 for n in ast.walk(ast.parse(f.read())): | |
18 if isinstance(n, ast.Module): | |
19 ret['__doc__'] = ast.get_docstring(n) | |
20 elif isinstance(n, ast.Assign): | |
21 if isinstance(n.targets[0], ast.Name) and isinstance(n.value, ast.Str): | |
22 ret[n.targets[0].id] = n.value.s | |
23 return ret | |
24 | |
25 | |
26 NAME = 'testing_support' | |
27 VARS = read_vars(NAME + '/__init__.py') | |
28 | |
29 | |
30 setup( | |
31 name=NAME, | |
32 version=VARS['__version__'], | |
33 description=VARS['__doc__'].splitlines()[0], | |
34 long_description=open('README.md').read(), | |
35 author=VARS['__author__'], | |
36 author_email=VARS['__email__'], | |
37 url=VARS['__url__'], | |
38 packages=[NAME], | |
39 scripts=['scripts/expect_tests'], | |
Vadim Sh.
2014/07/23 22:14:50
is this correct?
| |
40 ) | |
OLD | NEW |