diff --git a/.gitignore b/.gitignore
index 96232a5bf..4ac2623b4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,4 +22,4 @@ htmlcov
temp*.py
sendgrid.env
.vscode
-
+sendgrid/VERSION.txt
diff --git a/.travis.yml b/.travis.yml
index 1a8231c0e..cb4a7a0a6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -20,7 +20,6 @@ install:
- pip install pyyaml
- pip install flask
- pip install six
-- pip install pypandoc
- pip install coverage
- pip install codecov
# - sudo apt-get install -y pandoc
@@ -38,8 +37,6 @@ script:
after_script:
- codecov
- ./cc-test-reporter after-build --exit-code $?
-before_deploy:
-- python ./register.py
deploy:
provider: pypi
user: thinkingserious
diff --git a/MANIFEST.in b/MANIFEST.in
index 94d2153e7..21d9e9a11 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,6 +1,8 @@
include README.rst
include LICENSE.txt
+include VERSION.txt
include app.json
include Procfile
include requirements.txt
+recursive-include sendgrid *.py *.txt
recursive-exclude test *
diff --git a/README.md b/README.md
deleted file mode 100644
index ba6468f23..000000000
--- a/README.md
+++ /dev/null
@@ -1,221 +0,0 @@
-![SendGrid Logo](https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png)
-
-[![Travis Badge](https://travis-ci.org/sendgrid/sendgrid-python.svg?branch=master)](https://travis-ci.org/sendgrid/sendgrid-python)
-[![codecov](https://img.shields.io/codecov/c/github/sendgrid/sendgrid-python/master.svg?style=flat-square&label=Codecov+Coverage)](https://codecov.io/gh/sendgrid/sendgrid-python)
-[![Docker Badge](https://img.shields.io/docker/automated/sendgrid/sendgrid-python.svg)](https://hub.docker.com/r/sendgrid/sendgrid-python/)
-[![Email Notifications Badge](https://dx.sendgrid.com/badge/python)](https://dx.sendgrid.com/newsletter/python)
-[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.txt)
-[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)
-[![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/sendgrid-python.svg)](https://github.com/sendgrid/sendgrid-python/graphs/contributors)
-
-**NEW:**
-
-* Subscribe to email [notifications](https://dx.sendgrid.com/newsletter/python) for releases and breaking changes.
-* Quickly get started with [Docker](https://github.com/sendgrid/sendgrid-python/tree/master/docker).
-
-**This library allows you to quickly and easily use the SendGrid Web API v3 via Python.**
-
-Version 3.X.X+ of this library provides full support for all SendGrid [Web API v3](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html) endpoints, including the new [v3 /mail/send](https://sendgrid.com/blog/introducing-v3mailsend-sendgrids-new-mail-endpoint).
-
-This library represents the beginning of a new path for SendGrid. We want this library to be community driven and SendGrid led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/sendgrid/sendgrid-python/issues) and [pull requests](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md) or simply upvote or comment on existing issues or pull requests.
-
-Please browse the rest of this README for further detail.
-
-We appreciate your continued support, thank you!
-
-# Table of Contents
-
-* [Installation](#installation)
-* [Quick Start](#quick-start)
-* [Processing Inbound Email](#inbound)
-* [Usage](#usage)
-* [Use Cases](#use-cases)
-* [Announcements](#announcements)
-* [Roadmap](#roadmap)
-* [How to Contribute](#contribute)
-* [Troubleshooting](#troubleshooting)
-* [About](#about)
-* [License](#license)
-
-
-# Installation
-
-## Prerequisites
-
-- Python version 2.7 and 3.4+
-- The SendGrid service, starting at the [free level](https://sendgrid.com/free?source=sendgrid-python)
-
-## Setup Environment Variables
-
-Update the development environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys), for example:
-
-```bash
-echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
-echo "sendgrid.env" >> .gitignore
-source ./sendgrid.env
-```
-
-Sendgrid also supports local environment file `.env`. Copy or rename `.env_sample` into `.env` and update [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys) with your key.
-
-## Install Package
-
-```bash
-pip install sendgrid
-```
-
-## Dependencies
-
-- [Python-HTTP-Client](https://github.com/sendgrid/python-http-client)
-
-
-# Quick Start
-
-## Hello Email
-
-The following is the minimum needed code to send an email with the [/mail/send Helper](https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/mail) ([here](https://github.com/sendgrid/sendgrid-python/blob/master/examples/helpers/mail/mail_example.py#L20) is a full example):
-
-### With Mail Helper Class
-
-```python
-import sendgrid
-import os
-from sendgrid.helpers.mail import *
-
-sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
-from_email = Email("test@example.com")
-to_email = Email("test@example.com")
-subject = "Sending with SendGrid is Fun"
-content = Content("text/plain", "and easy to do anywhere, even with Python")
-mail = Mail(from_email, subject, to_email, content)
-response = sg.client.mail.send.post(request_body=mail.get())
-print(response.status_code)
-print(response.body)
-print(response.headers)
-```
-
-The `Mail` constructor creates a [personalization object](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/personalizations.html) for you. [Here](https://github.com/sendgrid/sendgrid-python/blob/master/examples/helpers/mail/mail_example.py#L16) is an example of how to add it.
-
-### Without Mail Helper Class
-
-The following is the minimum needed code to send an email without the /mail/send Helper ([here](https://github.com/sendgrid/sendgrid-python/blob/master/examples/mail/mail.py#L27) is a full example):
-
-```python
-import sendgrid
-import os
-
-sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
-data = {
- "personalizations": [
- {
- "to": [
- {
- "email": "test@example.com"
- }
- ],
- "subject": "Sending with SendGrid is Fun"
- }
- ],
- "from": {
- "email": "test@example.com"
- },
- "content": [
- {
- "type": "text/plain",
- "value": "and easy to do anywhere, even with Python"
- }
- ]
-}
-response = sg.client.mail.send.post(request_body=data)
-print(response.status_code)
-print(response.body)
-print(response.headers)
-```
-
-## General v3 Web API Usage (With [Fluent Interface](https://sendgrid.com/blog/using-python-to-implement-a-fluent-interface-to-any-rest-api/))
-
-```python
-import sendgrid
-import os
-
-sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
-response = sg.client.suppression.bounces.get()
-print(response.status_code)
-print(response.body)
-print(response.headers)
-```
-
-## General v3 Web API Usage (Without Fluent Interface)
-
-```python
-import sendgrid
-import os
-
-sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
-response = sg.client._("suppression/bounces").get()
-print(response.status_code)
-print(response.body)
-print(response.headers)
-```
-
-
-# Processing Inbound Email
-
-Please see [our helper](https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/inbound) for utilizing our Inbound Parse webhook.
-
-
-# Usage
-
-- [SendGrid Documentation](https://sendgrid.com/docs/API_Reference/index.html)
-- [Library Usage Documentation](https://github.com/sendgrid/sendgrid-python/tree/master/USAGE.md)
-- [Example Code](https://github.com/sendgrid/sendgrid-python/tree/master/examples)
-- [How-to: Migration from v2 to v3](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/how_to_migrate_from_v2_to_v3_mail_send.html)
-- [v3 Web API Mail Send Helper](https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/mail) - build a request object payload for a v3 /mail/send API call.
-- [Processing Inbound Email](https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/inbound)
-
-
-# Use Cases
-
-[Examples of common API use cases](https://github.com/sendgrid/sendgrid-python/blob/master/use_cases/README.md), such as how to send an email with a transactional template.
-
-
-# Announcements
-
-Join an experienced and passionate team that focuses on making an impact. Opportunities abound to grow the product - and grow your career! Check out our [Data Platform Engineer role](http://grnh.se/wbx1701)
-
-Please see our announcement regarding [breaking changes](https://github.com/sendgrid/sendgrid-python/issues/217). Your support is appreciated!
-
-All updates to this library are documented in our [CHANGELOG](https://github.com/sendgrid/sendgrid-python/blob/master/CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-python/releases). You may also subscribe to email [release notifications](https://dx.sendgrid.com/newsletter/java) for releases and breaking changes.
-
-
-# Roadmap
-
-If you are interested in the future direction of this project, please take a look at our open [issues](https://github.com/sendgrid/sendgrid-python/issues) and [pull requests](https://github.com/sendgrid/sendgrid-python/pulls). We would love to hear your feedback.
-
-
-# How to Contribute
-
-We encourage contribution to our libraries (you might even score some nifty swag), please see our [CONTRIBUTING](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md) guide for details.
-
-Quick links:
-
-- [Feature Request](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#feature-request)
-- [Bug Reports](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#submit-a-bug-report)
-- [Sign the CLA to Create a Pull Request](https://cla.sendgrid.com/sendgrid/sendgrid-python)
-- [Improvements to the Codebase](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#improvements-to-the-codebase)
-- [Review Pull Requests](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#code-reviews)
-
-
-# Troubleshooting
-
-Please see our [troubleshooting guide](https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md) for common library issues.
-
-
-# About
-
-sendgrid-python is guided and supported by the SendGrid [Developer Experience Team](mailto:dx@sendgrid.com).
-
-sendgrid-python is maintained and funded by SendGrid, Inc. The names and logos for sendgrid-python are trademarks of SendGrid, Inc.
-
-
-# License
-[The MIT License (MIT)](LICENSE.txt)
diff --git a/README.rst b/README.rst
new file mode 100644
index 000000000..3cce78559
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,317 @@
+.. image:: https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png
+ :target: https://www.sendgrid.com
+
+|Travis Badge| |codecov| |Python Versions| |PyPI Version| |Docker Badge| |Email Notifications Badge| |MIT licensed| |Twitter Follow| |GitHub contributors| |Open Source Helpers|
+
+**NEW:**
+
+- Subscribe to email `notifications`_ for releases and breaking changes.
+- Quickly get started with `Docker`_.
+
+**This library allows you to quickly and easily use the SendGrid Web API v3 via Python.**
+
+Version 3.X.X+ of this library provides full support for all SendGrid `Web API v3`_ endpoints, including the new `v3 /mail/send`_.
+
+This library represents the beginning of a new path for SendGrid.
+We want this library to be community driven and SendGrid led.
+We need your help to realize this goal.
+To help make sure we are building the right things in the right order,
+we ask that you create `issues`_ and `pull requests`_ or simply upvote or comment on existing issues or pull requests.
+
+Please browse the rest of this README for further detail.
+
+We appreciate your continued support, thank you!
+
+Table of Contents
+=================
+
+- `Installation <#installation>`__
+- `Quick Start <#quick-start>`__
+- `Processing Inbound Email <#processing-inbound-email>`__
+- `Usage <#usage>`__
+- `Use Cases <#use-cases>`__
+- `Announcements <#announcements>`__
+- `Roadmap <#roadmap>`__
+- `How to Contribute <#how-to-contribute>`__
+- `Troubleshooting <#troubleshooting>`__
+- `About <#about>`__
+- `License <#license>`__
+
+Installation
+============
+
+Prerequisites
+-------------
+
+- Python version 2.7 and 3.4+
+- The SendGrid service, starting at the `free level`_
+
+Setup Environment Variables
+---------------------------
+
+Mac
+~~~
+
+Update the development environment with your `SENDGRID_API_KEY`_ (more info `here `__), for example:
+
+.. code:: bash
+
+ echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
+ echo "sendgrid.env" >> .gitignore
+ source ./sendgrid.env
+
+SendGrid also supports local environment file ``.env``.
+Copy or rename ``.env_sample`` into ``.env`` and update `SENDGRID_API_KEY`_ with your key.
+
+Windows
+~~~~~~~
+
+Temporarily set the environment variable (accessible only during the current CLI session):
+
+.. code:: bash
+
+ set SENDGRID_API_KEY=YOUR_API_KEY
+
+Permanently set the environment variable (accessible in all subsequent CLI sessions):
+
+.. code:: bash
+
+ setx SENDGRID_API_KEY "YOUR_API_KEY"
+
+Install Package
+---------------
+
+.. code:: bash
+
+ pip install sendgrid
+
+Dependencies
+------------
+
+- `Python-HTTP-Client`_
+
+Quick Start
+===========
+
+Hello Email
+-----------
+
+The following is the minimum needed code to send an email with the `/mail/send Helper`_
+(`here `__ is a full example):
+
+With Mail Helper Class
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code:: python
+
+ import sendgrid
+ import os
+ from sendgrid.helpers.mail import *
+
+ sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
+ from_email = Email("test@example.com")
+ to_email = Email("test@example.com")
+ subject = "Sending with SendGrid is Fun"
+ content = Content("text/plain", "and easy to do anywhere, even with Python")
+ mail = Mail(from_email, subject, to_email, content)
+ response = sg.client.mail.send.post(request_body=mail.get())
+ print(response.status_code)
+ print(response.body)
+ print(response.headers)
+
+The ``Mail`` constructor creates a `personalization object`_ for you.
+`Here `__ is an example of how to add it.
+
+Without Mail Helper Class
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The following is the minimum needed code to send an email without the /mail/send Helper
+(`here `__ is a full example):
+
+.. code:: python
+
+ import sendgrid
+ import os
+
+ sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
+ data = {
+ "personalizations": [
+ {
+ "to": [
+ {
+ "email": "test@example.com"
+ }
+ ],
+ "subject": "Sending with SendGrid is Fun"
+ }
+ ],
+ "from": {
+ "email": "test@example.com"
+ },
+ "content": [
+ {
+ "type": "text/plain",
+ "value": "and easy to do anywhere, even with Python"
+ }
+ ]
+ }
+ response = sg.client.mail.send.post(request_body=data)
+ print(response.status_code)
+ print(response.body)
+ print(response.headers)
+
+General v3 Web API Usage (With `Fluent Interface`_)
+---------------------------------------------------
+
+.. code:: python
+
+ import sendgrid
+ import os
+
+ sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
+ response = sg.client.suppression.bounces.get()
+ print(response.status_code)
+ print(response.body)
+ print(response.headers)
+
+General v3 Web API Usage (Without `Fluent Interface`_)
+------------------------------------------------------
+
+.. code:: python
+
+ import sendgrid
+ import os
+
+ sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
+ response = sg.client._("suppression/bounces").get()
+ print(response.status_code)
+ print(response.body)
+ print(response.headers)
+
+Processing Inbound Email
+========================
+
+Please see `our helper`_ for utilizing our Inbound Parse webhook.
+
+Usage
+=====
+
+- `SendGrid Documentation`_
+- `Library Usage Documentation`_
+- `Example Code`_
+- `How-to: Migration from v2 to v3`_
+- `v3 Web API Mail Send Helper`_ - build a request object payload for a v3 /mail/send API call.
+- `Processing Inbound Email`_
+
+Use Cases
+=========
+
+`Examples of common API use cases`_, such as how to send an email with a transactional template.
+
+Announcements
+=============
+
+Join an experienced and passionate team that focuses on making an impact.
+`Opportunities abound`_ to grow the product - and grow your career!
+
+Please see our announcement regarding `breaking changes`_.
+Your support is appreciated!
+
+All updates to this library are documented in our `CHANGELOG`_ and `releases`_.
+You may also subscribe to email `release notifications`_ for releases and breaking changes.
+
+Roadmap
+=======
+
+If you are interested in the future direction of this project,
+please take a look at our open `issues`_ and `pull requests `__.
+We would love to hear your feedback.
+
+How to Contribute
+=================
+
+We encourage contribution to our libraries (you might even score some nifty swag), please see our `CONTRIBUTING`_ guide for details.
+
+Quick links:
+
+- `Feature Request`_
+- `Bug Reports`_
+- `Improvements to the Codebase`_
+- `Review Pull Requests`_
+- `Sign the CLA to Create a Pull Request`_
+
+Troubleshooting
+===============
+
+Please see our `troubleshooting guide`_ for common library issues.
+
+About
+=====
+
+**sendgrid-python** is guided and supported by the SendGrid Developer Experience Team.
+
+Email the Developer Experience Team `here `__ in case of any queries.
+
+**sendgrid-python** is maintained and funded by SendGrid, Inc.
+The names and logos for **sendgrid-python** are trademarks of SendGrid, Inc.
+
+License
+=======
+
+`The MIT License (MIT)`_
+
+.. _notifications: https://dx.sendgrid.com/newsletter/python
+.. _Docker: https://github.com/sendgrid/sendgrid-python/tree/master/docker
+.. _Web API v3: https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html
+.. _v3 /mail/send: https://sendgrid.com/blog/introducing-v3mailsend-sendgrids-new-mail-endpoint
+.. _issues: https://github.com/sendgrid/sendgrid-python/issues
+.. _pull requests: https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md
+.. _free level: https://sendgrid.com/free?source=sendgrid-python
+.. _SENDGRID_API_KEY: https://app.sendgrid.com/settings/api_keys
+.. _Python-HTTP-Client: https://github.com/sendgrid/python-http-client
+.. _/mail/send Helper: https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/mail
+.. _personalization object: https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/personalizations.html
+.. _Fluent Interface: https://sendgrid.com/blog/using-python-to-implement-a-fluent-interface-to-any-rest-api/
+.. _our helper: https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/inbound
+.. _SendGrid Documentation: https://sendgrid.com/docs/API_Reference/index.html
+.. _Library Usage Documentation: https://github.com/sendgrid/sendgrid-python/tree/master/USAGE.md
+.. _Example Code: https://github.com/sendgrid/sendgrid-python/tree/master/examples
+.. _`How-to: Migration from v2 to v3`: https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/how_to_migrate_from_v2_to_v3_mail_send.html
+.. _v3 Web API Mail Send Helper: https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/mail
+.. _Processing Inbound Email: https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/inbound
+.. _Examples of common API use cases: https://github.com/sendgrid/sendgrid-python/blob/master/use_cases/README.md
+.. _Opportunities abound: https://sendgrid.com/careers
+.. _breaking changes: https://github.com/sendgrid/sendgrid-python/issues/217
+.. _CHANGELOG: https://github.com/sendgrid/sendgrid-python/blob/master/CHANGELOG.md
+.. _releases: https://github.com/sendgrid/sendgrid-python/releases
+.. _release notifications: https://dx.sendgrid.com/newsletter/python
+.. _CONTRIBUTING: https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md
+.. _Feature Request: https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#feature-request
+.. _Bug Reports: https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#submit-a-bug-report
+.. _Improvements to the Codebase: https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#improvements-to-the-codebase
+.. _Review Pull Requests: https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#code-reviews
+.. _Sign the CLA to Create a Pull Request: https://cla.sendgrid.com/sendgrid/sendgrid-python
+.. _troubleshooting guide: https://github.com/sendgrid/sendgrid-python/blob/master/TROUBLESHOOTING.md
+.. _Developer Experience Team: mailto:dx@sendgrid.com
+.. _The MIT License (MIT): https://github.com/sendgrid/sendgrid-python/blob/master/LICENSE.txt
+
+.. |Travis Badge| image:: https://travis-ci.org/sendgrid/sendgrid-python.svg?branch=master
+ :target: https://travis-ci.org/sendgrid/sendgrid-python
+.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/sendgrid.svg
+ :target: https://pypi.org/project/sendgrid/
+.. |PyPI Version| image:: https://img.shields.io/pypi/v/sendgrid.svg
+ :target: https://pypi.org/project/sendgrid/
+.. |codecov| image:: https://img.shields.io/codecov/c/github/sendgrid/sendgrid-python/master.svg?style=flat-square&label=Codecov+Coverage
+ :target: https://codecov.io/gh/sendgrid/sendgrid-python
+.. |Docker Badge| image:: https://img.shields.io/docker/automated/sendgrid/sendgrid-python.svg
+ :target: https://hub.docker.com/r/sendgrid/sendgrid-python/
+.. |Email Notifications Badge| image:: https://dx.sendgrid.com/badge/python
+ :target: https://dx.sendgrid.com/newsletter/python
+.. |MIT licensed| image:: https://img.shields.io/badge/license-MIT-blue.svg
+ :target: ./LICENSE.txt
+.. |Twitter Follow| image:: https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow
+ :target: https://twitter.com/sendgrid
+.. |GitHub contributors| image:: https://img.shields.io/github/contributors/sendgrid/sendgrid-python.svg
+ :target: https://github.com/sendgrid/sendgrid-python/graphs/contributors
+.. |Open Source Helpers| image:: https://www.codetriage.com/sendgrid/sendgrid-python/badges/users.svg
+ :target: https://www.codetriage.com/sendgrid/sendgrid-python
diff --git a/VERSION.txt b/VERSION.txt
new file mode 100644
index 000000000..ade65226e
--- /dev/null
+++ b/VERSION.txt
@@ -0,0 +1 @@
+5.4.1
diff --git a/register.py b/register.py
deleted file mode 100644
index 0a7ffe8d8..000000000
--- a/register.py
+++ /dev/null
@@ -1,20 +0,0 @@
-import pypandoc
-from io import open
-
-output = pypandoc.convert('README.md', 'rst')
-with open('README.txt', 'w+') as f:
- f.write(output)
-
-readme_rst = open('./README.txt', 'r', encoding='utf-8').read()
-replace = '''
- .. figure:: https://uiux.s3.amazonaws.com/2016-logos/email-logo
- %402x.png\n :alt: SendGrid Logo\n\n SendGrid Logo\n
- '''
-replacement = '''
- |SendGrid Logo|\n\n.. |SendGrid Logo| image::
- https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png
- \n :target: https://www.sendgrid.com
- '''
-final_text = readme_rst.replace(replace, replacement)
-with open('./README.txt', 'w', encoding='utf-8') as f:
- f.write(final_text)
diff --git a/sendgrid/__init__.py b/sendgrid/__init__.py
index 2bbd38b59..050e798e9 100644
--- a/sendgrid/__init__.py
+++ b/sendgrid/__init__.py
@@ -15,7 +15,12 @@
Modules to help with common tasks.
"""
-from .version import __version__ # noqa
+import os
# v3 API
from .sendgrid import SendGridAPIClient # noqa
from .helpers.mail import Email # noqa
+
+
+dir_path = os.path.dirname(os.path.realpath(__file__))
+if os.path.isfile(os.path.join(dir_path, 'VERSION.txt')):
+ __version__ = open(os.path.join(dir_path, 'VERSION.txt')).read().strip()
diff --git a/sendgrid/sendgrid.py b/sendgrid/sendgrid.py
index 5be0a651f..b1665cf61 100644
--- a/sendgrid/sendgrid.py
+++ b/sendgrid/sendgrid.py
@@ -18,8 +18,6 @@
import python_http_client
-from .version import __version__
-
class SendGridAPIClient(object):
"""The SendGrid API Client.
@@ -62,6 +60,7 @@ def __init__(
:param opts: dispatcher for deprecated arguments. Added for backward-compatibility
with `path` parameter. Should be removed during 6.x release
"""
+ from . import __version__
if opts:
warnings.warn(
'Unsupported argument(s) provided: {}'.format(list(opts.keys())),
diff --git a/sendgrid/version.py b/sendgrid/version.py
deleted file mode 100644
index c191754f8..000000000
--- a/sendgrid/version.py
+++ /dev/null
@@ -1,2 +0,0 @@
-version_info = (5, 4, 1)
-__version__ = '.'.join(str(v) for v in version_info)
diff --git a/setup.py b/setup.py
index 2720ec461..7dde1f656 100644
--- a/setup.py
+++ b/setup.py
@@ -1,32 +1,32 @@
+import io
import os
-from io import open
+from distutils.file_util import copy_file
from setuptools import setup, find_packages
-__version__ = None
-with open('sendgrid/version.py') as f:
- exec(f.read())
-
-long_description = 'Please see our GitHub README'
-if os.path.exists('README.txt'):
- long_description = open('README.txt', 'r', encoding='utf-8').read()
-
def getRequires():
deps = ['python_http_client>=3.0']
return deps
+dir_path = os.path.abspath(os.path.dirname(__file__))
+readme = io.open(os.path.join(dir_path, 'README.rst'), encoding='utf-8').read()
+version = io.open(os.path.join(dir_path, 'VERSION.txt'), encoding='utf-8').read().strip()
+copy_file(os.path.join(dir_path, 'VERSION.txt'),
+ os.path.join(dir_path, 'sendgrid', 'VERSION.txt'),
+ verbose=0)
+
setup(
name='sendgrid',
- version=str(__version__),
+ version=version,
author='Elmer Thomas, Yamil Asusta',
author_email='dx@sendgrid.com',
url='https://github.com/sendgrid/sendgrid-python/',
- packages=find_packages(exclude=["temp*.py", "register.py", "test"]),
+ packages=find_packages(exclude=["temp*.py", "test"]),
include_package_data=True,
license='MIT',
description='SendGrid library for Python',
- long_description=long_description,
+ long_description=readme,
install_requires=getRequires(),
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
classifiers=[
diff --git a/test/test_project.py b/test/test_project.py
index a0b87908a..340388af6 100644
--- a/test/test_project.py
+++ b/test/test_project.py
@@ -56,9 +56,9 @@ def test_license(self):
def test_pr_template(self):
self.assertTrue(os.path.isfile('./.github/PULL_REQUEST_TEMPLATE'))
- # ./README.md
+ # ./README.rst
def test_readme(self):
- self.assertTrue(os.path.isfile('./README.md'))
+ self.assertTrue(os.path.isfile('./README.rst'))
# ./TROUBLESHOOTING.md
def test_troubleshooting(self):
@@ -68,6 +68,10 @@ def test_troubleshooting(self):
def test_usage(self):
self.assertTrue(os.path.isfile('./USAGE.md'))
+ # ./VERSION.txt
+ def test_usage(self):
+ self.assertTrue(os.path.isfile('./VERSION.txt'))
+
# ./use-cases/README.md
def test_use_cases(self):
self.assertTrue(os.path.isfile('./use_cases/README.md'))
diff --git a/test/test_sendgrid.py b/test/test_sendgrid.py
index 214eb2de9..78976edb0 100644
--- a/test/test_sendgrid.py
+++ b/test/test_sendgrid.py
@@ -1,6 +1,5 @@
import sendgrid
from sendgrid.helpers.mail import *
-from sendgrid.version import __version__
import os
import datetime
import unittest
@@ -95,7 +94,7 @@ def test_impersonate_subuser_init(self):
self.assertEqual(sg_impersonate.impersonate_subuser, temp_subuser)
def test_useragent(self):
- useragent = '{}{}{}'.format('sendgrid/', __version__, ';python')
+ useragent = '{}{}{}'.format('sendgrid/', sendgrid.__version__, ';python')
self.assertEqual(self.sg.useragent, useragent)
def test_host(self):