Skip to content

Commit

Permalink
Fix #969
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts committed Jul 2, 2022
1 parent 099d0c9 commit 62d83db
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
5 changes: 4 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
Jupytext ChangeLog
==================

1.13.9 (2022-06-30)
1.13.9 (2022-07-??)
-------------------

**Changed**
- Hidden configuration files like `.jupytext.toml` or `.jupytext.py` are now ignored by Jupytext's contents manager when `allow_hidden=False` (that option was introduced in `jupyter_server==2.0.0a1`) ([#964](https://github.com/mwouts/jupytext/issues/964)).

**Changed**
- `jupytext --set-formats ipynb,py test.py` will not override `test.ipynb` if the file exists already ([#969](https://github.com/mwouts/jupytext/issues/969)).


1.13.8 (2022-04-04)
-------------------
Expand Down
27 changes: 12 additions & 15 deletions jupytext/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,27 +629,24 @@ def jupytext_single_file(nb_file, args, log):

recursive_update(notebook.metadata, args.update_metadata)

# Read paired notebooks, except if the pair is being created
# Read paired notebooks
nb_files = [nb_file, nb_dest]
if args.sync:
formats = notebook_formats(
notebook, config, nb_file, fallback_on_current_fmt=False
)
set_prefix_and_suffix(fmt, formats, nb_file)
if args.set_formats is None:
try:
notebook, inputs_nb_file, outputs_nb_file = load_paired_notebook(
notebook, fmt, config, formats, nb_file, log, args.pre_commit_mode
)
nb_files = [inputs_nb_file, outputs_nb_file]
except NotAPairedNotebook as err:
sys.stderr.write("[jupytext] Warning: " + str(err) + "\n")
return 0
except InconsistentVersions as err:
sys.stderr.write("[jupytext] Error: " + str(err) + "\n")
return 1
else:
nb_files = [nb_file]
try:
notebook, inputs_nb_file, outputs_nb_file = load_paired_notebook(
notebook, fmt, config, formats, nb_file, log, args.pre_commit_mode
)
nb_files = [inputs_nb_file, outputs_nb_file]
except NotAPairedNotebook as err:
sys.stderr.write("[jupytext] Warning: " + str(err) + "\n")
return 0
except InconsistentVersions as err:
sys.stderr.write("[jupytext] Error: " + str(err) + "\n")
return 1

# II. ### Apply commands onto the notebook ###
# Pipe the notebook into the desired commands
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def notebook_with_outputs():
execution_count=1,
outputs=[
new_output(
data={"text/plain": ["2"]},
data={"text/plain": "2"},
execution_count=1,
output_type="execute_result",
)
Expand Down

0 comments on commit 62d83db

Please sign in to comment.