diff --git a/CHANGELOG.md b/CHANGELOG.md index 150794c7b..69aac2cc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -568,7 +568,7 @@ ### New Features -- Add --no_browser option to nbdev_preview ([#1400](https://github.com/fastai/nbdev/pull/1400)), thanks to [@bamford](https://github.com/bamford) +- Add --no-browser option to nbdev_preview ([#1400](https://github.com/fastai/nbdev/pull/1400)), thanks to [@bamford](https://github.com/bamford) - 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) - 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) @@ -896,7 +896,7 @@ - Add `custom_quarto_yml` setting ([#842](https://github.com/fastai/nbdev/pull/842)), thanks to [@benoit-cty](https://github.com/benoit-cty) - Display multiline docstrings ([#841](https://github.com/fastai/nbdev/issues/841)) - Include filename in `nbdev_export` warning when nbdev1 syntax is used ([#835](https://github.com/fastai/nbdev/issues/835)) -- 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) +- 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) - A command for uploading to the test pypi server ([#818](https://github.com/fastai/nbdev/pull/818)), thanks to [@tourdownunder](https://github.com/tourdownunder) - Include notebook title in `nbdev_preview` error message ([#802](https://github.com/fastai/nbdev/issues/802)) - Migrate collapsible code cell directives ([#783](https://github.com/fastai/nbdev/pull/783)), thanks to [@hamelsmu](https://github.com/hamelsmu) diff --git a/nbdev/cli.py b/nbdev/cli.py index fc37729fa..a365dbdf2 100644 --- a/nbdev/cli.py +++ b/nbdev/cli.py @@ -201,10 +201,10 @@ def _export(e,lib=lib): if (not '.ipynb_checkpoints' in p and p.endswith('.ipynb') and not Path(p).name.startswith(('tmp','.~'))): if e.event_type == 'modified': time.sleep(0.1) - try: run(f'nb-export --lib_path {lib} "{p}"') + try: run(f'nb-export --lib-path {lib} "{p}"') except IOError: time.sleep(0.3) - run(f'nb-export --lib_path {lib} "{p}"') + run(f'nb-export --lib-path {lib} "{p}"') with fs_watchdog(_export, nbs): while True: time.sleep(1) diff --git a/nbdev/config.py b/nbdev/config.py index bfc4c7558..30e4e2d30 100644 --- a/nbdev/config.py +++ b/nbdev/config.py @@ -130,7 +130,7 @@ def nbdev_create_config( author = author or inf.get('author', '') if not author: raise ValueError("Could not infer `author` from git. Please pass --author explicitly.") author_email = author_email or inf.get('author_email', '') - if not author_email: raise ValueError("Could not infer `author_email` from git. Please pass --author_email explicitly.") + if not author_email: raise ValueError("Could not infer `author_email` from git. Please pass --author-email explicitly.") branch = branch or inf.get('branch', 'main') description = description or inf.get('description', '') diff --git a/nbdev/release.py b/nbdev/release.py index 8cf2efee7..95c74b088 100644 --- a/nbdev/release.py +++ b/nbdev/release.py @@ -51,7 +51,7 @@ def _remote_shas(s): return {o.split()[0] for o in s.splitlines()} def _check_changelog_base(tag): if _is_ancestor(tag): return - raise SystemExit(f'HEAD does not contain the latest release ({tag}). Write CHANGELOG.md manually, then run with --no_changelog.') + raise SystemExit(f'HEAD does not contain the latest release ({tag}). Write CHANGELOG.md manually, then run with --no-changelog.') def _release_head(): _release_branch() @@ -335,7 +335,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 pyproject.toml and no `upload_user` passed. Cannot upload") - if 'anaconda upload' not in res: return print(f"{res}\n\nFailed. 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 #0500d972 diff --git a/nbs/_quarto.yml b/nbs/_quarto.yml index 721707e26..8069bdddb 100644 --- a/nbs/_quarto.yml +++ b/nbs/_quarto.yml @@ -1,10 +1,10 @@ project: type: website pre-render: - - pysym2md --output_file apilist.txt nbdev + - pysym2md --output-file apilist.txt nbdev post-render: - - llms_txt2ctx llms.txt --optional true --save_nbdev_fname llms-ctx-full.txt - - llms_txt2ctx llms.txt --save_nbdev_fname llms-ctx.txt + - llms_txt2ctx llms.txt --optional true --save-nbdev-fname llms-ctx-full.txt + - llms_txt2ctx llms.txt --save-nbdev-fname llms-ctx.txt resources: - "*.txt" preview: diff --git a/nbs/api/01_config.ipynb b/nbs/api/01_config.ipynb index 753a04160..1ba47e186 100644 --- a/nbs/api/01_config.ipynb +++ b/nbs/api/01_config.ipynb @@ -276,7 +276,7 @@ " author = author or inf.get('author', '')\n", " if not author: raise ValueError(\"Could not infer `author` from git. Please pass --author explicitly.\")\n", " author_email = author_email or inf.get('author_email', '')\n", - " if not author_email: raise ValueError(\"Could not infer `author_email` from git. Please pass --author_email explicitly.\")\n", + " if not author_email: raise ValueError(\"Could not infer `author_email` from git. Please pass --author-email explicitly.\")\n", " branch = branch or inf.get('branch', 'main')\n", " description = description or inf.get('description', '')\n", " \n", @@ -304,7 +304,7 @@ "\n", "```sh\n", "nbdev-create-config --repo nbdev --user fastai --author fastai \\\n", - " --author_email info@fast.ai --description 'A test project'\n", + " --author-email info@fast.ai --description 'A test project'\n", "```\n", "\n", "If you don't provide settings, we'll try to infer them from git and GitHub." diff --git a/nbs/api/12_test.ipynb b/nbs/api/12_test.ipynb index c8471294d..7c88596ee 100644 --- a/nbs/api/12_test.ipynb +++ b/nbs/api/12_test.ipynb @@ -358,13 +358,13 @@ "You can even run `nbdev-test` in non nbdev projects, for example, you can test an individual notebook like so:\n", "\n", "```\n", - "nbdev-test --path ../../tests/minimal.ipynb --do_print\n", + "nbdev-test --path ../../tests/minimal.ipynb --do-print\n", "```\n", "\n", "Or you can test an entire directory of notebooks filtered for only those that match a regular expression:\n", "\n", "```\n", - "nbdev-test --path ../../tests --file_re '.*test.ipynb' --do_print\n", + "nbdev-test --path ../../tests --file-re '.*test.ipynb' --do-print\n", "```" ] }, diff --git a/nbs/api/13_cli.ipynb b/nbs/api/13_cli.ipynb index c7b5b9c7d..52ab29b57 100644 --- a/nbs/api/13_cli.ipynb +++ b/nbs/api/13_cli.ipynb @@ -343,10 +343,10 @@ " if (not '.ipynb_checkpoints' in p and p.endswith('.ipynb') and not Path(p).name.startswith(('tmp','.~'))):\n", " if e.event_type == 'modified':\n", " time.sleep(0.1)\n", - " try: run(f'nb-export --lib_path {lib} \"{p}\"')\n", + " try: run(f'nb-export --lib-path {lib} \"{p}\"')\n", " except IOError:\n", " time.sleep(0.3)\n", - " run(f'nb-export --lib_path {lib} \"{p}\"')\n", + " run(f'nb-export --lib-path {lib} \"{p}\"')\n", " with fs_watchdog(_export, nbs):\n", " while True: time.sleep(1)" ] diff --git a/nbs/api/18_release.ipynb b/nbs/api/18_release.ipynb index 580402875..a55212c76 100644 --- a/nbs/api/18_release.ipynb +++ b/nbs/api/18_release.ipynb @@ -153,7 +153,7 @@ "If the changelog was generated and reviewed separately, complete the release without regenerating it, opening an editor, or prompting:\n", "\n", "```\n", - "nbdev-release-gh --no_changelog --no_editor --yes\n", + "nbdev-release-gh --no-changelog --no-editor --yes\n", "```\n", "\n", "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 @@ "```sh\n", "git diff\n", "git status --short\n", - "nbdev-release-gh --no_changelog --no_editor --yes\n", + "nbdev-release-gh --no-changelog --no-editor --yes\n", "nbdev-pypi\n", "nbdev-bump-version\n", "git commit -am bump\n", @@ -323,7 +323,7 @@ "\n", "def _check_changelog_base(tag):\n", " if _is_ancestor(tag): return\n", - " raise SystemExit(f'HEAD does not contain the latest release ({tag}). Write CHANGELOG.md manually, then run with --no_changelog.')\n", + " raise SystemExit(f'HEAD does not contain the latest release ({tag}). Write CHANGELOG.md manually, then run with --no-changelog.')\n", "\n", "def _release_head():\n", " _release_branch()\n", @@ -352,7 +352,7 @@ "test_fail(lambda: _require_release_branch(''), contains='detached HEAD', exc=SystemExit)\n", "test_eq(_remote_shas('abc\\trefs/heads/main\\ndef\\trefs/heads/1.x\\n'), {'abc', 'def'})\n", "assert _is_ancestor('HEAD')\n", - "test_fail(lambda: _check_changelog_base('__missing_release_tag__'), contains='--no_changelog', exc=SystemExit)" + "test_fail(lambda: _check_changelog_base('__missing_release_tag__'), contains='--no-changelog', exc=SystemExit)" ] }, { @@ -960,7 +960,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 pyproject.toml and no `upload_user` passed. Cannot upload\")\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", + " 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)" ] }, @@ -998,7 +998,7 @@ "Or to do things more manually:\n", "\n", "```\n", - "nbdev-conda-package --do_build false\n", + "nbdev-conda-package --do-build false\n", "cd conda\n", "conda build --no-anaconda-upload --output-folder build {name}\n", "anaconda upload build/noarch/{name}-{ver}-*.tar.bz2\n", diff --git a/nbs/tutorials/migrating.ipynb b/nbs/tutorials/migrating.ipynb index 5db7129dc..83eb269c1 100644 --- a/nbs/tutorials/migrating.ipynb +++ b/nbs/tutorials/migrating.ipynb @@ -23,7 +23,7 @@ "\n", "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", "\n", - "`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", + "`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", "\n", "`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." ] diff --git a/nbs/tutorials/tutorial.ipynb b/nbs/tutorials/tutorial.ipynb index 9796934a2..7690cb5b5 100644 --- a/nbs/tutorials/tutorial.ipynb +++ b/nbs/tutorials/tutorial.ipynb @@ -380,7 +380,7 @@ "source": [ "::: {.callout-note}\n", "\n", - "`nbdev-new` assumes that your package name is the same as your repo name (with `-` replaced by `_`). Use the `--lib_name` option if that isn't the case.\n", + "`nbdev-new` assumes that your package name is the same as your repo name (with `-` replaced by `_`). Use the `--lib-name` option if that isn't the case.\n", "\n", ":::" ]