Skip to content

Commit 9196b9f

Browse files
Merge pull request #90 from hugovk/rm-eol
Drop support for EOL Python
2 parents a375b3f + 41d56fe commit 9196b9f

File tree

13 files changed

+37
-86
lines changed

13 files changed

+37
-86
lines changed

.github/PULL_REQUEST_TEMPLATE

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ We appreciate the effort for this pull request but before that please make sure
33

44

55
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!
6-
e.g.
6+
e.g.
77
Fixes #1
88
Closes #2
99
-->
10-
# Fixes #
10+
# Fixes #
1111

1212
### Checklist
1313
- [ ] I have made a material change to the repo (functionality, testing, spelling, grammar)
@@ -18,7 +18,7 @@ Closes #2
1818
- [ ] I have added in line documentation to the code I modified
1919

2020
### Short description of what this PR does:
21-
-
22-
-
21+
-
22+
-
2323

24-
If you have questions, please send an email to [Sendgrid](mailto:[email protected]), or file a Github Issue in this repository.
24+
If you have questions, please send an email to [SendGrid](mailto:[email protected]), or file a GitHub Issue in this repository.

.travis.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ language: python
22
sudo: false
33
cache: pip
44
python:
5-
- '2.6'
65
- '2.7'
76
- '3.4'
87
- '3.5'
@@ -18,19 +17,16 @@ before_install:
1817
- pip install pycodestyle
1918
install:
2019
- pip install codecov
21-
- if [[ "$TRAVIS_PYTHON_VERSION" == 2.6* ]]; then travis_retry pip install unittest2; fi
22-
- if [[ "$TRAVIS_PYTHON_VERSION" == 2.6* ]]; then travis_retry pip uninstall -y pbr; fi
23-
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.2" ]]; then travis_retry pip install coverage==3.7.1; fi
24-
- if [[ "$TRAVIS_PYTHON_VERSION" != "3.2" ]]; then travis_retry pip install coverage; fi
20+
- travis_retry pip install coverage
2521
- python setup.py install
2622
- pip install codecov
2723
script:
28-
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then coverage run -m unittest2 discover; else coverage run -m unittest discover; fi
24+
- coverage run -m unittest discover
2925
after_script:
3026
- codecov
3127
# Run pycodestyle
3228
- pycodestyle
33-
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then unit2 discover; else python -m unittest discover; fi
29+
- python -m unittest discover
3430
- coverage run tests/test_unit.py
3531
notifications:
3632
hipchat:

CONTRIBUTING.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ A software bug is a demonstrable issue in the code base. In order for us to diag
4747

4848
Before you decide to create a new issue, please try the following:
4949

50-
1. Check the Github issues tab if the identified issue has already been reported, if so, please add a +1 to the existing post.
50+
1. Check the GitHub issues tab if the identified issue has already been reported, if so, please add a +1 to the existing post.
5151
2. Update to the latest version of this code and check if issue has already been fixed
5252
3. Copy and fill in the Bug Report Template we have provided below
5353

@@ -66,7 +66,7 @@ We welcome direct contributions to the python-http-client code base. Thank you!
6666

6767
##### Prerequisites #####
6868

69-
- Python 2.6, 2.7 or 3.3+
69+
- Python 2.7 and 3.4+
7070
- There are no external dependencies
7171

7272
##### Initial setup: #####
@@ -112,14 +112,6 @@ All test files are in the [`tests`](https://github.com/sendgrid/python-http-clie
112112

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

115-
For Python 2.6.*:
116-
117-
```bash
118-
unit2 discover -v
119-
```
120-
121-
For Python 2.7.* and up:
122-
123115
```bash
124116
python -m unittest discover -v
125117
```
@@ -141,13 +133,12 @@ The above local "Initial setup" is complete
141133
Add `eval "$(pyenv init -)"` to your shell environment (.profile, .bashrc, etc) after installing tox, you only need to do this once.
142134

143135
```bash
144-
pyenv install 2.6.9
145136
pyenv install 2.7.11
146137
pyenv install 3.4.3
147138
pyenv install 3.5.2
148139
pyenv install 3.6.0
149140
python setup.py install
150-
pyenv local 3.6.0 3.5.2 3.4.3 2.7.8 2.6.9
141+
pyenv local 3.6.0 3.5.2 3.4.3 2.7.8
151142
pyenv rehash
152143
```
153144

@@ -229,4 +220,4 @@ If you have any additional questions, please feel free to [email](mailto:dx@send
229220

230221
<a name="code-reviews"></a>
231222
## Code Reviews
232-
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/).
223+
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/).

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM ubuntu:xenial
2-
ENV PYTHON_VERSIONS='python2.6 python2.7 python3.4 python3.5 python3.6 python3.7' \
2+
ENV PYTHON_VERSIONS='python2.7 python3.4 python3.5 python3.6 python3.7' \
33
OAI_SPEC_URL="https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/oai_stoplight.json"
44

55
# install testing versions of python, including old versions, from deadsnakes

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ If you are looking for the SendGrid API client library, please see [this repo](h
3131

3232
## Prerequisites
3333

34-
- Python version 2.6, 2.7, 3.4, 3.5 or 3.6
34+
- Python version 2.7 or 3.4+
3535

3636
## Install Package
3737

examples/live_sendgrid_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
host = "https://api.sendgrid.com"
66
api_key = os.environ.get('SENDGRID_API_KEY')
77
request_headers = {
8-
"Authorization": 'Bearer {0}'.format(api_key)
8+
"Authorization": 'Bearer {}'.format(api_key)
99
}
1010
version = 3 # we could also use client.version(3)
1111
client = python_http_client.Client(host=host,

python_http_client/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def _build_versioned_url(self, url):
102102
:type url: string
103103
:return: string
104104
"""
105-
return '{0}/v{1}{2}'.format(self.host, str(self._version), url)
105+
return '{}/v{}{}'.format(self.host, str(self._version), url)
106106

107107
def _build_url(self, query_params):
108108
"""Build the final URL to be passed to urllib
@@ -114,7 +114,7 @@ def _build_url(self, query_params):
114114
url = ''
115115
count = 0
116116
while count < len(self._url_path):
117-
url += '/{0}'.format(self._url_path[count])
117+
url += '/{}'.format(self._url_path[count])
118118
count += 1
119119

120120
# add slash
@@ -123,7 +123,7 @@ def _build_url(self, query_params):
123123

124124
if query_params:
125125
url_values = urlencode(sorted(query_params.items()), True)
126-
url = '{0}?{1}'.format(url, url_values)
126+
url = '{}?{}'.format(url, url_values)
127127

128128
if self._version:
129129
url = self._build_versioned_url(url)

setup.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sys
21
import os
32
from setuptools import setup
43

@@ -8,36 +7,27 @@
87
long_description = open('README.txt').read()
98

109

11-
def get_requires():
12-
deps = []
13-
if (2, 6) <= sys.version_info < (2, 7):
14-
deps.append('unittest2')
15-
return deps
16-
17-
1810
base_url = 'https://github.com/sendgrid/'
1911
version = '3.1.0'
2012
setup(
2113
name='python_http_client',
2214
version=version,
2315
author='Elmer Thomas',
2416
author_email='[email protected]',
25-
url='{0}python-http-client'.format(base_url),
26-
download_url='{0}python-http-client/tarball/{1}'.format(base_url, version),
17+
url='{}python-http-client'.format(base_url),
18+
download_url='{}python-http-client/tarball/{}'.format(base_url, version),
2719
packages=['python_http_client'],
2820
license='MIT',
2921
description='HTTP REST client, simplified for Python',
3022
long_description=long_description,
31-
install_requires=get_requires(),
3223
keywords=[
3324
'REST',
3425
'HTTP',
3526
'API'],
27+
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
3628
classifiers=[
37-
'Programming Language :: Python :: 2.6',
3829
'Programming Language :: Python :: 2.7',
39-
'Programming Language :: Python :: 3.2',
40-
'Programming Language :: Python :: 3.3',
30+
'Programming Language :: Python :: 3',
4131
'Programming Language :: Python :: 3.4',
4232
'Programming Language :: Python :: 3.5',
4333
'Programming Language :: Python :: 3.6'

tests/profile.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,13 @@ def run_tested_code(client, num_loops):
131131

132132
@timefunc
133133
def dynamic_version():
134-
local_path = '{0}/..'.format(os.path.abspath(os.path.dirname(__file__)))
134+
local_path = '{}/..'.format(os.path.abspath(os.path.dirname(__file__)))
135135
Config(local_path)
136136
api_key = os.environ.get('SENDGRID_API_KEY')
137137
request_headers = {
138138
'X-Mock': 200,
139139
'Content-Type': 'application/json',
140-
'Authorization': 'Bearer {0}'.format(api_key)
140+
'Authorization': 'Bearer {}'.format(api_key)
141141
}
142142
client = Client(host=os.environ.get('LOCAL_HOST'),
143143
request_headers=request_headers,
@@ -147,13 +147,13 @@ def dynamic_version():
147147

148148
@timefunc
149149
def static_version():
150-
local_path = '{0}/..'.format(os.path.abspath(os.path.dirname(__file__)))
150+
local_path = '{}/..'.format(os.path.abspath(os.path.dirname(__file__)))
151151
Config(local_path)
152152
api_key = os.environ.get('SENDGRID_API_KEY')
153153
request_headers = {
154154
'X-Mock': 200,
155155
'Content-Type': 'application/json',
156-
'Authorization': 'Bearer {0}'.format(api_key)
156+
'Authorization': 'Bearer {}'.format(api_key)
157157
}
158158
client = StaticClient(host=os.environ.get('LOCAL_HOST'),
159159
request_headers=request_headers,

tests/test_daterange.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import os
22
import time
3-
4-
try:
5-
import unittest2 as unittest
6-
except ImportError:
7-
import unittest
3+
import unittest
84

95

106
class DateRangeTest(unittest.TestCase):
@@ -19,5 +15,4 @@ def setUp(self):
1915
fh.close()
2016

2117
def test__daterange(self):
22-
self.assertTrue(self.pattern in self.licensefile)
23-
18+
self.assertIn(self.pattern, self.licensefile)

0 commit comments

Comments
 (0)