This repository has been archived by the owner on Feb 13, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
setup.py
88 lines (71 loc) · 2.26 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016-2017 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from setuptools import Command, setup
from setuptools import find_packages
from unittest import TestLoader, TextTestRunner
from os import path
PROJECT = 'oca-decorators'
SHORT_DESC = (
'This is a library of decorators for Odoo developers.'
)
README_FILE = 'README.rst'
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Environment :: Console',
'Framework :: Odoo',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Lesser General Public License v3 or '
'later (LGPLv3+)',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Software Development :: Libraries :: Python Modules',
]
setup_vals = {
'name': PROJECT,
'author': 'Odoo Community Association (OCA)',
'author_email': '[email protected]',
'description': SHORT_DESC,
'url': 'https://oca.github.io/%s' % PROJECT,
'download_url': 'https://github.com/OCA/%s' % PROJECT,
'license': 'LGPL-3',
'classifiers': CLASSIFIERS,
}
if path.exists(README_FILE):
with open(README_FILE) as fh:
setup_vals['long_description'] = fh.read()
class FailTestException(Exception):
""" It provides a failing build """
pass
class Tests(Command):
""" Run test & coverage, save reports as XML """
user_options = [] # < For Command API compatibility
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
loader = TestLoader()
tests = loader.discover('.', 'test_*.py')
t = TextTestRunner(verbosity=1)
res = t.run(tests)
if not res.wasSuccessful():
raise FailTestException()
if __name__ == "__main__":
setup(
packages=find_packages(exclude=('tests')),
use_scm_version=True,
cmdclass={'test': Tests},
setup_requires=[
'setuptools_scm',
],
install_requires=[
'decorator',
],
**setup_vals
)