Skip to content

Commit 79ec255

Browse files
committed
Drop support for EOL Python
1 parent 56a0ad0 commit 79ec255

File tree

15 files changed

+21
-74
lines changed

15 files changed

+21
-74
lines changed

.travis.yml

Lines changed: 1 addition & 3 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'
@@ -11,7 +10,6 @@ env:
1110
global:
1211
- CC_TEST_REPORTER_ID=$TRAVIS_CODE_CLIMATE_TOKEN
1312
install:
14-
- if [[ $TRAVIS_PYTHON_VERSION == 2.6* ]]; then pip install unittest2; fi
1513
- python setup.py install
1614
- pip install pyyaml
1715
- pip install flask
@@ -30,7 +28,7 @@ before_script:
3028
- chmod +x ./cc-test-reporter
3129
- ./cc-test-reporter before-build
3230
script:
33-
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then coverage run -m unittest2 discover; else coverage run -m unittest discover; fi
31+
- coverage run -m unittest discover
3432
after_script:
3533
- codecov
3634
- ./cc-test-reporter after-build --exit-code $?

CONTRIBUTING.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ You can use our Docker image to avoid setting up the development environment you
7070

7171
##### Prerequisites #####
7272

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

7676
##### Initial setup: #####
@@ -122,12 +122,6 @@ All test files are in the [`test`](https://github.com/sendgrid/sendgrid-python/t
122122

123123
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.
124124

125-
For Python 2.6.*:
126-
127-
`unit2 discover -v`
128-
129-
For Python 2.7.* and up:
130-
131125
`python -m unittest discover -v`
132126

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

151145
```
152-
pyenv install 2.6.9
153146
pyenv install 2.7.11
154147
pyenv install 3.4.3
155148
pyenv install 3.5.0
@@ -159,7 +152,7 @@ Make sure to change the current working directory to your local version of the r
159152
python setup.py install
160153
```
161154
```
162-
pyenv local 3.5.0 3.4.3 2.7.11 2.6.9
155+
pyenv local 3.5.0 3.4.3 2.7.11
163156
pyenv rehash
164157
```
165158

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ We appreciate your continued support, thank you!
4242

4343
## Prerequisites
4444

45-
- Python version 2.6, 2.7, 3.4, 3.5 or 3.6
45+
- Python version 2.7 and 3.4+
4646
- The SendGrid service, starting at the [free level](https://sendgrid.com/free?source=sendgrid-python)
4747

4848
## Setup Environment Variables

docker/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' \
2+
ENV PYTHON_VERSIONS='python2.7 python3.4 python3.5 python3.6' \
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

setup.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sys
21
import os
32
from io import open
43
from setuptools import setup, find_packages
@@ -14,10 +13,6 @@
1413

1514
def getRequires():
1615
deps = ['python_http_client>=3.0']
17-
if sys.version_info < (2, 7):
18-
deps.append('unittest2')
19-
elif (3, 0) <= sys.version_info < (3, 2):
20-
deps.append('unittest2py3k')
2116
return deps
2217

2318
setup(
@@ -32,11 +27,11 @@ def getRequires():
3227
description='SendGrid library for Python',
3328
long_description=long_description,
3429
install_requires=getRequires(),
30+
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
3531
classifiers=[
36-
'Programming Language :: Python :: 2.6',
32+
'Programming Language :: Python :: 2',
3733
'Programming Language :: Python :: 2.7',
38-
'Programming Language :: Python :: 3.2',
39-
'Programming Language :: Python :: 3.3',
34+
'Programming Language :: Python :: 3',
4035
'Programming Language :: Python :: 3.4',
4136
'Programming Language :: Python :: 3.5',
4237
'Programming Language :: Python :: 3.6'

test/test_app.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import os
2+
import unittest
23

34
from sendgrid.helpers.inbound.config import Config
45
from sendgrid.helpers.inbound.app import app
56

6-
try:
7-
import unittest2 as unittest
8-
except ImportError:
9-
import unittest
10-
117

128
class UnitTests(unittest.TestCase):
139

test/test_config.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import os
2+
import unittest
3+
24
import sendgrid.helpers.inbound.config
35
from sendgrid.helpers.inbound.config import Config
4-
try:
5-
import unittest2 as unittest
6-
except ImportError:
7-
import unittest
86

97

108
class UnitTests(unittest.TestCase):

test/test_email.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
# -*- coding: utf-8 -*-
2-
import json
2+
import unittest
33

44
from sendgrid.helpers.mail import (Email)
55

6-
try:
7-
import unittest2 as unittest
8-
except ImportError:
9-
import unittest
10-
116

127
class TestEmailObject(unittest.TestCase):
138

test/test_mail.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# -*- coding: utf-8 -*-
22
import json
3+
import unittest
34

45
from sendgrid.helpers.mail import (
56
ASM,
@@ -29,11 +30,6 @@
2930
ValidateAPIKey
3031
)
3132

32-
try:
33-
import unittest2 as unittest
34-
except ImportError:
35-
import unittest
36-
3733

3834
class UnitTests(unittest.TestCase):
3935

test/test_parse.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1+
import unittest
2+
13
from sendgrid.helpers.inbound.config import Config
24
from sendgrid.helpers.inbound.app import app
35

4-
try:
5-
import unittest2 as unittest
6-
except ImportError:
7-
import unittest
8-
96

107
class UnitTests(unittest.TestCase):
118

0 commit comments

Comments
 (0)