Skip to content

Commit

Permalink
Merge pull request #162 from gliptak/python2
Browse files Browse the repository at this point in the history
Remove Python 2.7 and 3.5
  • Loading branch information
takluyver committed Dec 31, 2020
2 parents 98bd556 + 685a4ad commit 6d5b15c
Show file tree
Hide file tree
Showing 18 changed files with 60 additions and 122 deletions.
8 changes: 0 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ python:
- "3.8"
- "3.7"
- "3.6"
- "3.5"
- "2.7"

matrix:
allow_failures:
Expand All @@ -17,15 +15,9 @@ install:
# We do this conditionally because it saves us some downloading if the
# version is the same.
- unset VIRTUAL_ENV
# Python 3.4 and 2.7 need six installed before running setup.py
- pip install six
# Travis needs to update pip/setuptools
- pip install --upgrade setuptools pip
- pip install .
- |
if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
pip install doit==0.29.0
fi
- pip install doit
- doit install_test_deps

Expand Down
1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ image: Visual Studio 2019
# environment variables
environment:
matrix:
- PYTHON: "C:\\Python35-x64"
- PYTHON: "C:\\Python36-x64"
- PYTHON: "C:\\Python37-x64"
- PYTHON: "C:\\Python38-x64"
Expand Down
2 changes: 1 addition & 1 deletion docs/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: nbval_docs
channels:
- conda-forge
dependencies:
- python=3.5
- python=3.8
- numpy
- matplotlib
- sphinx
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.1"
"version": "3.8.6"
}
},
"nbformat": 4,
Expand Down
18 changes: 6 additions & 12 deletions issues/27/latex-example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"import sympy\n",
Expand All @@ -33,9 +31,7 @@
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -79,9 +75,7 @@
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand All @@ -106,9 +100,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda root]",
"display_name": "Python 3",
"language": "python",
"name": "conda-root-py"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -120,7 +114,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
"version": "3.8.6"
}
},
"nbformat": 4,
Expand Down
32 changes: 9 additions & 23 deletions issues/7/tutorial_lib.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand All @@ -50,9 +48,7 @@
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand All @@ -72,9 +68,7 @@
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand All @@ -101,9 +95,7 @@
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -133,9 +125,7 @@
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand All @@ -155,9 +145,7 @@
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand All @@ -177,9 +165,7 @@
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -229,9 +215,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.4"
"version": "3.8.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
"nbformat_minor": 1
}
18 changes: 6 additions & 12 deletions nbval/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,7 @@
import warnings
from collections import OrderedDict, defaultdict

# for python 3 compatibility
import six

try:
from Queue import Empty
except:
from queue import Empty
from queue import Empty

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

def format_output_compare(self, key, left, right):
"""Format an output for printing"""
if isinstance(left, six.string_types):
if isinstance(left, str):
left = _trim_base64(left)
if isinstance(right, six.string_types):
if isinstance(right, str):
right = _trim_base64(right)

cc = self.colors
Expand Down Expand Up @@ -799,7 +793,7 @@ def sanitize_outputs(self, outputs, skip_sanitize=('metadata',
def sanitize(self, s):
"""sanitize a string for comparison.
"""
if not isinstance(s, six.string_types):
if not isinstance(s, str):
return s

"""
Expand All @@ -808,7 +802,7 @@ def sanitize(self, s):
is passed when py.test is called. Otherwise, the strings
are not processed
"""
for regex, replace in six.iteritems(self.parent.sanitize_patterns):
for regex, replace in self.parent.sanitize_patterns.items():
s = re.sub(regex, replace, s)
return s

Expand Down Expand Up @@ -904,6 +898,6 @@ def _trim_base64(s):

def _indent(s, indent=' '):
"""Intent each line with indent"""
if isinstance(s, six.string_types):
if isinstance(s, str):
return '\n'.join(('%s%s' % (indent, line) for line in s.splitlines()))
return s
2 changes: 1 addition & 1 deletion readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
type: sphinx
python:
version: 3.5
version: 3.8
pip_install: true
conda:
file: docs/environment.yml
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,16 @@
},
install_requires = [
'pytest >= 2.8',
'six',
'jupyter_client',
'nbformat',
'ipykernel',
'coverage',
],
python_requires='>=3.6, <4',
classifiers = [
'Framework :: IPython',
'Framework :: Pytest',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Testing',
]
Expand Down
2 changes: 1 addition & 1 deletion tests/exceptions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.0"
"version": "3.8.6"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"ename": "NameError",
Expand Down Expand Up @@ -38,21 +36,21 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"display_name": "Python 3",
"language": "python",
"name": "python2"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.12"
"pygments_lexer": "ipython3",
"version": "3.8.6"
}
},
"nbformat": 4,
Expand Down
16 changes: 5 additions & 11 deletions tests/ipynb-test-samples/test-latex-fail-randomoutput.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"import random\n",
Expand All @@ -24,9 +22,7 @@
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [],
"source": [
"n1 = int(random.uniform(1, 10000000000000))"
Expand All @@ -35,9 +31,7 @@
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"metadata": {},
"outputs": [
{
"data": {
Expand All @@ -63,7 +57,7 @@
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python [default]",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -77,7 +71,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
"version": "3.8.6"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 6d5b15c

Please sign in to comment.