File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 strategy :
1313 fail-fast : false
1414 matrix :
15- python-version : ["3.10", "3.11 "]
15+ python-version : ["3.10", "3.13 "]
1616
1717 steps :
1818 - name : Checkout main
6161 - run : nox -s build
6262
6363 - name : Codecov
64- if : matrix.python-version == '3.11 '
64+ if : matrix.python-version == '3.13 '
6565 uses : codecov/codecov-action@v2
6666 with :
6767 token : ${{ secrets.CODECOV_TOKEN }}
Original file line number Diff line number Diff line change @@ -121,6 +121,11 @@ def find_nb_path_via_parent_process():
121121 if arg .endswith (".ipynb" ):
122122 potential_path = arg # Store the last one found
123123
124+ if is_nbconvert_call and "--inplace" not in cmdline :
125+ raise ValueError (
126+ "Please execute notebook 'nbconvert' by passing option '--inplace'."
127+ )
128+
124129 if is_nbconvert_call and potential_path :
125130 # We found something that looks like an nbconvert call and an ipynb file
126131 # The path might be relative to the parent process's CWD.
@@ -169,6 +174,8 @@ def find_nb_path_via_parent_process():
169174 except psutil .Error as e :
170175 logger .warning (f"psutil error: { e } " )
171176 return None
177+ except ValueError as ve : # Explicitly catch and re-raise the intended error
178+ raise ve
172179 except Exception as e :
173180 logger .warning (f"Unexpected error during psutil check: { e } " )
174181 return None
Original file line number Diff line number Diff line change @@ -8,6 +8,17 @@ def test_running_via_nbconvert():
88 shell = True ,
99 capture_output = True ,
1010 )
11+ assert result .returncode == 1
12+ assert (
13+ "Please execute notebook 'nbconvert' by passing option '--inplace'."
14+ in result .stderr .decode ()
15+ )
16+
17+ result = subprocess .run (
18+ "jupyter nbconvert --to notebook --inplace --execute ./tests/for-nbconvert.ipynb" ,
19+ shell = True ,
20+ capture_output = True ,
21+ )
1122 print (result .stdout .decode ())
1223 print (result .stderr .decode ())
1324 assert result .returncode == 0
You canβt perform that action at this time.
0 commit comments