The repository has not been cloned yet. Run the following command first
to clone the repo, check out the target commit, and install dependencies:
bash
bash /setup_files/setup.sh
The code will then be available at /testbed.
You are working on the repository mwouts/jupytext (instance: mwouts__jupytext-813).
The code is located in /testbed.
##806 jupytext --to notebook call from a paired script fails with InconsistentPath
First of all, thank you for creating and maintaining jupytext! I have been using it for quite some time and it has been incredibly useful. However, it seems like the changes introduced in 1.11.2 in response to #765 have broken some of my automated jupytexting scripts. The minimal setup to reproduce the problem seems to be the following:
With a directory structure
text
nb
├── scripts
└── test.ipynb
where scripts is a subdirectory and test.ipynb is some notebook
2. Run jupytext --set-formats "ipynb,scripts//py:percent" test.ipynb to create a paired script test.py in the scripts subdirectory.
3. Delete the notebook test.ipynb to simulate just having pulled test.py.
4. Try to recreate the notebook from the script: jupytext --to notebook --output test.ipynb ./scripts/test.py
Result: the notebook is correctly created but the call still fails with:
text
[jupytext] Reading ./scripts/test.py in format py
[jupytext] Writing test.ipynb
Traceback (most recent call last):
File "/usr/local/bin/jupytext", line 8, in <module>
sys.exit(jupytext())
File "/usr/local/lib/python3.7/site-packages/jupytext/cli.py", line 427, in jupytext
exit_code += jupytext_single_file(nb_file, args, log)
File "/usr/local/lib/python3.7/site-packages/jupytext/cli.py", line 826, in jupytext_single_file
for alt_path, _ in paired_paths(nb_file, fmt, formats)
File "/usr/local/lib/python3.7/site-packages/jupytext/paired_paths.py", line 248, in paired_paths
short_form_multiple_formats(formats),
jupytext.paired_paths.InconsistentPath: Paired paths './scripts/test.ipynb','./scripts/scripts/test.py' do not include the current notebook path './scripts/test.py'. Current format is 'py:percent', and paired formats are 'ipynb,scripts//py:percent'.