Skip to content

Commit

Permalink
Remove Python 2.x compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeier committed Feb 13, 2020
1 parent c74aa47 commit e988192
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 38 deletions.
28 changes: 0 additions & 28 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,11 @@ matrix:
- python: "nightly"
# - python: "pypy3"

- name: Python 2.7 + latest Sphinx
python: "2.7"
install: &py2-install
- python2 --version
- python2 -m pip install .
- python2 -m pip install sphinxcontrib-bibtex==0.4.2
- python2 -m pip install sphinxcontrib-svg2pdfconverter
- python2 -m pip install ipywidgets
- python2 -m pip install 'sphinx-copybutton<0.2.6'
script: &py2-script
- python2 -m nbsphinx
# We don't execute, because the example notebooks use Python 3
- python2 -m sphinx doc/ doc/_build/ -W -b html -D nbsphinx_execute=never

- name: default Python + latest Sphinx
os: osx
language: generic
python: ""

- name: Python 2.7 + latest Sphinx
os: osx
language: generic
python: ""
addons:
homebrew:
update: true
packages:
- python@2
- pandoc
- librsvg
install: *py2-install
script: *py2-script

allow_failures:
- python: "nightly"

Expand Down
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[bdist_wheel]
universal=1

[metadata]
license_file = LICENSE
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
version=__version__,
package_dir={'': 'src'},
py_modules=['nbsphinx'],
python_requires='>=2.7',
python_requires='>=3',
install_requires=[
'docutils',
'jinja2',
Expand Down
8 changes: 2 additions & 6 deletions src/nbsphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,12 @@
__version__ = '0.5.1'

import copy
from html.parser import HTMLParser
import json
import os
import re
import subprocess
try:
from urllib.parse import unquote # Python 3.x
from html.parser import HTMLParser
except ImportError:
from urllib2 import unquote # Python 2.x
from HTMLParser import HTMLParser
from urllib.parse import unquote

import docutils
from docutils.parsers import rst
Expand Down

0 comments on commit e988192

Please sign in to comment.