Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .codeclimate.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish Python distributions
on:
push:
tags:
- '*'
workflow_dispatch:

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout sendgrid-python
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.6'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}

notify-on-failure:
name: Slack notify on failure
if: ${{ failure() }}
needs: [ release ]
runs-on: ubuntu-latest
steps:
- uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: 'danger'
SLACK_ICON_EMOJI: ':github:'
SLACK_MESSAGE: ${{ format('Failed to release {1}{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }}
SLACK_TITLE: Release Failure
SLACK_USERNAME: GitHub Actions
SLACK_MSG_AUTHOR: twilio-dx
SLACK_FOOTER: Posted automatically using GitHub Actions
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
MSG_MINIMAL: true
50 changes: 50 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Run Tests
on:
push:
branches: [ '*' ]
pull_request:
branches: [ main ]
schedule:
# Run automatically at 8AM PST Monday-Friday
- cron: '0 15 * * 1-5'
workflow_dispatch:

jobs:
tests:
name: Run Tests
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
python-version: [ '2.7', '3.5', '3.6', '3.7', '3.8', '3.9' ]
steps:
- name: Checkout sendgrid-python
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Build & Test
run: make test-docker test-install

notify-on-failure:
name: Slack notify on failure
if: ${{ failure() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
needs: [ tests ]
runs-on: ubuntu-latest
steps:
- uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: 'danger'
SLACK_ICON_EMOJI: ':github:'
SLACK_MESSAGE: ${{ format('Failed running build on {1}{3} {0}/{1}/actions/runs/{2}', github.server_url, github.repository, github.run_id, ':') }}
SLACK_TITLE: Build Failure
SLACK_USERNAME: GitHub Actions
SLACK_MSG_AUTHOR: twilio-dx
SLACK_FOOTER: Posted automatically using GitHub Actions
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
MSG_MINIMAL: true
46 changes: 0 additions & 46 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

venv: clean
@python --version || (echo "Python is not installed, please install Python 2 or Python 3"; exit 1);
pip install virtualenv
virtualenv --python=python venv

install: venv
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
![SendGrid Logo](twilio_sendgrid_logo.png)

[![Travis Badge](https://travis-ci.com/sendgrid/sendgrid-python.svg?branch=main)](https://travis-ci.com/sendgrid/sendgrid-python)
[![codecov](https://img.shields.io/codecov/c/github/sendgrid/sendgrid-python/main.svg?style=flat-square&label=Codecov+Coverage)](https://codecov.io/gh/sendgrid/sendgrid-python)
[![Tests](https://github.com/sendgrid/sendgrid-python/actions/workflows/tests.yml/badge.svg)](https://github.com/sendgrid/sendgrid-python/actions/workflows/tests.yml)
[![Docker Badge](https://img.shields.io/docker/automated/sendgrid/sendgrid-python.svg)](https://hub.docker.com/r/sendgrid/sendgrid-python/)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@



|Travis Badge| |codecov| |Python Versions| |PyPI Version| |Docker Badge| |Email Notifications Badge| |MIT licensed| |Twitter Follow| |GitHub contributors| |Open Source Helpers|
|Tests Badge| |codecov| |Python Versions| |PyPI Version| |Docker Badge| |Email Notifications Badge| |MIT licensed| |Twitter Follow| |GitHub contributors| |Open Source Helpers|

**This library allows you to quickly and easily use the Twilio SendGrid Web API v3 via Python.**

Expand Down Expand Up @@ -288,8 +288,8 @@ License
.. _troubleshooting guide: https://github.com/sendgrid/sendgrid-python/blob/HEAD/TROUBLESHOOTING.md
.. _The MIT License (MIT): https://github.com/sendgrid/sendgrid-python/blob/HEAD/LICENSE

.. |Travis Badge| image:: https://travis-ci.com/sendgrid/sendgrid-python.svg?branch=main
:target: https://travis-ci.com/sendgrid/sendgrid-python
.. |Tests Badge| image:: https://github.com/sendgrid/sendgrid-python/actions/workflows/test.yml/badge.svg
:target: https://github.com/sendgrid/sendgrid-python/actions/workflows/test.yml
.. |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
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Flask==1.0.2
Flask==1.1.2
PyYAML>=4.2b1
python-http-client>=3.2.1
six==1.11.0
Expand Down
8 changes: 0 additions & 8 deletions test/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ def test_env(self):
def test_gitignore(self):
self.assertTrue(os.path.isfile('./.gitignore'))

# ./.travis.yml
def test_travis(self):
self.assertTrue(os.path.isfile('./.travis.yml'))

# ./.codeclimate.yml
def test_codeclimate(self):
self.assertTrue(os.path.isfile('./.codeclimate.yml'))

# ./CHANGELOG.md
def test_changelog(self):
self.assertTrue(os.path.isfile('./CHANGELOG.md'))
Expand Down
4 changes: 2 additions & 2 deletions test/test_sendgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -1649,14 +1649,14 @@ def test_suppression_invalid_emails__email__delete(self):
def test_suppression_spam_report__email__get(self):
email = "test_url_param"
headers = {'X-Mock': 200}
response = self.sg.client.suppression.spam_report._(
response = self.sg.client.suppression.spam_reports._(
email).get(request_headers=headers)
self.assertEqual(response.status_code, 200)

def test_suppression_spam_report__email__delete(self):
email = "test_url_param"
headers = {'X-Mock': 204}
response = self.sg.client.suppression.spam_report._(
response = self.sg.client.suppression.spam_reports._(
email).delete(request_headers=headers)
self.assertEqual(response.status_code, 204)

Expand Down