Skip to content

Commit

Permalink
clean up merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
codevbus committed Oct 22, 2017
2 parents 938b7e5 + db608f7 commit 87e84b7
Show file tree
Hide file tree
Showing 18 changed files with 303 additions and 108 deletions.
4 changes: 4 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[run]
branch = True
source = sendgrid
omit = site-packages
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
bin/
env/
include/
lib/
.Python
Expand All @@ -15,4 +16,9 @@ venv/
.tox/
profile*
README.txt
temp*.py
temp*.py
.coverage
coverage.xml
htmlcov
temp*.py
sendgrid.env
14 changes: 8 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,25 @@ python:
- '3.5'
- '3.6'
install:
- if [[ $TRAVIS_PYTHON_VERSION == 2.6* ]]; then pip install unittest2; fi
- python setup.py 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
addons:
apt_packages:
- pandoc
before_script:
- mkdir prism
- mkdir prism/bin
- export PATH=$PATH:$PWD/prism/bin/
- ./test/prism.sh
- . ./test/prism.sh
- prism version
script:
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then unit2 discover; else python -m unittest
discover; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then coverage run -m unittest2 discover; else coverage run -m unittest discover; fi
after_script:
- codecov
before_deploy:
- python ./register.py
deploy:
Expand Down
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Change Log
All notable changes to this project will be documented in this file.

## [5.2.1] - 2017-10-21 ##
### Fixed
- Pull #364: Install prism with non superuser account
- Big thanks to [meahow](https://github.com/meahow) for the pull request!

## [5.2.0] - 2017-08-31 ##
### Added
- Pull #335: Permit unicode string values with Substitution helper
Expand Down Expand Up @@ -41,7 +46,7 @@ All notable changes to this project will be documented in this file.
### BREAKING CHANGE
- Pull #244 [refactor helpers using property getter/setter](https://github.com/sendgrid/sendgrid-python/pull/244/files)
- Big thanks to [Denis Vlasov](https://github.com/denis90) for the pull request!
- The changes break the impelmentation of the [Mail Helper](https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/mail) `Mail()` class
- The changes break the implementation of the [Mail Helper](https://github.com/sendgrid/sendgrid-python/tree/master/sendgrid/helpers/mail) `Mail()` class
- `set_from()` is now the property `from_email`
- `set_subject()` is now the property `subject`
- `set_template_id()` is now the property `template_id`
Expand Down Expand Up @@ -299,7 +304,7 @@ All notable changes to this project will be documented in this file.
## [1.5.9] - 2015-10-26 ##

### Added ###
- Supression Unsubscribes [GET]
- Suppression Unsubscribes [GET]

## [1.5.8] - 2015-10-21 ##

Expand Down Expand Up @@ -332,7 +337,7 @@ All notable changes to this project will be documented in this file.
### Added ###
- Refactored tests and added Tox support
- Framework for Web API v3 endpoints
- Web API v3 endpionts: apikeys, ASM groups and ASM suppressions
- Web API v3 endpoints: apikeys, ASM groups and ASM suppressions

### Fixed ###
- Python 3 Fix [#126](https://github.com/sendgrid/sendgrid-python/issues/126)
Expand Down
41 changes: 41 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# SendGrid Community Code of Conduct

The SendGrid open source community is made up of members from around the globe with a diverse set of skills, personalities, and experiences. It is through these differences that our community experiences successes and continued growth. When you're working with members of the community, we encourage you to follow these guidelines, which help steer our interactions and strive to maintain a positive, successful and growing community.

### Be Open
Members of the community are open to collaboration, whether it's on pull requests, code reviews, approvals, issues or otherwise. We're receptive to constructive comments and criticism, as the experiences and skill sets of all members contribute to the whole of our efforts. We're accepting of all who wish to take part in our activities, fostering an environment where anyone can participate, and everyone can make a difference.

### Be Considerate
Members of the community are considerate of their peers, which include other contributors and users of SendGrid. We're thoughtful when addressing the efforts of others, keeping in mind that often the labor was completed with the intent of the good of the community. We're attentive in our communications, whether in person or online, and we're tactful when approaching differing views.

### Be Respectful
Members of the community are respectful. We're respectful of others, their positions, their skills, their commitments and their efforts. We're respectful of the volunteer efforts that permeate the SendGrid community. We're respectful of the processes outlined in the community, and we work within them. When we disagree, we are courteous in raising our issues. Overall, we're good to each other. We contribute to this community not because we have to, but because we want to. If we remember that, these guidelines will come naturally.

## Additional Guidance

### Disclose Potential Conflicts of Interest
Community discussions often involve interested parties. We expect participants to be aware when they are conflicted due to employment or other projects they are involved in and disclose those interests to other project members. When in doubt, over-disclose. Perceived conflicts of interest are important to address so that the community’s decisions are credible even when unpopular, difficult or favorable to the interests of one group over another.

### Interpretation
This Code is not exhaustive or complete. It is not a rulebook; it serves to distill our common understanding of a collaborative, shared environment and goals. We expect it to be followed in spirit as much as in the letter. When in doubt, try to abide by [SendGrid’s cultural values](https://sendgrid.com/blog/employee-engagement-the-4h-way) defined by our “4H’s”: Happy, Hungry, Humble and Honest.

### Enforcement
Most members of the SendGrid community always comply with this Code, not because of the existence of this Code, but because they have long experience participating in open source communities where the conduct described above is normal and expected. However, failure to observe this Code may be grounds for suspension, reporting the user for abuse or changing permissions for outside contributors.

## If you have concerns about someone’s conduct
**Initiate Direct Contact** - It is always appropriate to email a community member (if contact information is available), mention that you think their behavior was out of line, and (if necessary) point them to this Code.

**Discuss Publicly** - Discussing publicly is always acceptable. Note, though, that approaching the person directly may be better, as it tends to make them less defensive, and it respects the time of other community members, so you probably want to try direct contact first.

**Contact the Moderators** - You can reach the SendGrid moderators by emailing [email protected].

## Submission to SendGrid Repositories
Finally, just a reminder, changes to the SendGrid repositories will only be accepted upon completion of the [SendGrid Contributor Agreement](https://cla.sendgrid.com).

## Attribution

SendGrid thanks the following, on which it draws for content and inspiration:

[Python Community Code of Conduct](https://www.python.org/psf/codeofconduct/)
[Open Source Initiative General Code of Conduct](https://opensource.org/codeofconduct)
[Apache Code of Conduct](https://www.apache.org/foundation/policies/conduct.html)
33 changes: 18 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ Hello! Thank you for choosing to help contribute to one of the SendGrid open sou

- [CLAs and CCLAs](#cla)
- [Roadmap & Milestones](#roadmap)
- [Feature Request](#feature_request)
- [Submit a Bug Report](#submit_a_bug_report)
- [Improvements to the Codebase](#improvements_to_the_codebase)
- [Understanding the Code Base](#understanding_the_codebase)
- [Feature Request](#feature-request)
- [Submit a Bug Report](#submit-a-bug-report)
- [Improvements to the Codebase](#improvements-to-the-codebase)
- [Understanding the Code Base](#understanding-the-codebase)
- [Testing](#testing)
- [Style Guidelines & Naming Conventions](#style_guidelines_and_naming_conventions)
- [Creating a Pull Request](#creating_a_pull_request)
- [Style Guidelines & Naming Conventions](#style-guidelines-and-naming-conventions)
- [Creating a Pull Request](#creating-a-pull-request)

<a name="roadmap"></a>
We use [Milestones](https://github.com/sendgrid/sendgrid-python/milestones) to help define current roadmaps, please feel free to grab an issue from the current milestone. Please indicate that you have begun work on it to avoid collisions. Once a PR is made, community review, comments, suggestions and additional PRs are welcomed and encouraged.
Expand All @@ -26,7 +26,7 @@ When you create a Pull Request, after a few seconds, a comment will appear with

There are a few ways to contribute, which we'll enumerate below:

<a name="feature_request"></a>
<a name="feature-request"></a>
## Feature Request

If you'd like to make a feature request, please read this section.
Expand All @@ -36,7 +36,7 @@ The GitHub issue tracker is the preferred channel for library feature requests,
- Please **search for existing issues** in order to ensure we don't have duplicate bugs/feature requests.
- Please be respectful and considerate of others when commenting on issues

<a name="submit_a_bug_report"></a>
<a name="submit-a-bug-report"></a>
## Submit a Bug Report

Note: DO NOT include your credentials in ANY code examples, descriptions, or media you make public.
Expand All @@ -53,15 +53,15 @@ Before you decide to create a new issue, please try the following:

In order to make the process easier, we've included a [sample bug report template]((https://github.com/sendgrid/sendgrid-python/.github/ISSUE_TEMPLATE)) (borrowed from [Ghost](https://github.com/TryGhost/Ghost/)). The template uses [GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown/) for formatting.

<a name="improvements_to_the_codebase"></a>
<a name="improvements-to-the-codebase"></a>
## Improvements to the Codebase

We welcome direct contributions to the sendgrid-python code base. Thank you!

### Development Environment ###

#### Using Docker ####
You can use our Docker image to avoid setting up the development environment yourself. See [USAGE.md](https://github.com/sendgrid/sendgrid-python/docker/USAGE.md).
You can use our Docker image to avoid setting up the development environment yourself. See [USAGE.md](https://github.com/sendgrid/sendgrid-python/blob/master/docker/USAGE.md).

#### Install and Run Locally ####

Expand Down Expand Up @@ -95,7 +95,7 @@ See the [examples folder](https://github.com/sendgrid/sendgrid-python/tree/maste

If testing from the root directory of this repo, create a new file (e.g. test.py) and replace `import sendgrid` with `from sendgrid import *`

<a name="understanding_the_codebase"></a>
<a name="understanding-the-codebase"></a>
## Understanding the Code Base

**/examples**
Expand Down Expand Up @@ -131,12 +131,15 @@ For Python 2.7.* and up:

All PRs require passing tests before the PR will be reviewed.

#### Prequisites: ####
#### Prerequisites: ####

The above local "Initial setup" is complete

* [pyenv](https://github.com/yyuu/pyenv)
* [tox](https://pypi.python.org/pypi/tox)
* [prism](https://github.com/stoplightio/prism) v0.6 - It should be available in your PATH, but unittest script
will try to install it locally if not found. Apart from PATH env variable it will check in `~/bin` and `/usr/local/bin`.
You can install by yourself it in user dir by calling `source test/prism.sh`.

#### Initial setup: ####

Expand All @@ -159,7 +162,7 @@ source venv/bin/activate
tox
```

<a name="style_guidelines_and_naming_conventions"></a>
<a name="style-guidelines-and-naming-conventions"></a>
## Style Guidelines & Naming Conventions

Generally, we follow the style guidelines as suggested by the official language. However, we ask that you conform to the styles that already exist in the library. If you wish to deviate, please explain your reasoning.
Expand All @@ -172,7 +175,7 @@ Please run your code through:
- [pylint](https://www.pylint.org/)
- [pep8](https://pypi.python.org/pypi/pep8)

## Creating a Pull Request<a name="creating_a_pull_request"></a>
## Creating a Pull Request<a name="creating-a-pull-request"></a>

1. [Fork](https://help.github.com/fork-a-repo/) the project, clone your fork,
and configure the remotes:
Expand Down Expand Up @@ -202,7 +205,7 @@ Please run your code through:

4. Commit your changes in logical chunks. Please adhere to these [git commit
message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
or your code is unlikely be merged into the main project. Use Git's
or your code is unlikely to be merged into the main project. Use Git's
[interactive rebase](https://help.github.com/articles/interactive-rebase)
feature to tidy up your commits before making them public.

Expand Down
33 changes: 22 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
![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://codecov.io/gh/meahow/sendgrid-python/branch/issue_251_coverage/graph/badge.svg)](https://codecov.io/gh/meahow/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).
**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.**

Expand All @@ -18,15 +26,16 @@ We appreciate your continued support, thank you!
# Table of Contents

* [Installation](#installation)
* [Quick Start](#quick_start)
* [Quick Start](#quick-start)
* [Processing Inbound Email](#inbound)
* [Usage](#usage)
* [Use Cases](#use_cases)
* [Use Cases](#use-cases)
* [Announcements](#announcements)
* [Roadmap](#roadmap)
* [How to Contribute](#contribute)
* [Troubleshooting](#troubleshooting)
* [About](#about)
* [License](#license)

<a name="installation"></a>
# Installation
Expand Down Expand Up @@ -56,7 +65,7 @@ pip install sendgrid

- [Python-HTTP-Client](https://github.com/sendgrid/python-http-client)

<a name="quick_start"></a>
<a name="quick-start"></a>
# Quick Start

## Hello Email
Expand Down Expand Up @@ -161,7 +170,7 @@ Please see [our helper](https://github.com/sendgrid/sendgrid-python/tree/master/
- [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)

<a name="use_cases"></a>
<a name="use-cases"></a>
# Use Cases

[Examples of common API use cases](https://github.com/sendgrid/sendgrid-python/blob/master/USE_CASES.md), such as how to send an email with a transactional template.
Expand All @@ -185,10 +194,10 @@ We encourage contribution to our libraries (you might even score some nifty swag

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://github.com/sendgrid/sendgrid-open-source-templates/tree/master/CONTRIBUTING.md#cla)
- [Improvements to the Codebase](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#improvements_to_the_codebase)
- [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)

<a name="troubleshooting"></a>
# Troubleshooting
Expand All @@ -202,4 +211,6 @@ sendgrid-python is guided and supported by the SendGrid [Developer Experience Te

sendgrid-python is maintained and funded by SendGrid, Inc. The names and logos for sendgrid-python are trademarks of SendGrid, Inc.

![SendGrid Logo](https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png)
<a name="license"></a>
# License
[The MIT License (MIT)](LICENSE.txt)
8 changes: 4 additions & 4 deletions TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,22 @@ In most cases we recommend you download the latest version of the library, but i

`pip install sendgrid==X.X.X`

If you are usring a [requirements file](https://pip.readthedocs.io/en/1.1/requirements.html), please use:
If you are using a [requirements file](https://pip.readthedocs.io/en/1.1/requirements.html), please use:

`sendgrid==X.X.X`

<a name="versions"></a>
## Versioning Convention

We follow the MAJOR.MINOR.PATCH versioning scheme as described by [SemVer.org](http://semver.org). Therefore, we recommend that you always pin (or vendor) the particular version you are working with to your code and never auto-update to the latest version. Especially when there is a MAJOR point release, since that is guarenteed to be a breaking change. Changes are documented in the [CHANGELOG](https://github.com/sendgrid/sendgrid-python/blob/master/CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-python/releases) section.
We follow the MAJOR.MINOR.PATCH versioning scheme as described by [SemVer.org](http://semver.org). Therefore, we recommend that you always pin (or vendor) the particular version you are working with to your code and never auto-update to the latest version. Especially when there is a MAJOR point release, since that is guaranteed to be a breaking change. Changes are documented in the [CHANGELOG](https://github.com/sendgrid/sendgrid-python/blob/master/CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-python/releases) section.

<a name="request-body"></a>
## Viewing the Request Body

When debugging or testing, it may be useful to exampine the raw request body to compare against the [documented format](https://sendgrid.com/docs/API_Reference/api_v3.html).
When debugging or testing, it may be useful to examine the raw request body to compare against the [documented format](https://sendgrid.com/docs/API_Reference/api_v3.html).

You can do this right before you call `response = sg.client.mail.send.post(request_body=mail.get())` like so:

```python
print mail.get()
```
```
Loading

0 comments on commit 87e84b7

Please sign in to comment.