Skip to content

Commit

Permalink
Drop support for Python 2.6 and 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ob-stripe committed Feb 19, 2018
1 parent 689baae commit 7230947
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 76 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ sudo: false
language: python

python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "3.6"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Install from source with:

### Requirements

* Python 2.6+ or Python 3.3+ (PyPy supported)
* Python 2.7+ or Python 3.4+ (PyPy supported)

## Usage

Expand Down
22 changes: 0 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,13 @@

install_requires = []

if sys.version_info < (2, 6):
warnings.warn(
'Python 2.5 is no longer officially supported by Stripe. '
'If you have any questions, please file an issue on Github or '
'contact us at [email protected].',
DeprecationWarning)
install_requires.append('requests >= 0.8.8, < 0.10.1')
install_requires.append('ssl')
else:
install_requires.append('requests >= 0.8.8')


with open('LONG_DESCRIPTION.rst') as f:
long_description = f.read()

# Don't import stripe module here, since deps may not be installed
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'stripe'))
from version import VERSION

# Get simplejson if we don't already have json
if sys.version_info < (3, 0):
try:
from util import json
except ImportError:
install_requires.append('simplejson')


setup(
name='stripe',
version=VERSION,
Expand All @@ -61,10 +41,8 @@
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
Expand Down
18 changes: 0 additions & 18 deletions stripe/importer.py

This file was deleted.

35 changes: 3 additions & 32 deletions stripe/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

import hmac
import io
import json
import logging
import sys
import os
import re

import stripe
from stripe import six
from stripe.six.moves.urllib.parse import parse_qsl


STRIPE_LOG = os.environ.get('STRIPE_LOG')

Expand All @@ -25,38 +28,6 @@
'logfmt',
]

try:
from stripe.six.moves.urllib.parse import parse_qsl
except ImportError:
# Python < 2.6
from cgi import parse_qsl

try:
import json
except ImportError:
json = None

if not (json and hasattr(json, 'loads')):
try:
import simplejson as json
except ImportError:
if not json:
raise ImportError(
"Stripe requires a JSON library, such as simplejson. "
"HINT: Try installing the "
"python simplejson library via 'pip install simplejson' or "
"'easy_install simplejson', or contact [email protected] "
"with questions.")
else:
raise ImportError(
"Stripe requires a JSON library with the same interface as "
"the Python 2.6 'json' library. You appear to have a 'json' "
"library with a different interface. Please install "
"the simplejson library. HINT: Try installing the "
"python simplejson library via 'pip install simplejson' "
"or 'easy_install simplejson', or contact [email protected]"
"with questions.")


def utf8(value):
# Note the ordering of these conditionals: `unicode` isn't a symbol in
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# and then run "tox" from this directory.

[tox]
envlist = py26, py27, pypy, pypy3.3-5.2-alpha1, py33, py34, py35, py36
envlist = py27, py34, py35, py36, pypy, pypy3

[testenv]
deps =
Expand Down

0 comments on commit 7230947

Please sign in to comment.