Skip to content

Commit

Permalink
Merge pull request #1532 from demotu/master
Browse files Browse the repository at this point in the history
replace template_path with template_paths
  • Loading branch information
juhasch authored Apr 5, 2021
2 parents 576e21e + 8e14f4a commit 75c2b6e
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 56 deletions.
12 changes: 3 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# http://travis-ci.org/#!/ipython-contrib/jupyter_contrib_nbextensions
# http://travis-ci.org/#!/ipython-contrib/jupyter_contrib_nbextensions
language: python
dist: trusty # required for pandoc>1.9.1
dist: xenial
sudo: false
addons:
apt_packages:
Expand Down Expand Up @@ -37,18 +37,12 @@ matrix:
python: '3.6'
env: TOXENV=condarecipe
# linux, various python and notebook versions
- os: linux
python: '2.7'
env: TOXENV=py27-notebook
- os: linux
python: '3.6'
env: TOXENV=py36-notebook54
- os: linux
python: '3.6'
env: TOXENV=py36-notebook55
- os: linux
python: '3.6'
env: TOXENV=py36-notebook44
env: TOXENV=py36-notebook60
- os: linux
python: '3.6'
env: TOXENV=py36-notebook
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ Unreleased (aka. GitHub master)
This is where each new PR to the project should add a summary of its changes,
which makes it much easier to fill in each release's changelog :)

- Replace `template_path` with `template_paths` [#1532](https://github.com/ipython-contrib/jupyter_contrib_nbextensions/pull/1532). Nbconvert 6.0 replaced `template_path` with `template_paths` (see https://nbconvert.readthedocs.io/en/latest/changelog.html#significant-changes). This change in Nbconvert 6.0 causes errors in jupyter_latex_envs and in jupyter_contrib_nbextensions (see [#1529](https://github.com/ipython-contrib/jupyter_contrib_nbextensions/issues/1529).
- Update `install_requires` list in `setup.py` with 'nbconvert >=6.0'
- Drop support for python < 3.6

0.5.1
-----

Expand Down
28 changes: 11 additions & 17 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,23 @@ environment:
PIP_ONLY_BINARY: lxml
matrix:

- TOXENV: 'py27-notebook'
TOXPYTHON: C:\Python27\python.exe
PYTHON_HOME: C:\Python27
PYTHON_VERSION: '2.7'
PYTHON_ARCH: '32'

- TOXENV: 'py36-notebook44'
- TOXENV: 'py36-notebook60'
TOXPYTHON: C:\Python36\python.exe
PYTHON_HOME: C:\Python36
PYTHON_VERSION: '3.6'
PYTHON_ARCH: '32'
PYTHON_ARCH: '64'

- TOXENV: 'py36-notebook54'
- TOXENV: 'py37-notebook60'
TOXPYTHON: C:\Python36\python.exe
PYTHON_HOME: C:\Python36
PYTHON_VERSION: '3.6'
PYTHON_ARCH: '32'
PYTHON_HOME: C:\Python37
PYTHON_VERSION: '3.7'
PYTHON_ARCH: '64'

- TOXENV: 'py36-notebook55'
TOXPYTHON: C:\Python36\python.exe
PYTHON_HOME: C:\Python36
PYTHON_VERSION: '3.6'
PYTHON_ARCH: '32'
- TOXENV: 'py38-notebook60'
TOXPYTHON: C:\Python38\python.exe
PYTHON_HOME: C:\Python38
PYTHON_VERSION: '3.8'
PYTHON_ARCH: '64'

init:
- ps: echo $env:TOXENV
Expand Down
4 changes: 2 additions & 2 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ requirements:
- jupyter_contrib_core >=0.3.3
- jupyter_core
- jupyter_highlight_selected_word >=0.1.1
- jupyter_latex_envs >=1.3.8
- jupyter_latex_envs >=1.4.0
- jupyter_nbextensions_configurator >=0.4.0
- nbconvert >=4.2
- notebook >=4.0
- notebook >=6.0
- pyyaml
- tornado
- traitlets >=4.1
Expand Down
12 changes: 5 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
# Imports
# -----------------------------------------------------------------------------

from __future__ import print_function

import os
from glob import glob

Expand Down Expand Up @@ -42,7 +40,7 @@ def main():
`the repository issues page <https://github.com/ipython-contrib/jupyter_contrib_nbextensions/issues>`_
if you encounter any problems, and create a new issue if needed!
""", # noqa: E501
version='0.5.1',
version='0.5.2',
author='ipython-contrib and jupyter-contrib developers',
author_email='[email protected]',
url=('https://github.com/'
Expand All @@ -65,10 +63,10 @@ def main():
'jupyter_contrib_core >=0.3.3',
'jupyter_core',
'jupyter_highlight_selected_word >=0.1.1',
'jupyter_latex_envs >=1.3.8',
'jupyter_latex_envs >=1.4.0',
'jupyter_nbextensions_configurator >=0.4.0',
'nbconvert >=4.2',
'notebook >=4.0',
'nbconvert >=6.0',
'notebook >=6.0',
'pyyaml',
'tornado',
'traitlets >=4.1',
Expand All @@ -81,7 +79,7 @@ def main():
'pip',
'requests',
],
'test:python_version == "2.7"': [
'test:python_version == "3.6"': [
'mock',
],
},
Expand Down
2 changes: 0 additions & 2 deletions src/jupyter_contrib_nbextensions/application.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-
"""App to install/remove jupyter_contrib_nbextensions."""

from __future__ import print_function, unicode_literals

import copy
import sys

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

c = get_config() # noqa
c.NbConvertApp.export_format = "html"
c.Exporter.template_path = [
c.Exporter.template_paths = [
'.',
jupyter_contrib_nbextensions.nbconvert_support.templates_directory(),
os.path.join(jcnbe_dir, 'nbextensions', 'highlighter')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

c = get_config() # noqa
c.NbConvertApp.export_format = "latex"
c.Exporter.template_path = [
c.Exporter.template_paths = [
'.',
jupyter_contrib_nbextensions.nbconvert_support.templates_directory(),
os.path.join(jcnbe_dir, 'nbextensions', 'highlighter')
Expand Down
6 changes: 1 addition & 5 deletions src/jupyter_contrib_nbextensions/install.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# -*- coding: utf-8 -*-
"""API to install/remove all jupyter_contrib_nbextensions."""

from __future__ import (
absolute_import, division, print_function, unicode_literals,
)

import errno
import os

Expand Down Expand Up @@ -124,7 +120,7 @@ def toggle_install_config(install, user=False, sys_prefix=False,
if logger:
logger.info('-- Configuring nbconvert template path')
# our templates directory
_update_config_list(config, 'Exporter.template_path', [
_update_config_list(config, 'Exporter.template_paths', [
'.',
jupyter_contrib_nbextensions.nbconvert_support.templates_directory(),
], install)
Expand Down
2 changes: 1 addition & 1 deletion src/jupyter_contrib_nbextensions/migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def _uninstall_pre_config(logger=None):
config = Config(cm.get(config_basename))
if config and logger:
logger.info('- Removing old config values from {}'.format(config_path))
_update_config_list(config, 'Exporter.template_path', [
_update_config_list(config, 'Exporter.template_paths', [
'.', os.path.join(jupyter_data_dir(), 'templates'),
], False)
_update_config_list(config, 'Exporter.preprocessors', [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def default_config(self):
templates_directory)
contrib_templates_dir = templates_directory()

template_path = c.TemplateExporter.setdefault('template_path', [])
if contrib_templates_dir not in template_path:
template_path.append(contrib_templates_dir)
template_paths = c.TemplateExporter.setdefault('template_paths', [])
if contrib_templates_dir not in template_paths:
template_paths.append(contrib_templates_dir)

return c
2 changes: 1 addition & 1 deletion src/jupyter_contrib_nbextensions/nbconvert_support/toc2.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def default_config(self):
templates_directory)
c.merge(super(TocExporter, self).default_config)

c.TemplateExporter.template_path = [
c.TemplateExporter.template_paths = [
'.',
templates_directory(),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ print(templates_directory())
```

The template needs to be in a path where nbconvert can find it. This can be your local path or specified in
`jupyter_nbconvert_config` or `jupyter_notebook_config` as `c.Exporter.template_path`, see [Jupyter docs](https://jupyter-notebook.readthedocs.io/en/latest/config.html).
`jupyter_nbconvert_config` or `jupyter_notebook_config` as `c.Exporter.template_paths`, see [Jupyter docs](https://jupyter-notebook.readthedocs.io/en/latest/config.html).

For HTML export a template is provided as `nbextensions.tpl` in the `jupyter_contrib_nbextensions` templates directory. Alternatively you can create your own template:
```
Expand Down
11 changes: 5 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ envlist =
clean,
check,
lint,
{py27,py36}-notebook{44,54,55},
{py36,py37,py38}-notebook{55,60},
report,

[testenv]
basepython =
pypy: {env:TOXPYTHON:pypy}
py27: {env:TOXPYTHON:python2.7}
py36: {env:TOXPYTHON:python3.6}
py37: {env:TOXPYTHON:python3.7}
{spell}: {env:TOXPYTHON:python2.7}
py38: {env:TOXPYTHON:python3.8}
{spell}: {env:TOXPYTHON:python3.6}
{appveyorartifacts,lint,check}: {env:TOXPYTHON:python3}
{condarecipe}: {env:TOXPYTHON:python3}
{clean,codecov,coveralls,report}: {env:TOXPYTHON:python3}
Expand All @@ -29,12 +29,11 @@ usedevelop = false
deps =
coverage>=4.2
jupyter_highlight_selected_word>=0.0.5
jupyter_latex_envs>=1.3.4
jupyter_latex_envs>=1.4.0
mock
nose
notebook44: https://github.com/jupyter/notebook/archive/4.4.0.zip
notebook54: https://github.com/jupyter/notebook/archive/5.4.0.zip
notebook55: https://github.com/jupyter/notebook/archive/5.5.0.zip
notebook60: https://github.com/jupyter/notebook/archive/6.0.0.zip
notebookmaster: https://github.com/jupyter/notebook/archive/master.zip
notebook: notebook
commands =
Expand Down

0 comments on commit 75c2b6e

Please sign in to comment.