Skip to content

Commit

Permalink
fixes #1452
Browse files Browse the repository at this point in the history
  • Loading branch information
jph00 committed Sep 23, 2024
1 parent 0bb7b5d commit 3e8f6ae
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion nbdev/migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def _re_v1():
d += L(get_config().tst_flags).filter()
d += [s.replace('_', '-') for s in d] # allow for hyphenated version of old directives
_tmp = '|'.join(list(set(d)))
return re.compile(f"^[ \f\v\t]*?(#)\s*({_tmp})(?!\S)", re.MULTILINE)
return re.compile(fr"^[ \f\v\t]*?(#)\s*({_tmp})(?!\S)", re.MULTILINE)

def _repl_directives(code_str):
def _fmt(x): return f"#| {_subv1(x[2].replace('-', '_').strip())}"
Expand Down
2 changes: 1 addition & 1 deletion nbdev/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def rm_export(cell):
def _is_showdoc(cell): return cell['cell_type'] == 'code' and _re_showdoc.search(cell.source)
def _add_directives(cell, d):
for k,v in d.items():
if not re.findall(f'#\| *{k}:', cell.source): cell.source = f'#| {k}: {v}\n' + cell.source
if not re.findall(fr'#\| *{k}:', cell.source): cell.source = f'#| {k}: {v}\n' + cell.source

def clean_show_doc(cell):
"Remove ShowDoc input cells"
Expand Down
2 changes: 1 addition & 1 deletion nbdev/quarto.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def nbdev_sidebar(
path:str=None, # Path to notebooks
printit:bool=False, # Print YAML for debugging
force:bool=False, # Create sidebar even if settings.ini custom_sidebar=False
skip_folder_re:str='(?:^[_.]|^www\$)', # Skip folders matching regex
skip_folder_re:str=r'(?:^[_.]|^www\$)', # Skip folders matching regex
**kwargs):
"Create sidebar.yml"
if not force and get_config().custom_sidebar: return
Expand Down
2 changes: 1 addition & 1 deletion nbdev/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def release_conda(
if skip_upload: return print(loc)
if not upload_user: upload_user = get_config().conda_user
if not upload_user: return print("`conda_user` not in settings.ini and no `upload_user` passed. Cannot upload")
if 'anaconda upload' not in res: return print(f"{res}\n\Failed. Check auto-upload not set in .condarc. Try `--do_build False`.")
if 'anaconda upload' not in res: return print(f"{res}\n\nFailed. Check auto-upload not set in .condarc. Try `--do_build False`.")
return anaconda_upload(name, loc)

# %% ../nbs/api/18_release.ipynb
Expand Down
2 changes: 1 addition & 1 deletion nbs/api/10_processors.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@
"def _is_showdoc(cell): return cell['cell_type'] == 'code' and _re_showdoc.search(cell.source)\n",
"def _add_directives(cell, d):\n",
" for k,v in d.items():\n",
" if not re.findall(f'#\\| *{k}:', cell.source): cell.source = f'#| {k}: {v}\\n' + cell.source\n",
" if not re.findall(fr'#\\| *{k}:', cell.source): cell.source = f'#| {k}: {v}\\n' + cell.source\n",
"\n",
"def clean_show_doc(cell):\n",
" \"Remove ShowDoc input cells\"\n",
Expand Down
2 changes: 1 addition & 1 deletion nbs/api/14_quarto.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
" path:str=None, # Path to notebooks\n",
" printit:bool=False, # Print YAML for debugging\n",
" force:bool=False, # Create sidebar even if settings.ini custom_sidebar=False\n",
" skip_folder_re:str='(?:^[_.]|^www\\$)', # Skip folders matching regex\n",
" skip_folder_re:str=r'(?:^[_.]|^www\\$)', # Skip folders matching regex\n",
" **kwargs):\n",
" \"Create sidebar.yml\"\n",
" if not force and get_config().custom_sidebar: return\n",
Expand Down
2 changes: 1 addition & 1 deletion nbs/api/16_migrate.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@
" d += L(get_config().tst_flags).filter()\n",
" d += [s.replace('_', '-') for s in d] # allow for hyphenated version of old directives\n",
" _tmp = '|'.join(list(set(d)))\n",
" return re.compile(f\"^[ \\f\\v\\t]*?(#)\\s*({_tmp})(?!\\S)\", re.MULTILINE)\n",
" return re.compile(fr\"^[ \\f\\v\\t]*?(#)\\s*({_tmp})(?!\\S)\", re.MULTILINE)\n",
"\n",
"def _repl_directives(code_str): \n",
" def _fmt(x): return f\"#| {_subv1(x[2].replace('-', '_').strip())}\"\n",
Expand Down
2 changes: 1 addition & 1 deletion nbs/api/18_release.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@
" if skip_upload: return print(loc)\n",
" if not upload_user: upload_user = get_config().conda_user\n",
" if not upload_user: return print(\"`conda_user` not in settings.ini and no `upload_user` passed. Cannot upload\")\n",
" if 'anaconda upload' not in res: return print(f\"{res}\\n\\Failed. Check auto-upload not set in .condarc. Try `--do_build False`.\")\n",
" if 'anaconda upload' not in res: return print(f\"{res}\\n\\nFailed. Check auto-upload not set in .condarc. Try `--do_build False`.\")\n",
" return anaconda_upload(name, loc)"
]
},
Expand Down

0 comments on commit 3e8f6ae

Please sign in to comment.