Skip to content

Commit

Permalink
Merge branch 'master' into migrate-to-jupyterlab2
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts authored Mar 7, 2020
2 parents e80e639 + 709c2a7 commit d3d9029
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
1.3.4+dev (2020-03-??)
----------------------

**Fixed**
- Removed leading slash in notebook paths (#444)

**Changed**
- The jupyterlab extension (in version 1.2.0) is compatible with JupyterLab 2.0. Many thanks to Jean Helie! (#447)
- It is not compatible with JupyterLab 1.x anymore. If you wish, you can install manually the previous version of the extension with `jupyter labextension install [email protected]`.
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- default
- conda-forge
dependencies:
- python==3.7
- python
- jupyter
- jupyterlab
- pyyaml
Expand Down
5 changes: 4 additions & 1 deletion jupytext/contentsmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ def save(self, model, path=''):
if model['type'] != 'notebook':
return super(JupytextContentsManager, self).save(model, path)

path = path.strip('/')
nbk = model['content']
try:
metadata = nbk.get('metadata')
Expand Down Expand Up @@ -284,7 +285,9 @@ def save(self, model, path=''):

def get(self, path, content=True, type=None, format=None, load_alternative_format=True):
""" Takes a path for an entity and returns its model"""
os_path = self._get_os_path(path.strip('/'))
path = path.strip('/')

os_path = self._get_os_path(path)
ext = os.path.splitext(path)[1]

# Not a notebook?
Expand Down
2 changes: 1 addition & 1 deletion jupytext/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Jupytext's version number"""

__version__ = '1.3.4'
__version__ = '1.3.4+dev'
2 changes: 1 addition & 1 deletion tests/test_paired_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_prefix_on_root_174():
formats = long_form_multiple_formats(short_formats)
assert short_form_multiple_formats(formats) == short_formats

expected_paths = ['/Untitled.ipynb', '/python/Untitled.py']
expected_paths = ['Untitled.ipynb', 'python/Untitled.py']
for fmt, path in zip(formats, expected_paths):
compare(paired_paths(path, fmt, formats), list(zip(expected_paths, formats)))

Expand Down

0 comments on commit d3d9029

Please sign in to comment.