Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: prep the repo for automated releasing #862

Merged
merged 4 commits into from
Jan 16, 2020
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
68 changes: 24 additions & 44 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ language: python
sudo: false
cache: pip
python:
- '2.7'
- '3.4'
- '3.5'
- '3.6'
- '2.7'
- '3.5'
- '3.6'
# Enable 3.7 without globally enabling sudo and dist: xenial for other build jobs
matrix:
include:
Expand All @@ -14,47 +13,28 @@ matrix:
sudo: true
env:
global:
- CC_TEST_REPORTER_ID=$TRAVIS_CODE_CLIMATE_TOKEN
- CC_TEST_REPORTER_ID=$TRAVIS_CODE_CLIMATE_TOKEN SENDGRID_API_KEY=SGAPIKEY
childish-sambino marked this conversation as resolved.
Show resolved Hide resolved
install:
- python setup.py install
- pip install pyyaml
- pip install flask
- pip install six
- pip install coverage
- pip install codecov
# - sudo apt-get install -y pandoc
addons:
apt_packages:
- pandoc
- python setup.py install
- pip install pyyaml flask six coverage codecov
before_script:
- "./test/prism.sh &"
- sleep 20
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
- "./test/prism.sh &"
- sleep 20
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
- coverage run -m unittest discover
- coverage run -m unittest discover
after_script:
- codecov
- ./cc-test-reporter after-build --exit-code $?
# deploy:
# provider: pypi
# user: thinkingserious
# password:
# secure: DoM21KiMKkt/7AS6zOqTs7j3fgInrpswRTPG3cqBNRSzyfkXeXmKecCPruooxvYKLM7fPNDOuIH2phgCjdx/XBtJwghNh34n+TzhNFEiI/6pV0iS4a9gW0+QU+GMYvQmfNlA9DKQ5N20FMy4XeK8QQFarJXQwW1/a5wWftbUYvQ=
# skip_cleanup: true
# distributions: sdist bdist_wheel
# on:
# tags: true
# python: '3.6'
notifications:
hipchat:
rooms:
secure: Lo3L/YNWpn9ulGX4D2HlWrBOyxMPlLkFcwxbYViG69Ta6BV+c6YE+Pct43tExlL6sZ+nj5p8X4KRTeOM4sqASrebWA25nyUrNTm+vZYFbi5XfmGvvi8TEsgg0MYRQRWWn/R2z0kZW/fqOY6sqJuoIafMBmC3tayTJRiH1Ct2Cw0=
template:
- '<a href="https://travis-ci.org/%{repository}/builds/%{build_id}">%{repository}
Build %{build_number}</a> on branch <i>%{branch}</i> by %{author}: <strong>%{message}</strong>
<a href="https://github.com/%{repository}/commits/%{commit}">View on
GitHub</a>'
format: html
notify: false
- codecov
- ./cc-test-reporter after-build --exit-code $?
deploy:
provider: pypi
user: __token__
password:
secure: $PYPI_TOKEN
skip_cleanup: true
distributions: sdist bdist_wheel
on:
tags: true
python: '3.6'
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Change Log
All notable changes to this project will be documented in this file.

## [6.1.0] - 2019-09-12 ##
[2019-09-12] Version 6.1.0
---------------------------

### Added
- Bumped dependency on python-http-client to [v3.2.1](https://github.com/sendgrid/python-http-client/releases/tag/v3.2.0)
Expand Down
4 changes: 3 additions & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Copyright (c) 2012-2019 Twilio SendGrid, Inc.
The MIT License (MIT)

Copyright (c) 2012-2020 Twilio 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
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.PHONY: venv install test-install test clean nopyc

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

install: venv
. venv/bin/activate; python setup.py install
. venv/bin/activate; pip install -r requirements.txt

test:
. venv/bin/activate; python -m unittest discover -v

clean: nopyc
rm -rf venv

nopyc:
find . -name \*.pyc -delete
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. image:: https://github.com/sendgrid/sendgrid-python/raw/master/twilio_sendgrid_logo.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|
Expand Down Expand Up @@ -46,7 +46,7 @@ Installation
Prerequisites
-------------

- Python version 2.7 and 3.4+
- Python version 2.7 and 3.5+
- For email, you will need a Twilio SendGrid account, starting at the `free level`_
- For SMS messages, you will need a free `Twilio account`_

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Flask==1.0.2
PyYAML>=4.2b1
python-http-client==3.1.0
python-http-client>=3.2.1
six==1.11.0
pytest==3.8.2
3 changes: 1 addition & 2 deletions sendgrid/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
version_info = (6, 1, 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if clients used version_info at all.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was used to build __version__ (don't know why though), which is used here: https://github.com/sendgrid/sendgrid-python/blob/master/setup.py#L21

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, need to update this:

if sys.version_info[:3] >= (3, 5, 0):

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thinkingserious sys.version_info returns the separated python version information. It seemed like it was only used to build the __version__ number in version.py, per your previous comment.

__version__ = '.'.join(str(v) for v in version_info)
__version__ = '6.1.0'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def getRequires():
description='Twilio SendGrid library for Python',
long_description=readme,
install_requires=getRequires(),
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*',
classifiers=[
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
Expand Down
8 changes: 6 additions & 2 deletions test/test_sendgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ def test_ips_get(self):
data = response.body
unused = unassigned(data)
self.assertEqual(type(unused), list)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.status_code, 200)

def test_ips_assigned_get(self):
headers = {'X-Mock': 200}
Expand Down Expand Up @@ -2305,8 +2305,12 @@ def test_whitelabel_links__link_id__subuser_post(self):

def test_license_year(self):
LICENSE_FILE = 'LICENSE.txt'
copyright_line=''
with open(LICENSE_FILE, 'r') as f:
copyright_line = f.readline().rstrip()
for line in f:
if line.startswith('Copyright'):
copyright_line = line.strip()
break
self.assertEqual(
'Copyright (c) 2012-%s Twilio SendGrid, Inc.' % datetime.datetime.now().year,
copyright_line)
Expand Down