Skip to content

Commit

Permalink
Merge branch 'v4'
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkingserious committed Apr 3, 2019
2 parents 265b984 + 62ba6f1 commit 287d309
Show file tree
Hide file tree
Showing 123 changed files with 8,062 additions and 3,761 deletions.
7 changes: 3 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!--
We appreciate the effort for this pull request but before that please make sure you read the contribution guidelines given above, then fill out the blanks below.
We appreciate the effort for this pull request, but before that, please make sure you read the [contribution guidelines](https://github.com/sendgrid/sendgrid-python/blob/v4/CONTRIBUTING.md), and then fill out the blanks below.


Please enter each Issue number you are resolving in your PR after one of the following words [Fixes, Closes, Resolves]. This will auto-link these issues and close them when this PR is merged!
e.g.
Fixes #1
Closes #2
-->
# Fixes #
# Fixes #X

### Checklist
- [ ] I have made a material change to the repo (functionality, testing, spelling, grammar)
Expand All @@ -19,6 +19,5 @@ Closes #2

### Short description of what this PR does:
-
-

If you have questions, please send an email to [SendGrid](mailto:[email protected]), or file a GitHub Issue in this repository.
If you have questions, please send an email to [Twilio SendGrid](mailto:[email protected]), or file a GitHub Issue in this repository.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ README.txt
.coverage
coverage.xml
htmlcov
temp*.py
sendgrid.env
temp.py
.vscode

live_test.py
__pycache__
example.pdf
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@ language: python
sudo: false
cache: pip
python:
- '2.6'
- '2.7'
- '3.4'
- '3.5'
- '3.6'
# Enable 3.7 without globally enabling sudo and dist: xenial for other build jobs
matrix:
include:
- python: 3.7
dist: xenial
sudo: true
env:
global:
- CC_TEST_REPORTER_ID=$TRAVIS_CODE_CLIMATE_TOKEN
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
Expand All @@ -30,12 +33,10 @@ before_script:
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then coverage run -m unittest2 discover; else coverage run -m unittest discover; fi
- coverage run -m unittest discover
after_script:
- codecov
- ./cc-test-reporter after-build --exit-code $?
before_deploy:
- python ./register.py
deploy:
provider: pypi
user: thinkingserious
Expand Down
27 changes: 10 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
# Change Log
All notable changes to this project will be documented in this file.

## [5.6.0] - 2018-08-20 ##
### Added
- [PR #593](https://github.com/sendgrid/sendgrid-python/pull/593): Adds support for dynamic template data. Big thanks to [Slam](https://github.com/3lnc) for the PR! Also, big thanks to [Wojciech Bartosiak](https://github.com/wojtek-fliposports) for [PR #597](https://github.com/sendgrid/sendgrid-python/pull/597)!

## [5.5.0] - 2018-08-16 ##
### Added
- [PR #588](https://github.com/sendgrid/sendgrid-python/pull/588): Updates the Readme to include environment variable setup in windows. Big thanks to [Bhargav Chandaka](https://github.com/bchandaka) for the PR!
- [PR #599](https://github.com/sendgrid/sendgrid-python/pull/599): Updates the Readme to include additional API Key instruction. Big thanks to [Anshul Singhal](https://github.com/af4ro) for the PR!
- [PR #600](https://github.com/sendgrid/sendgrid-python/pull/600): Add CodeTriage Badge. Big thanks to [Anshul Singhal](https://github.com/af4ro) for the PR!
- [PR #601](https://github.com/sendgrid/sendgrid-python/pull/601): Readability improvements to CONTRIBUTING.md. Big thanks to [Anshul Singhal](https://github.com/af4ro) for the PR!
- [PR #604](https://github.com/sendgrid/sendgrid-python/pull/604): Readability improvements to CONTRIBUTING.md. Big thanks to [agnesjang98](https://github.com/agnesjang98) for the PR!

### Fixed
- [PR #595](https://github.com/sendgrid/sendgrid-python/pull/595): Change type of category in Mail.add_category from string to Category. Big thanks to [Phawin Khongkhasawan](https://github.com/lifez) for the PR!
- [PR #596](https://github.com/sendgrid/sendgrid-python/pull/596): Fix Docker build. Big thanks to [Phawin Khongkhasawan](https://github.com/lifez) for the PR!
- [PR #598](https://github.com/sendgrid/sendgrid-python/pull/598): Fix python3 print example in TROUBLESHOOTING.md. Big thanks to [Ryan Jarvis](https://github.com/Cabalist) for the PR!
- [PR #603](https://github.com/sendgrid/sendgrid-python/pull/603): Update TROUBLESHOOTING.md to link to correct use cases page. Big thanks to [James Purpura](https://github.com/jpurpura) for the PR!
## [6.0.0] - TBD

- https://github.com/sendgrid/sendgrid-python/pull/486
- https://github.com/sendgrid/sendgrid-python/pull/488
- https://github.com/sendgrid/sendgrid-python/pull/493
- https://github.com/sendgrid/sendgrid-python/pull/496
- https://github.com/sendgrid/sendgrid-python/pull/509
- https://github.com/sendgrid/sendgrid-python/pull/510
- https://github.com/sendgrid/sendgrid-python/pull/512
- https://github.com/sendgrid/sendgrid-python/pull/524

## [5.4.1] - 2018-06-26 ##
### Fixed
Expand Down
15 changes: 7 additions & 8 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 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.

Expand All @@ -18,7 +18,7 @@

### 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.

Expand All @@ -31,12 +31,11 @@

## 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/)<br>
[Open Source Initiative General Code of Conduct](https://opensource.org/codeofconduct) <br>
[Apache Code of Conduct](https://www.apache.org/foundation/policies/conduct.html) <br>

* [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)
47 changes: 29 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
Hello! Thank you for choosing to help contribute to one of the SendGrid open source libraries. There are many ways you can contribute and help is always welcome. We simply ask that you follow the following contribution policies.

- [CLAs and CCLAs](#cla)
- [Roadmap & Milestones](#roadmap)
- [CLAs and CCLAs](#clas-and-cclas)
- [Feature Request](#feature-request)
- [Submit a Bug Report](#submit-a-bug-report)
- [Please use our Bug Report Template](#please-use-our-bug-report-template)
- [Improvements to the Codebase](#improvements-to-the-codebase)
- [Understanding the Code Base](#understanding-the-codebase)
- [Development Environment](#development-environment)
- [There are two ways to get set up:](#there-are-two-ways-to-get-set-up)
- [1. Using Docker](#1-using-docker)
- [- OR -](#or)
- [2. Install and Run Locally](#2-install-and-run-locally)
- [Prerequisites](#prerequisites)
- [Initial setup:](#initial-setup)
- [Environment Variables](#environment-variables)
- [Execute:](#execute)
- [Understanding the Code Base](#understanding-the-code-base)
- [Testing](#testing)
- [Style Guidelines & Naming Conventions](#style-guidelines-and-naming-conventions)
- [Creating a Pull Request](#creating-a-pull-request)
- [Testing Multiple Versions of Python](#testing-multiple-versions-of-python)
- [Prerequisites:](#prerequisites)
- [Initial setup:](#initial-setup-1)
- [Execute:](#execute-1)
- [Style Guidelines & Naming Conventions](#style-guidelines--naming-conventions)
- [Creating a Pull Request<a name="creating-a-pull-request"></a>](#creating-a-pull-requesta-name%22creating-a-pull-request%22a)
- [Code Reviews](#code-reviews)

<a name="roadmap"></a>
Expand Down Expand Up @@ -70,7 +83,7 @@ You can use our Docker image to avoid setting up the development environment you

##### Prerequisites #####

- Python 2.6 through 3.6
- Python 2.7 and 3.4+
- [python_http_client](https://github.com/sendgrid/python-http-client)

##### Initial setup: #####
Expand All @@ -87,9 +100,14 @@ First, get your free SendGrid account [here](https://sendgrid.com/free?source=se
Next, update your environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys).

```bash
echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
echo "sendgrid.env" >> .gitignore
source ./sendgrid.env
cp .env_sample .env
```

Then edit `.env` and insert your API key.

```bash
# You do not need to do this when using Docker Compose
source .env
```

##### Execute: #####
Expand Down Expand Up @@ -122,12 +140,6 @@ All test files are in the [`test`](https://github.com/sendgrid/sendgrid-python/t

For the purposes of contributing to this repo, please update the [`test_sendgrid.py`](https://github.com/sendgrid/sendgrid-python/tree/master/test/test_sendgrid.py) file with unit tests as you modify the code.

For Python 2.6.*:

`unit2 discover -v`

For Python 2.7.* and up:

`python -m unittest discover -v`

### Testing Multiple Versions of Python
Expand All @@ -149,7 +161,6 @@ You can install it by yourself in user dir by calling `source test/prism.sh`.
Add ```eval "$(pyenv init -)"``` to your shell environment (.profile, .bashrc, etc) after installing tox, you only need to do this once.

```
pyenv install 2.6.9
pyenv install 2.7.11
pyenv install 3.4.3
pyenv install 3.5.0
Expand All @@ -159,7 +170,7 @@ Make sure to change the current working directory to your local version of the r
python setup.py install
```
```
pyenv local 3.5.0 3.4.3 2.7.11 2.6.9
pyenv local 3.5.0 3.4.3 2.7.11
pyenv rehash
```

Expand Down Expand Up @@ -242,4 +253,4 @@ If you have any additional questions, please feel free to [email](mailto:dx@send

<a name="code-reviews"></a>
## Code Reviews
If you can, please look at open PRs and review them. Give feedback and help us merge these PRs much faster! If you don't know how GitHub has some great [information on how to review a Pull Request](https://help.github.com/articles/about-pull-request-reviews/).
If you can, please look at open PRs and review them. Give feedback and help us merge these PRs much faster! If you don't know how, GitHub has some great [information on how to review a Pull Request](https://help.github.com/articles/about-pull-request-reviews/).
75 changes: 75 additions & 0 deletions FIRST_TIMERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
## Welcome to the SendGrid Open Source Community
If you are new to Open Source, you are at the right place to start with. Contributions are always encouraged & appreciated. Just follow the organisation's Contribution Policies & you are good to go.
## How to get Started?
- [Explore SendGrid](#explore)
- [Raise Issues(If Found Any)](#issues)
- [Setting up the Development Environment](#setup)
- [Proposing Change through a Pull Request](#pr)
- [Be Patient & Wait for reviews](#reviews)

<a name="explore"></a>
### Explore SendGrid
Step 1: Get yourself Access to SendGrid API Service absolutely free from [here](https://sendgrid.com/free/?source=sendgrid-python)\
Step 2: Get familiar with SendGrid Service
- Prerequisites are Python version 2.6, 2.7, 3.4, 3.5 or 3.6
- Set up your [SendGrid API Key](https://app.sendgrid.com/settings/api_keys) to your local workspace [using](https://github.com/sendgrid/sendgrid-python#setup-environment-variables)
- Install SendGrid to your workspace using `pip install sendgrid`
- Copy & Run few sample programs from [here](https://github.com/sendgrid/sendgrid-python#hello-email)


<a name="issues"></a>
### Raise Issues
SendGrid uses GitHub as the content management service so, all the issues related to the project be it some feature request or a bug report, all are reported at the [GitHub Issue Tracker](https://github.com/sendgrid/sendgrid-python/issues)\
Kindly make sure, to check for any duplicate issues raised by fellow contributors before opening a new issue. Be humble & polite while commenting on issues
- Feature Request\
In case you feel like something is missing or lacking in the API Service, feel free to share your views & opinions with the community
- Bug Report\
If you encounter any sort of bug or abnormal behavior, feel free to inform the community after performing the following checks:
- Update to the latest version & check if the bug persists
- Check the Issue Tracker for any similar bug report

Finally fill up the Bug Report Template & Open the Issue highlighting your encountered bug & detailed steps to regenerate the bug.

<a name="setup"></a>
### Setting up the Development Environment
- **Using Docker**\
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)

- **Setting up Locally**\
Step 1: Install the Prerequistes: Any Version of Python(2.6 through 3.6) & [python_http_client](https://github.com/sendgrid/python-http-client)\
Step 2: Get a local copy of repository using `git clone https://github.com/sendgrid/sendgrid-python.git`\
Step 3: Set your [SendGrid API Key](https://app.sendgrid.com/settings/api_keys) to your local workspace using\
`echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env`\
`echo "sendgrid.env" >> .gitignore`\
`source ./sendgrid.env`\
Step 4: The entire codebase consist of 3 major divisions
- **/examples** contains *Working examples that demonstrate usage*
- **/tests** contains *the unit and profiling tests*
- **/sendgrid** contains *the Web API v3 client ie sendgrid.py and other files*.


<a name="pr"></a>
## Proposing Change through a Pull Request
**Step 1:** Fork the project & Clone your fork using `git clone https://github.com/<USERNAME>/sendgrid-python.git`

**Step 2:** Reconfigure the remotes using `cd sendgrid-python` and `git remote add upstream https://github.com/sendgrid/sendgrid-python.git`

**Step 3:** Create a new branch for your modifications using `git checkout -b <topic-branch-name>`

**Step 4:** Commit the changes in logical chunks & add commit messages strictly following [this](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)

**Step 5:** Run all test locally, [for more info](https://github.com/sendgrid/sendgrid-python/blob/master/CONTRIBUTING.md#testing)

**Step 6:** Locally merge your the upstream development branch into your topic-branch using `git pull [--rebase] upstream master`

**Step 7:** Push the topic branch up to your fork using `git push origin <topic-branch-name>`

**Step 8:** Open a Pull Request with clear title and description against the master branch.

In case, you have additional questions, feel free to drop a [mail]([email protected]) or open an issue.

<a name="reviews"></a>
## Be Patient & Wait for Reviews
Kindly be patient & follow the suggestions as provided by the peer reviewers. Make required ammendments & changes to the PR as asked.

## [Explore New Issues to work upon](https://github.com/sendgrid/sendgrid-python/labels/difficulty%3A%20easy)
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2012-2018 SendGrid, Inc.
Copyright (c) 2012-2019 SendGrid, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -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 *
Loading

0 comments on commit 287d309

Please sign in to comment.