nbdev 3.3.13__tar.gz → 3.3.15__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nbdev-3.3.13/nbdev.egg-info → nbdev-3.3.15}/PKG-INFO +1 -1
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/__init__.py +1 -1
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/cli.py +2 -2
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/config.py +6 -6
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/doclinks.py +4 -3
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/release.py +2 -2
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/skill.py +3 -1
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/test.py +4 -3
- {nbdev-3.3.13 → nbdev-3.3.15/nbdev.egg-info}/PKG-INFO +1 -1
- {nbdev-3.3.13 → nbdev-3.3.15}/CONTRIBUTING.md +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/LICENSE +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/MANIFEST.in +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/README.md +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/_modidx.py +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/clean.py +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/diff.py +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/export.py +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/extract_attachments.py +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/frontmatter.py +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/imports.py +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/maker.py +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/merge.py +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/migrate.py +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/moddocs.py +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/process.py +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/processors.py +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/qmd.py +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/quarto.py +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/scrubmagics.py +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/serve.py +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/serve_drv.py +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/showdoc.py +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev/sync.py +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev.egg-info/SOURCES.txt +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev.egg-info/dependency_links.txt +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev.egg-info/entry_points.txt +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev.egg-info/requires.txt +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/nbdev.egg-info/top_level.txt +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/pyproject.toml +0 -0
- {nbdev-3.3.13 → nbdev-3.3.15}/setup.cfg +0 -0
|
@@ -6,7 +6,7 @@ Modules:
|
|
|
6
6
|
- `nbdev.moddocs`: # Module docs: creating them from existing notebooks
|
|
7
7
|
- `nbdev.skill`: Author clear, executable nbdev notebooks where code, prose, examples, outputs, and tests form one coherent narrative. Trigger: ALWAYS read this before ANY notebook edit."""
|
|
8
8
|
|
|
9
|
-
__version__ = "3.3.
|
|
9
|
+
__version__ = "3.3.15"
|
|
10
10
|
|
|
11
11
|
from .doclinks import nbdev_export
|
|
12
12
|
from .showdoc import show_doc
|
|
@@ -201,10 +201,10 @@ def watch_export(
|
|
|
201
201
|
if (not '.ipynb_checkpoints' in p and p.endswith('.ipynb') and not Path(p).name.startswith(('tmp','.~'))):
|
|
202
202
|
if e.event_type == 'modified':
|
|
203
203
|
time.sleep(0.1)
|
|
204
|
-
try: run(f'nb-export --
|
|
204
|
+
try: run(f'nb-export --lib-path {lib} "{p}"')
|
|
205
205
|
except IOError:
|
|
206
206
|
time.sleep(0.3)
|
|
207
|
-
run(f'nb-export --
|
|
207
|
+
run(f'nb-export --lib-path {lib} "{p}"')
|
|
208
208
|
with fs_watchdog(_export, nbs):
|
|
209
209
|
while True: time.sleep(1)
|
|
210
210
|
|
|
@@ -123,14 +123,14 @@ def nbdev_create_config(
|
|
|
123
123
|
path.mkdir(exist_ok=True, parents=True)
|
|
124
124
|
|
|
125
125
|
# Infer from git if not provided
|
|
126
|
-
inf = _fetch_from_git()
|
|
126
|
+
inf,ucfg = _fetch_from_git(),_user_config()
|
|
127
127
|
repo = repo or inf.get('repo') or path.resolve().name
|
|
128
|
-
user = user or inf.get('user', '')
|
|
128
|
+
user = user or inf.get('user') or ucfg.get('user', '')
|
|
129
129
|
if not user: raise ValueError("Could not infer `user` from git. Please pass --user explicitly.")
|
|
130
|
-
author = author or inf.get('author', '')
|
|
130
|
+
author = author or inf.get('author') or ucfg.get('author', '')
|
|
131
131
|
if not author: raise ValueError("Could not infer `author` from git. Please pass --author explicitly.")
|
|
132
|
-
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 --
|
|
132
|
+
author_email = author_email or inf.get('author_email') or ucfg.get('author_email', '')
|
|
133
|
+
if not author_email: raise ValueError("Could not infer `author_email` from git. Please pass --author-email explicitly.")
|
|
134
134
|
branch = branch or inf.get('branch', 'main')
|
|
135
135
|
description = description or inf.get('description', '')
|
|
136
136
|
|
|
@@ -171,7 +171,7 @@ def _find_nbdev_pyproject(path=None):
|
|
|
171
171
|
# %% ../nbs/api/01_config.ipynb #3dac70e0
|
|
172
172
|
nbdev_defaults = dict(nbs_path='nbs', doc_path='_docs', tst_flags='notest', recursive=True, readme_nb='index.ipynb',
|
|
173
173
|
clean_ids=True, clear_all=False, put_version_in_init=True, jupyter_hooks=False, custom_sidebar=False, branch='main',
|
|
174
|
-
doc_procs=[], export_procs=[], exec_profile=True)
|
|
174
|
+
doc_procs=[], export_procs=[], exec_profile=True, cell_timeout=600)
|
|
175
175
|
|
|
176
176
|
_path_keys = 'lib_path', 'nbs_path', 'doc_path'
|
|
177
177
|
|
|
@@ -154,9 +154,10 @@ def nbdev_export(
|
|
|
154
154
|
procs = [import_obj(p) for p in procs] if procs else None
|
|
155
155
|
files = nbglob(path=path, as_path=True, **kwargs).sorted('name')
|
|
156
156
|
for f in files: nb_export(f, procs=procs)
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
157
|
+
if cfg.lib_path.exists():
|
|
158
|
+
add_init(cfg.lib_path)
|
|
159
|
+
update_llms_txt()
|
|
160
|
+
_build_modidx()
|
|
160
161
|
|
|
161
162
|
# %% ../nbs/api/05_doclinks.ipynb #3134c22b
|
|
162
163
|
typs = 'module','class','method','function'
|
|
@@ -51,7 +51,7 @@ def _remote_shas(s): return {o.split()[0] for o in s.splitlines()}
|
|
|
51
51
|
|
|
52
52
|
def _check_changelog_base(tag):
|
|
53
53
|
if _is_ancestor(tag): return
|
|
54
|
-
raise SystemExit(f'HEAD does not contain the latest release ({tag}). Write CHANGELOG.md manually, then run with --
|
|
54
|
+
raise SystemExit(f'HEAD does not contain the latest release ({tag}). Write CHANGELOG.md manually, then run with --no-changelog.')
|
|
55
55
|
|
|
56
56
|
def _release_head():
|
|
57
57
|
_release_branch()
|
|
@@ -335,7 +335,7 @@ def release_conda(
|
|
|
335
335
|
if skip_upload: return print(loc)
|
|
336
336
|
if not upload_user: upload_user = get_config().conda_user
|
|
337
337
|
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 `--
|
|
338
|
+
if 'anaconda upload' not in res: return print(f"{res}\n\nFailed. Check auto-upload not set in .condarc. Try `--do-build False`.")
|
|
339
339
|
return anaconda_upload(name, loc)
|
|
340
340
|
|
|
341
341
|
# %% ../nbs/api/18_release.ipynb #0500d972
|
|
@@ -75,7 +75,7 @@ Keep imports in dedicated import cells, define values near first use, reuse esta
|
|
|
75
75
|
|
|
76
76
|
# Directives
|
|
77
77
|
|
|
78
|
-
`#| default_exp` names the module. `#| export` marks exported cells. Underscore-prefixed helpers may export without joining the public API. `#| exportd` exports a code cell's source to the module docstring instead of the module. `#| hide` keeps necessary but distracting material off the page. `#| eval: false` is for cells that genuinely must not run, not for suppressing broken ones
|
|
78
|
+
`#| default_exp` names the module. `#| export` marks exported cells. Underscore-prefixed helpers may export without joining the public API. `#| exportd` exports a code cell's source to the module docstring instead of the module. `#| hide` keeps necessary but distracting material off the page. `#| eval: false` is for cells that genuinely must not run, not for suppressing broken ones. An unevaluated cell cannot create state for later evaluated cells.
|
|
79
79
|
|
|
80
80
|
# nbdev v3
|
|
81
81
|
|
|
@@ -86,4 +86,6 @@ Directives can also live in cell *metadata*, under the `nbdev` key (`{"nbdev": {
|
|
|
86
86
|
# Before you finish
|
|
87
87
|
|
|
88
88
|
A behavior change means revising the lesson cells it touches: prose, displayed output, and assertions move together. Where you revised or added an assertion, check it fails against the old code and passes against the new. Many changes need no new cell at all - never add one merely to witness a change. Re-read the touched section as a reader would, against the conventions above. Style damage breaks no test and no export, so the harm only shows on the docs page.
|
|
89
|
+
|
|
90
|
+
Run notebooks with `nbdev-test <nb>`.
|
|
89
91
|
"""
|
|
@@ -123,7 +123,7 @@ def _keep_file(
|
|
|
123
123
|
else: True
|
|
124
124
|
|
|
125
125
|
# %% ../nbs/api/12_test.ipynb #f8cc6a61-a48e-4ab1-89a9-18316ca795d6
|
|
126
|
-
@call_parse
|
|
126
|
+
@call_parse(pos=['path'])
|
|
127
127
|
@delegates(nbglob_cli)
|
|
128
128
|
def nbdev_test(
|
|
129
129
|
path:str=None, # A notebook name or glob to test
|
|
@@ -135,12 +135,13 @@ def nbdev_test(
|
|
|
135
135
|
ignore_fname:str='.notest', # Filename that will result in siblings being ignored
|
|
136
136
|
verbose:bool=False, # Print stdout/stderr from notebook cells?
|
|
137
137
|
save:bool=False, # Write outputs back to notebooks on success?
|
|
138
|
-
cell_timeout:int=
|
|
139
|
-
cell_timing_min:float=None, # Print cells slower than this many seconds (
|
|
138
|
+
cell_timeout:int=None, # Seconds before each cell times out (0: no limit; default `cell_timeout` config, 600)
|
|
139
|
+
cell_timing_min:float=None, # Print cells slower than this many seconds (default `cell_timing_min` config, else none)
|
|
140
140
|
**kwargs
|
|
141
141
|
):
|
|
142
142
|
"Test in parallel notebooks matching `path`, passing along `flags`"
|
|
143
143
|
cfg = get_config(Path(path).resolve() if path else None)
|
|
144
|
+
cell_timeout,cell_timing_min = ifnone(cell_timeout, cfg.cell_timeout),ifnone(cell_timing_min, cfg.get('cell_timing_min'))
|
|
144
145
|
skip_flags = cfg.tst_flags
|
|
145
146
|
if isinstance(skip_flags, str): skip_flags = skip_flags.split()
|
|
146
147
|
force_flags = flags.split()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|