forked from nylas/nylas-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
108 lines (90 loc) · 3.4 KB
/
setup.py
File metadata and controls
108 lines (90 loc) · 3.4 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import os
import sys
import re
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
VERSION = ''
with open('nylas/_client_sdk_version.py', 'r') as fd:
VERSION = re.search(r'^__VERSION__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)
RUN_DEPENDENCIES = [
"requests>=2.4.2",
"six>=1.4.1",
"bumpversion>=0.5.0",
"pyOpenSSL", # needed for SNI support, required by api.nylas.com
"ndg-httpsclient",
"pyasn1",
"urlobject",
]
TEST_DEPENDENCIES = [
'astroid',
'pylint',
"pytest",
"pytest-cov",
"pytest-pylint",
"responses==0.10.5",
]
class PyTest(TestCommand):
user_options = [
('pytest-args=', 'a', "Arguments to pass to pytest"),
('lint', None, "Enable linting with pylint"),
]
boolean_options = ['lint']
def initialize_options(self):
TestCommand.initialize_options(self)
# pylint: disable=attribute-defined-outside-init
self.pytest_args = ['--cov', '--junitxml', './tests/output', 'tests/']
self.lint = False
def finalize_options(self):
TestCommand.finalize_options(self)
# pylint: disable=attribute-defined-outside-init
self.test_args = []
self.test_suite = True
if self.lint:
self.pytest_args.append("--pylint")
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)
def main():
# A few handy release helpers.
if len(sys.argv) > 1:
if sys.argv[1] == 'publish':
os.system('git push --follow-tags && python setup.py sdist upload')
sys.exit()
elif sys.argv[1] == 'release':
if len(sys.argv) < 3:
type_ = 'patch'
else:
type_ = sys.argv[2]
os.system('bumpversion --current-version {} {}'
.format(VERSION, type_))
sys.exit()
setup(
name="nylas",
version=VERSION,
packages=find_packages(),
install_requires=RUN_DEPENDENCIES,
dependency_links=[],
tests_require=TEST_DEPENDENCIES,
extras_require={'test': TEST_DEPENDENCIES},
cmdclass={'test': PyTest},
author="Nylas Team",
author_email="support@nylas.com",
description='Python bindings for Nylas, the next-generation email platform.',
license="MIT",
keywords="inbox app appserver email nylas contacts calendar",
url='https://github.com/nylas/nylas-python',
long_description_content_type='text/markdown',
long_description='''
# Nylas REST API Python bindings
[](https://travis-ci.org/nylas/nylas-python)
[](https://codecov.io/gh/nylas/nylas-python)
Python bindings for the Nylas REST API. https://www.nylas.com/docs
The Nylas APIs power applications with email, calendar, and contacts CRUD and bi-directional sync from any inbox in the world.
Nylas is compatible with 100% of email service providers, so you only have to integrate once.
No more headaches building unique integrations against archaic and outdated IMAP and SMTP protocols.''',
)
if __name__ == '__main__':
sys.exit(main())