Skip to content

Commit 685a4ad

Browse files
committed
Remove Python 2.7 and 3.5
Signed-off-by: Gábor Lipták <[email protected]>
1 parent 98bd556 commit 685a4ad

18 files changed

+60
-122
lines changed

.travis.yml

-8
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ python:
66
- "3.8"
77
- "3.7"
88
- "3.6"
9-
- "3.5"
10-
- "2.7"
119

1210
matrix:
1311
allow_failures:
@@ -17,15 +15,9 @@ install:
1715
# We do this conditionally because it saves us some downloading if the
1816
# version is the same.
1917
- unset VIRTUAL_ENV
20-
# Python 3.4 and 2.7 need six installed before running setup.py
21-
- pip install six
2218
# Travis needs to update pip/setuptools
2319
- pip install --upgrade setuptools pip
2420
- pip install .
25-
- |
26-
if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
27-
pip install doit==0.29.0
28-
fi
2921
- pip install doit
3022
- doit install_test_deps
3123

appveyor.yml

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ image: Visual Studio 2019
66
# environment variables
77
environment:
88
matrix:
9-
- PYTHON: "C:\\Python35-x64"
109
- PYTHON: "C:\\Python36-x64"
1110
- PYTHON: "C:\\Python37-x64"
1211
- PYTHON: "C:\\Python38-x64"

docs/environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: nbval_docs
22
channels:
33
- conda-forge
44
dependencies:
5-
- python=3.5
5+
- python=3.8
66
- numpy
77
- matplotlib
88
- sphinx

docs/source/index.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@
588588
"name": "python",
589589
"nbconvert_exporter": "python",
590590
"pygments_lexer": "ipython3",
591-
"version": "3.5.1"
591+
"version": "3.8.6"
592592
}
593593
},
594594
"nbformat": 4,

issues/27/latex-example.ipynb

+6-12
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
{
1212
"cell_type": "code",
1313
"execution_count": 18,
14-
"metadata": {
15-
"collapsed": false
16-
},
14+
"metadata": {},
1715
"outputs": [],
1816
"source": [
1917
"import sympy\n",
@@ -33,9 +31,7 @@
3331
{
3432
"cell_type": "code",
3533
"execution_count": 19,
36-
"metadata": {
37-
"collapsed": false
38-
},
34+
"metadata": {},
3935
"outputs": [
4036
{
4137
"data": {
@@ -79,9 +75,7 @@
7975
{
8076
"cell_type": "code",
8177
"execution_count": 21,
82-
"metadata": {
83-
"collapsed": false
84-
},
78+
"metadata": {},
8579
"outputs": [
8680
{
8781
"data": {
@@ -106,9 +100,9 @@
106100
],
107101
"metadata": {
108102
"kernelspec": {
109-
"display_name": "Python [conda root]",
103+
"display_name": "Python 3",
110104
"language": "python",
111-
"name": "conda-root-py"
105+
"name": "python3"
112106
},
113107
"language_info": {
114108
"codemirror_mode": {
@@ -120,7 +114,7 @@
120114
"name": "python",
121115
"nbconvert_exporter": "python",
122116
"pygments_lexer": "ipython3",
123-
"version": "3.5.2"
117+
"version": "3.8.6"
124118
}
125119
},
126120
"nbformat": 4,

issues/7/tutorial_lib.ipynb

+9-23
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828
{
2929
"cell_type": "code",
3030
"execution_count": 4,
31-
"metadata": {
32-
"collapsed": false
33-
},
31+
"metadata": {},
3432
"outputs": [
3533
{
3634
"data": {
@@ -50,9 +48,7 @@
5048
{
5149
"cell_type": "code",
5250
"execution_count": 5,
53-
"metadata": {
54-
"collapsed": false
55-
},
51+
"metadata": {},
5652
"outputs": [
5753
{
5854
"data": {
@@ -72,9 +68,7 @@
7268
{
7369
"cell_type": "code",
7470
"execution_count": 6,
75-
"metadata": {
76-
"collapsed": false
77-
},
71+
"metadata": {},
7872
"outputs": [
7973
{
8074
"data": {
@@ -101,9 +95,7 @@
10195
{
10296
"cell_type": "code",
10397
"execution_count": 7,
104-
"metadata": {
105-
"collapsed": false
106-
},
98+
"metadata": {},
10799
"outputs": [
108100
{
109101
"name": "stdout",
@@ -133,9 +125,7 @@
133125
{
134126
"cell_type": "code",
135127
"execution_count": 8,
136-
"metadata": {
137-
"collapsed": false
138-
},
128+
"metadata": {},
139129
"outputs": [
140130
{
141131
"data": {
@@ -155,9 +145,7 @@
155145
{
156146
"cell_type": "code",
157147
"execution_count": 9,
158-
"metadata": {
159-
"collapsed": false
160-
},
148+
"metadata": {},
161149
"outputs": [
162150
{
163151
"data": {
@@ -177,9 +165,7 @@
177165
{
178166
"cell_type": "code",
179167
"execution_count": 10,
180-
"metadata": {
181-
"collapsed": false
182-
},
168+
"metadata": {},
183169
"outputs": [
184170
{
185171
"data": {
@@ -229,9 +215,9 @@
229215
"name": "python",
230216
"nbconvert_exporter": "python",
231217
"pygments_lexer": "ipython3",
232-
"version": "3.4.4"
218+
"version": "3.8.6"
233219
}
234220
},
235221
"nbformat": 4,
236-
"nbformat_minor": 0
222+
"nbformat_minor": 1
237223
}

nbval/plugin.py

+6-12
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@
1616
import warnings
1717
from collections import OrderedDict, defaultdict
1818

19-
# for python 3 compatibility
20-
import six
21-
22-
try:
23-
from Queue import Empty
24-
except:
25-
from queue import Empty
19+
from queue import Empty
2620

2721
# for reading notebook files
2822
import nbformat
@@ -503,9 +497,9 @@ def compare_outputs(self, test, ref, skip_compare=None):
503497

504498
def format_output_compare(self, key, left, right):
505499
"""Format an output for printing"""
506-
if isinstance(left, six.string_types):
500+
if isinstance(left, str):
507501
left = _trim_base64(left)
508-
if isinstance(right, six.string_types):
502+
if isinstance(right, str):
509503
right = _trim_base64(right)
510504

511505
cc = self.colors
@@ -799,7 +793,7 @@ def sanitize_outputs(self, outputs, skip_sanitize=('metadata',
799793
def sanitize(self, s):
800794
"""sanitize a string for comparison.
801795
"""
802-
if not isinstance(s, six.string_types):
796+
if not isinstance(s, str):
803797
return s
804798

805799
"""
@@ -808,7 +802,7 @@ def sanitize(self, s):
808802
is passed when py.test is called. Otherwise, the strings
809803
are not processed
810804
"""
811-
for regex, replace in six.iteritems(self.parent.sanitize_patterns):
805+
for regex, replace in self.parent.sanitize_patterns.items():
812806
s = re.sub(regex, replace, s)
813807
return s
814808

@@ -904,6 +898,6 @@ def _trim_base64(s):
904898

905899
def _indent(s, indent=' '):
906900
"""Intent each line with indent"""
907-
if isinstance(s, six.string_types):
901+
if isinstance(s, str):
908902
return '\n'.join(('%s%s' % (indent, line) for line in s.splitlines()))
909903
return s

readthedocs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
type: sphinx
22
python:
3-
version: 3.5
3+
version: 3.8
44
pip_install: true
55
conda:
66
file: docs/environment.yml

setup.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,16 @@
2222
},
2323
install_requires = [
2424
'pytest >= 2.8',
25-
'six',
2625
'jupyter_client',
2726
'nbformat',
2827
'ipykernel',
2928
'coverage',
3029
],
30+
python_requires='>=3.6, <4',
3131
classifiers = [
3232
'Framework :: IPython',
3333
'Framework :: Pytest',
3434
'License :: OSI Approved :: BSD License',
35-
'Programming Language :: Python :: 2',
3635
'Programming Language :: Python :: 3',
3736
'Topic :: Software Development :: Testing',
3837
]

tests/exceptions.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
"name": "python",
142142
"nbconvert_exporter": "python",
143143
"pygments_lexer": "ipython3",
144-
"version": "3.6.0"
144+
"version": "3.8.6"
145145
}
146146
},
147147
"nbformat": 4,

tests/ipynb-test-samples/test-exceptions-fail-storedmismatch.ipynb

+6-8
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
{
44
"cell_type": "code",
55
"execution_count": 1,
6-
"metadata": {
7-
"collapsed": false
8-
},
6+
"metadata": {},
97
"outputs": [
108
{
119
"ename": "NameError",
@@ -38,21 +36,21 @@
3836
],
3937
"metadata": {
4038
"kernelspec": {
41-
"display_name": "Python 2",
39+
"display_name": "Python 3",
4240
"language": "python",
43-
"name": "python2"
41+
"name": "python3"
4442
},
4543
"language_info": {
4644
"codemirror_mode": {
4745
"name": "ipython",
48-
"version": 2
46+
"version": 3
4947
},
5048
"file_extension": ".py",
5149
"mimetype": "text/x-python",
5250
"name": "python",
5351
"nbconvert_exporter": "python",
54-
"pygments_lexer": "ipython2",
55-
"version": "2.7.12"
52+
"pygments_lexer": "ipython3",
53+
"version": "3.8.6"
5654
}
5755
},
5856
"nbformat": 4,

tests/ipynb-test-samples/test-latex-fail-randomoutput.ipynb

+5-11
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
{
1111
"cell_type": "code",
1212
"execution_count": 5,
13-
"metadata": {
14-
"collapsed": false
15-
},
13+
"metadata": {},
1614
"outputs": [],
1715
"source": [
1816
"import random\n",
@@ -24,9 +22,7 @@
2422
{
2523
"cell_type": "code",
2624
"execution_count": 3,
27-
"metadata": {
28-
"collapsed": false
29-
},
25+
"metadata": {},
3026
"outputs": [],
3127
"source": [
3228
"n1 = int(random.uniform(1, 10000000000000))"
@@ -35,9 +31,7 @@
3531
{
3632
"cell_type": "code",
3733
"execution_count": 6,
38-
"metadata": {
39-
"collapsed": false
40-
},
34+
"metadata": {},
4135
"outputs": [
4236
{
4337
"data": {
@@ -63,7 +57,7 @@
6357
"metadata": {
6458
"anaconda-cloud": {},
6559
"kernelspec": {
66-
"display_name": "Python [default]",
60+
"display_name": "Python 3",
6761
"language": "python",
6862
"name": "python3"
6963
},
@@ -77,7 +71,7 @@
7771
"name": "python",
7872
"nbconvert_exporter": "python",
7973
"pygments_lexer": "ipython3",
80-
"version": "3.5.2"
74+
"version": "3.8.6"
8175
}
8276
},
8377
"nbformat": 4,

0 commit comments

Comments
 (0)