Skip to content

Commit f265172

Browse files
hugovksoftvar
authored andcommitted
Add support for Python 3.6-3.7, drop support for 2.6 and 3.4 (#44)
* Drop support for EOL Python 2.6 and 3.4 * Add python_requires to help pip * Add support for Python 3.6 and 3.7 * Test on Python 3.8 beta
1 parent 63741a4 commit f265172

File tree

5 files changed

+20
-27
lines changed

5 files changed

+20
-27
lines changed

.travis.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
language: python
22
python:
3-
- "2.6"
43
- "2.7"
5-
- "3.4"
64
- "3.5"
7-
8-
# command to install dependencies
9-
install: "pip install ordereddict simplejson"
5+
- "3.6"
6+
- "3.7"
7+
- "3.8-dev"
108

119
# command to run tests
1210
script: cd test/ && python run_tests.py

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ Tests
203203
cd test/
204204
python run_tests.py
205205
206-
Tested with Python 2.6, 2.7 3.4, and 3.5.
206+
Tested with Python 2.7 and 3.5+.
207207

208208
Contributors
209209
------------

json2html/jsonconv.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,8 @@
1919

2020
import sys
2121

22-
if sys.version_info[:2] < (2, 7):
23-
from ordereddict import OrderedDict
24-
import simplejson as json_parser
25-
else:
26-
from collections import OrderedDict
27-
import json as json_parser
22+
from collections import OrderedDict
23+
import json as json_parser
2824

2925
if sys.version_info[:2] < (3, 0):
3026
from cgi import escape as html_escape

setup.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
import sys
21
from setuptools import setup
32

4-
required = []
5-
6-
7-
if sys.version_info[:2] < (2,7):
8-
required.append('simplejson')
9-
required.append('ordereddict')
103

114
setup(
125
name = 'json2html',
136
packages = ['json2html'],
147
version = '1.3.0',
15-
install_requires=required,
168
description = 'JSON to HTML Table Representation',
179
long_description=open('README.rst').read(),
1810
author = 'Varun Malhotra',
@@ -21,6 +13,14 @@
2113
download_url = 'https://github.com/softvar/json2html/tarball/1.3.0',
2214
keywords = ['json', 'HTML', 'Table'],
2315
license = 'MIT',
24-
classifiers = (
25-
),
16+
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*',
17+
classifiers = [
18+
'Programming Language :: Python :: 2',
19+
'Programming Language :: Python :: 2.7',
20+
'Programming Language :: Python :: 3',
21+
'Programming Language :: Python :: 3.5',
22+
'Programming Language :: Python :: 3.6',
23+
'Programming Language :: Python :: 3.7',
24+
'Programming Language :: Python :: Implementation :: CPython',
25+
],
2626
)

test/run_tests.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,10 @@ def test_empty_json(self, *args, **kwargs):
5252
)
5353

5454
def test_invalid_json_exception(self, *args, **kwargs):
55-
if sys.version_info[:2] >= (2, 7): #Python below 2.7 doesn't have assertRaises, ommitting these tests
56-
_json = "{'name'}"
57-
with self.assertRaises(ValueError) as context:
58-
json2html.convert(json = _json)
59-
self.assertIn('Expecting property name', str(context.exception))
55+
_json = "{'name'}"
56+
with self.assertRaises(ValueError) as context:
57+
json2html.convert(json = _json)
58+
self.assertIn('Expecting property name', str(context.exception))
6059

6160
def test_funky_objects(self):
6261
class objecty_class1(object):

0 commit comments

Comments
 (0)