-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·103 lines (81 loc) · 2.66 KB
/
setup.py
File metadata and controls
executable file
·103 lines (81 loc) · 2.66 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
"""
Flask-SendGrid
==============
A Flask Extension to bridge between `Flask-Mandrill <https://github.com/volker48/flask-mandrill>`_
and sending emails with `SendGrid <http://www.sendgrid.com/>`_
Installation
````````````
.. code:: bash
$ pip install flask-sendgrid
Usage
`````
.. code:: python
from flask import Flask
from flask.ext.sendgrid import SendGrid
app = Flask(__name__)
app.config['SENDGRID_API_KEY'] = 'your api key'
sendgrid = SendGrid(app)
sendgrid.send_email(
from_email='someone@yourdomain.com',
to_email='someoneelse@someotherdomain.com',
subject='Subject'
text='Body',
)
"""
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
def get_requirements(suffix=''):
with open('requirements%s.txt' % suffix) as f:
rv = f.read().splitlines()
return rv
def get_version():
with open('flask_sendgrid.py', 'r') as fd:
for line in fd:
if line.startswith('__version__ = '):
return line.split()[-1].strip().strip("'")
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = [
'-v',
'-xrs',
'--cov', '.',
'--cov-report', 'term-missing',
'--pep8',
'--flakes',
'--cache-clear'
]
self.test_suite = True
def run_tests(self):
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
_version = get_version()
setup(
name='Flask-SendGrid',
version=_version,
url='http://github.com/frankv/flask-sendgrid',
download_url='https://github.com/frankv/flask-sendgrid/tarball/' + _version,
license='MIT',
author='Frank Valcarcel',
author_email='frank@cuttlesoft.com',
description='Adds SendGrid support to Flask applications',
long_description=open('README.rst').read() + '\n\n' + open('HISTORY.rst').read(),
keywords=['Flask', 'SendGrid', 'email', 'smtp'],
py_modules=['flask_sendgrid'],
zip_safe=False,
platforms='any',
install_requires=['SendGrid'],
tests_require=get_requirements('-test'),
cmdclass={'test': PyTest},
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development :: Libraries :: Python Modules']
)