Skip to content

Commit

Permalink
CI: black-list notebook using pybroom on py27
Browse files Browse the repository at this point in the history
  • Loading branch information
tritemio committed Jul 19, 2017
1 parent efa0e52 commit 5ed68bb
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ script:
- python -Wd fretbursts/tests/importtest.py
- py.test -v
- cd notebooks
- python ../fretbursts/tests/nbrun.py .
- if [[ $TRAVIS_PYTHON_VERSION != '2.7' ]]; then python ../fretbursts/tests/nbrun.py . ; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then python ../fretbursts/tests/nbrun.py --exclude-list dev/exclude-py27.txt . ; fi

sudo: false
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ test_script:
- python -Wd fretbursts/tests/importtest.py
- py.test -v
- cd %APPVEYOR_BUILD_FOLDER%\notebooks
- python ../fretbursts/tests/nbrun.py .
- ps: 'if($env:PYTHON_VERSION -ne "2.7"){python ../fretbursts/tests/nbrun.py .}'
- ps: 'if($env:PYTHON_VERSION -eq "2.7"){python ../fretbursts/tests/nbrun.py --exclude-list dev/exclude-py27.txt .}'

after_test:
- cd %APPVEYOR_BUILD_FOLDER%
Expand Down
21 changes: 16 additions & 5 deletions fretbursts/tests/nbrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ def check_out_path(notebook_path, out_path, ext, save):
'Use `jupyter kernelspec list` for a list of kernels.')
parser.add_argument('--kernel', metavar='KERNEL_NAME', default=None,
help=msg)
parser.add_argument('--exclude-list', metavar='FILE_NAME', default=None,
help=msg)
args = parser.parse_args()

folder = Path(args.folder)
Expand All @@ -210,11 +212,20 @@ def check_out_path(notebook_path, out_path, ext, save):
if not out_path.is_dir():
out_path.mkdir(parents=True) # py2 compat

exclude_list = []
if args.exclude_list is not None:
with open(args.exclude_list) as f:
exclude_list = [s.strip() for s in f.readlines()]

print('Executing notebooks in "%s" ... ' % folder)
pathlist = list(folder.glob('*.ipynb'))
for nbpath in pathlist:
if not (nbpath.stem.endswith('-out') or nbpath.stem.startswith('_')):
print()
out_path_ipynb = Path(out_path, nbpath.name)
run_notebook(nbpath, out_path_ipynb=out_path_ipynb,
kernel_name=args.kernel)
if nbpath.name in exclude_list:
print('- Skipping "%s"' % nbpath, flush=True)
continue
if nbpath.stem.endswith('-out') or nbpath.stem.startswith('_'):
continue
print()
out_path_ipynb = Path(out_path, nbpath.name)
run_notebook(nbpath, out_path_ipynb=out_path_ipynb,
kernel_name=args.kernel)
1 change: 1 addition & 0 deletions notebooks/dev/exclude-py27.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Example - FRET histogram fitting.ipynb

0 comments on commit 5ed68bb

Please sign in to comment.