Skip to content

Commit

Permalink
Docs: Ensure tutorial notebooks are Py2/3 cross-compatible.
Browse files Browse the repository at this point in the history
  • Loading branch information
timstaley committed Jan 7, 2018
1 parent 57f3c37 commit c8cdb61
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ matrix:
env: TOXENV=py35
- python: "3.6"
env: TOXENV=py36

- python: "2.7"
env: TOXENV=docs
env: TOXENV=docs2
- python: "3.6"
env: TOXENV=docs3

install: "pip install tox"
script: tox
Expand Down
1 change: 0 additions & 1 deletion documentation/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ sphinx>=1.4
sphinx_rtd_theme
jupyter
nbsphinx
nbconvert==5.0.0
4 changes: 2 additions & 2 deletions documentation/source/tutorial/01-parsing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"metadata": {},
"outputs": [],
"source": [
"with open('voevent.xml') as f:\n",
"with open('voevent.xml','rb') as f:\n",
" v = vp.load(f)"
]
},
Expand Down Expand Up @@ -375,5 +375,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 0
"nbformat_minor": 1
}
4 changes: 2 additions & 2 deletions documentation/source/tutorial/02-authoring.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
"metadata": {},
"outputs": [],
"source": [
"with open('my_gaia.xml', 'w') as f:\n",
"with open('my_gaia.xml', 'wb') as f:\n",
" vp.dump(v, f)"
]
},
Expand Down Expand Up @@ -406,5 +406,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 0
"nbformat_minor": 1
}
18 changes: 16 additions & 2 deletions 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 = py27, py34, py35, py36, docs, coverage-report
envlist = py27, py34, py35, py36, docs2, docs3, coverage-report
skip_missing_interpreters = true

[testenv]
Expand All @@ -29,7 +29,7 @@ commands =
coverage report


[testenv:docs]
[testenv:docs2]
passenv = HOME
setenv = TOX_DOCS = TRUE
basepython = python2
Expand All @@ -42,3 +42,17 @@ commands=
pip install -r documentation/requirements.txt
pip install -e .
sphinx-build -W -b html -d {envtmpdir}/doctrees documentation/source {envtmpdir}/html

[testenv:docs3]
passenv = HOME
setenv = TOX_DOCS = TRUE
basepython = python3
whitelist_externals =
pandoc
deps=
sphinx
commands=
env
pip install -r documentation/requirements.txt
pip install -e .
sphinx-build -W -b html -d {envtmpdir}/doctrees documentation/source {envtmpdir}/html

0 comments on commit c8cdb61

Please sign in to comment.