Skip to content

Commit 8fd0862

Browse files
authored
Update CLI flags for fastcore.script hyphenation
1 parent 3ecadbb commit 8fd0862

11 files changed

Lines changed: 24 additions & 24 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@
568568

569569
### New Features
570570

571-
- Add --no_browser option to nbdev_preview ([#1400](https://github.com/fastai/nbdev/pull/1400)), thanks to [@bamford](https://github.com/bamford)
571+
- Add --no-browser option to nbdev_preview ([#1400](https://github.com/fastai/nbdev/pull/1400)), thanks to [@bamford](https://github.com/bamford)
572572
- added conda_user and package_data to cfg_tail ([#1351](https://github.com/fastai/nbdev/pull/1351)), thanks to [@dsm-72](https://github.com/dsm-72)
573573
- add repo and tag options to `nbdev_new` ([#1350](https://github.com/fastai/nbdev/pull/1350)), thanks to [@dsm-72](https://github.com/dsm-72)
574574

@@ -896,7 +896,7 @@
896896
- Add `custom_quarto_yml` setting ([#842](https://github.com/fastai/nbdev/pull/842)), thanks to [@benoit-cty](https://github.com/benoit-cty)
897897
- Display multiline docstrings ([#841](https://github.com/fastai/nbdev/issues/841))
898898
- Include filename in `nbdev_export` warning when nbdev1 syntax is used ([#835](https://github.com/fastai/nbdev/issues/835))
899-
- Streamline `nbdev_new`: outputs are now in color, you can pass `--lib_name`, and it calls `nbdev_export` ([#820](https://github.com/fastai/nbdev/pull/820)), thanks to [@seeM](https://github.com/seeM)
899+
- Streamline `nbdev_new`: outputs are now in color, you can pass `--lib-name`, and it calls `nbdev_export` ([#820](https://github.com/fastai/nbdev/pull/820)), thanks to [@seeM](https://github.com/seeM)
900900
- A command for uploading to the test pypi server ([#818](https://github.com/fastai/nbdev/pull/818)), thanks to [@tourdownunder](https://github.com/tourdownunder)
901901
- Include notebook title in `nbdev_preview` error message ([#802](https://github.com/fastai/nbdev/issues/802))
902902
- Migrate collapsible code cell directives ([#783](https://github.com/fastai/nbdev/pull/783)), thanks to [@hamelsmu](https://github.com/hamelsmu)

nbdev/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@ def _export(e,lib=lib):
201201
if (not '.ipynb_checkpoints' in p and p.endswith('.ipynb') and not Path(p).name.startswith(('tmp','.~'))):
202202
if e.event_type == 'modified':
203203
time.sleep(0.1)
204-
try: run(f'nb-export --lib_path {lib} "{p}"')
204+
try: run(f'nb-export --lib-path {lib} "{p}"')
205205
except IOError:
206206
time.sleep(0.3)
207-
run(f'nb-export --lib_path {lib} "{p}"')
207+
run(f'nb-export --lib-path {lib} "{p}"')
208208
with fs_watchdog(_export, nbs):
209209
while True: time.sleep(1)
210210

nbdev/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def nbdev_create_config(
130130
author = author or inf.get('author', '')
131131
if not author: raise ValueError("Could not infer `author` from git. Please pass --author explicitly.")
132132
author_email = author_email or inf.get('author_email', '')
133-
if not author_email: raise ValueError("Could not infer `author_email` from git. Please pass --author_email explicitly.")
133+
if not author_email: raise ValueError("Could not infer `author_email` from git. Please pass --author-email explicitly.")
134134
branch = branch or inf.get('branch', 'main')
135135
description = description or inf.get('description', '')
136136

nbdev/release.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _remote_shas(s): return {o.split()[0] for o in s.splitlines()}
5151

5252
def _check_changelog_base(tag):
5353
if _is_ancestor(tag): return
54-
raise SystemExit(f'HEAD does not contain the latest release ({tag}). Write CHANGELOG.md manually, then run with --no_changelog.')
54+
raise SystemExit(f'HEAD does not contain the latest release ({tag}). Write CHANGELOG.md manually, then run with --no-changelog.')
5555

5656
def _release_head():
5757
_release_branch()
@@ -335,7 +335,7 @@ def release_conda(
335335
if skip_upload: return print(loc)
336336
if not upload_user: upload_user = get_config().conda_user
337337
if not upload_user: return print("`conda_user` not in pyproject.toml and no `upload_user` passed. Cannot upload")
338-
if 'anaconda upload' not in res: return print(f"{res}\n\nFailed. Check auto-upload not set in .condarc. Try `--do_build False`.")
338+
if 'anaconda upload' not in res: return print(f"{res}\n\nFailed. Check auto-upload not set in .condarc. Try `--do-build False`.")
339339
return anaconda_upload(name, loc)
340340

341341
# %% ../nbs/api/18_release.ipynb #0500d972

nbs/_quarto.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
project:
22
type: website
33
pre-render:
4-
- pysym2md --output_file apilist.txt nbdev
4+
- pysym2md --output-file apilist.txt nbdev
55
post-render:
6-
- llms_txt2ctx llms.txt --optional true --save_nbdev_fname llms-ctx-full.txt
7-
- llms_txt2ctx llms.txt --save_nbdev_fname llms-ctx.txt
6+
- llms_txt2ctx llms.txt --optional true --save-nbdev-fname llms-ctx-full.txt
7+
- llms_txt2ctx llms.txt --save-nbdev-fname llms-ctx.txt
88
resources:
99
- "*.txt"
1010
preview:

nbs/api/01_config.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@
276276
" author = author or inf.get('author', '')\n",
277277
" if not author: raise ValueError(\"Could not infer `author` from git. Please pass --author explicitly.\")\n",
278278
" author_email = author_email or inf.get('author_email', '')\n",
279-
" if not author_email: raise ValueError(\"Could not infer `author_email` from git. Please pass --author_email explicitly.\")\n",
279+
" if not author_email: raise ValueError(\"Could not infer `author_email` from git. Please pass --author-email explicitly.\")\n",
280280
" branch = branch or inf.get('branch', 'main')\n",
281281
" description = description or inf.get('description', '')\n",
282282
" \n",
@@ -304,7 +304,7 @@
304304
"\n",
305305
"```sh\n",
306306
"nbdev-create-config --repo nbdev --user fastai --author fastai \\\n",
307-
" --author_email info@fast.ai --description 'A test project'\n",
307+
" --author-email info@fast.ai --description 'A test project'\n",
308308
"```\n",
309309
"\n",
310310
"If you don't provide settings, we'll try to infer them from git and GitHub."

nbs/api/12_test.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,13 +358,13 @@
358358
"You can even run `nbdev-test` in non nbdev projects, for example, you can test an individual notebook like so:\n",
359359
"\n",
360360
"```\n",
361-
"nbdev-test --path ../../tests/minimal.ipynb --do_print\n",
361+
"nbdev-test --path ../../tests/minimal.ipynb --do-print\n",
362362
"```\n",
363363
"\n",
364364
"Or you can test an entire directory of notebooks filtered for only those that match a regular expression:\n",
365365
"\n",
366366
"```\n",
367-
"nbdev-test --path ../../tests --file_re '.*test.ipynb' --do_print\n",
367+
"nbdev-test --path ../../tests --file-re '.*test.ipynb' --do-print\n",
368368
"```"
369369
]
370370
},

nbs/api/13_cli.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,10 @@
343343
" if (not '.ipynb_checkpoints' in p and p.endswith('.ipynb') and not Path(p).name.startswith(('tmp','.~'))):\n",
344344
" if e.event_type == 'modified':\n",
345345
" time.sleep(0.1)\n",
346-
" try: run(f'nb-export --lib_path {lib} \"{p}\"')\n",
346+
" try: run(f'nb-export --lib-path {lib} \"{p}\"')\n",
347347
" except IOError:\n",
348348
" time.sleep(0.3)\n",
349-
" run(f'nb-export --lib_path {lib} \"{p}\"')\n",
349+
" run(f'nb-export --lib-path {lib} \"{p}\"')\n",
350350
" with fs_watchdog(_export, nbs):\n",
351351
" while True: time.sleep(1)"
352352
]

nbs/api/18_release.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
"If the changelog was generated and reviewed separately, complete the release without regenerating it, opening an editor, or prompting:\n",
154154
"\n",
155155
"```\n",
156-
"nbdev-release-gh --no_changelog --no_editor --yes\n",
156+
"nbdev-release-gh --no-changelog --no-editor --yes\n",
157157
"```\n",
158158
"\n",
159159
"Automatic changelog generation stops when the current branch does not contain the latest GitHub release, as happens for an update to an older version. Write `CHANGELOG.md` manually and use the command above. The next section shows the complete process.\n",
@@ -189,7 +189,7 @@
189189
"```sh\n",
190190
"git diff\n",
191191
"git status --short\n",
192-
"nbdev-release-gh --no_changelog --no_editor --yes\n",
192+
"nbdev-release-gh --no-changelog --no-editor --yes\n",
193193
"nbdev-pypi\n",
194194
"nbdev-bump-version\n",
195195
"git commit -am bump\n",
@@ -323,7 +323,7 @@
323323
"\n",
324324
"def _check_changelog_base(tag):\n",
325325
" if _is_ancestor(tag): return\n",
326-
" raise SystemExit(f'HEAD does not contain the latest release ({tag}). Write CHANGELOG.md manually, then run with --no_changelog.')\n",
326+
" raise SystemExit(f'HEAD does not contain the latest release ({tag}). Write CHANGELOG.md manually, then run with --no-changelog.')\n",
327327
"\n",
328328
"def _release_head():\n",
329329
" _release_branch()\n",
@@ -352,7 +352,7 @@
352352
"test_fail(lambda: _require_release_branch(''), contains='detached HEAD', exc=SystemExit)\n",
353353
"test_eq(_remote_shas('abc\\trefs/heads/main\\ndef\\trefs/heads/1.x\\n'), {'abc', 'def'})\n",
354354
"assert _is_ancestor('HEAD')\n",
355-
"test_fail(lambda: _check_changelog_base('__missing_release_tag__'), contains='--no_changelog', exc=SystemExit)"
355+
"test_fail(lambda: _check_changelog_base('__missing_release_tag__'), contains='--no-changelog', exc=SystemExit)"
356356
]
357357
},
358358
{
@@ -960,7 +960,7 @@
960960
" if skip_upload: return print(loc)\n",
961961
" if not upload_user: upload_user = get_config().conda_user\n",
962962
" if not upload_user: return print(\"`conda_user` not in pyproject.toml and no `upload_user` passed. Cannot upload\")\n",
963-
" if 'anaconda upload' not in res: return print(f\"{res}\\n\\nFailed. Check auto-upload not set in .condarc. Try `--do_build False`.\")\n",
963+
" if 'anaconda upload' not in res: return print(f\"{res}\\n\\nFailed. Check auto-upload not set in .condarc. Try `--do-build False`.\")\n",
964964
" return anaconda_upload(name, loc)"
965965
]
966966
},
@@ -998,7 +998,7 @@
998998
"Or to do things more manually:\n",
999999
"\n",
10001000
"```\n",
1001-
"nbdev-conda-package --do_build false\n",
1001+
"nbdev-conda-package --do-build false\n",
10021002
"cd conda\n",
10031003
"conda build --no-anaconda-upload --output-folder build {name}\n",
10041004
"anaconda upload build/noarch/{name}-{ver}-*.tar.bz2\n",

nbs/tutorials/migrating.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"\n",
2424
"There are breaking changes for extension authors only. `nbdev.process.extract_directives` is gone: read directives from a cell's `directives` property, and use `cell.remove_directives()` to strip them from the source. The `cell.directives_` dict has also changed shape: keys never include a trailing colon, and each value is the directive's raw text rather than a list of whitespace-split tokens (`''` for a bare directive), so `directives_['eval:'] == ['false']` becomes `directives_['eval'] == 'false'`. Processor methods are unchanged: they still receive whitespace-split positional args.\n",
2525
"\n",
26-
"`nbdev-clean` (and therefore the git and Jupyter save hooks) now also repairs structural problems by default, such as stray `outputs` attrs on markdown cells, so a previously-invalid notebook shows a one-time diff on its next clean (`--repair false` disables this). It also gains opt-in migration flags which the hooks never trigger: `--dirs` respells comment directives canonically, `--to_meta`/`--to_comments` move named directives between comments and cell metadata, and `--nb_meta` moves `default_exp` into notebook metadata.\n",
26+
"`nbdev-clean` (and therefore the git and Jupyter save hooks) now also repairs structural problems by default, such as stray `outputs` attrs on markdown cells, so a previously-invalid notebook shows a one-time diff on its next clean (`--repair false` disables this). It also gains opt-in migration flags which the hooks never trigger: `--dirs` respells comment directives canonically, `--to-meta`/`--to-comments` move named directives between comments and cell metadata, and `--nb-meta` moves `default_exp` into notebook metadata.\n",
2727
"\n",
2828
"`nbdev-install-hooks` now also registers a git diff driver, so `git diff` shows notebook changes cell by cell as small source diffs (see `nbdev.diff`). The merge and diff drivers install independently (`--merge false`/`--diff false`), and `--globally` defines them machine-wide in `~/.gitconfig` and your global git attributes file instead of per repo. Both drivers are now named `jupyternotebook`, the name nbdime also uses, so a committed `.gitattributes` activates whichever notebook driver each collaborator has enabled; repos installed under the old `nbdev-merge`/`nbdev-diff` names keep working, and re-running `nbdev-install-hooks` moves them to the new name (the stale attribute lines are harmless, as the appended new ones win). The new `nbdev-diff` command renders the same output between any two refs without touching your git config."
2929
]

0 commit comments

Comments
 (0)