blob: 4749ec3ca5e8a6ce8385fe8405d7d115346e92e1 [file] [log] [blame]
Bill Wendling7d623452015-03-18 13:36:07 -07001#!/usr/bin/env python
2# Copyright 2015 Google Inc. All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
Chris Lasher49a3e0a2015-03-26 01:44:36 -070016import codecs
Bill Wendling7d623452015-03-18 13:36:07 -070017import unittest
Andy Hayden48dc5b32015-04-04 22:02:24 -070018from setuptools import setup, Command
Andy Haydenfca09e22015-04-16 22:47:11 -070019import sys
Bill Wendling7d623452015-03-18 13:36:07 -070020
21import yapf
22import yapftests
23
24
25class RunTests(Command):
26 user_options = []
27
28 def initialize_options(self):
29 pass
30
31 def finalize_options(self):
32 pass
33
34 def run(self):
Eli Bendersky1fe50342015-03-23 06:25:14 -070035 loader = unittest.TestLoader()
36 tests = loader.discover('yapftests', pattern='*_test.py', top_level_dir='.')
Bill Wendling7d623452015-03-18 13:36:07 -070037 runner = unittest.TextTestRunner()
Andy Haydenfca09e22015-04-16 22:47:11 -070038 results = runner.run(tests)
39 sys.exit(0 if results.wasSuccessful() else 1)
Bill Wendling7d623452015-03-18 13:36:07 -070040
Chris Lasher49a3e0a2015-03-26 01:44:36 -070041with codecs.open('README.rst', 'r', 'utf-8') as fd:
Bill Wendlingf57fc642015-10-11 23:59:34 -070042 setup(name='yapf',
43 version=yapf.__version__,
44 description='A formatter for Python code.',
45 long_description=fd.read(),
46 license='Apache License, Version 2.0',
47 author='Google Inc.',
48 maintainer='Bill Wendling',
49 maintainer_email='morbo@google.com',
50 packages=['yapf', 'yapf.yapflib', 'yapftests'],
51 classifiers=[
52 'Development Status :: 4 - Beta',
53 'Environment :: Console',
54 'Intended Audience :: Developers',
55 'License :: OSI Approved :: Apache Software License',
56 'Operating System :: OS Independent',
57 'Programming Language :: Python',
58 'Programming Language :: Python :: 2',
59 'Programming Language :: Python :: 2.7',
60 'Programming Language :: Python :: 3',
61 'Programming Language :: Python :: 3.4',
Felix Yan3212c672016-02-15 15:23:17 +080062 'Programming Language :: Python :: 3.5',
Bill Wendlingf57fc642015-10-11 23:59:34 -070063 'Topic :: Software Development :: Libraries :: Python Modules',
64 'Topic :: Software Development :: Quality Assurance',
65 ],
66 entry_points={'console_scripts': ['yapf = yapf:run_main'],},
67 cmdclass={'test': RunTests,},)