nbdev 3.0.8__tar.gz → 3.0.10__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.0.8/nbdev.egg-info → nbdev-3.0.10}/PKG-INFO +43 -47
- {nbdev-3.0.8 → nbdev-3.0.10}/README.md +42 -46
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/__init__.py +1 -1
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/cli.py +3 -3
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/config.py +3 -3
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/doclinks.py +2 -2
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/export.py +1 -1
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/quarto.py +1 -1
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/release.py +1 -1
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/sync.py +1 -1
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/test.py +5 -3
- {nbdev-3.0.8 → nbdev-3.0.10/nbdev.egg-info}/PKG-INFO +43 -47
- {nbdev-3.0.8 → nbdev-3.0.10}/CONTRIBUTING.md +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/LICENSE +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/MANIFEST.in +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/_modidx.py +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/clean.py +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/diff.py +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/extract_attachments.py +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/frontmatter.py +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/imports.py +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/maker.py +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/merge.py +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/migrate.py +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/process.py +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/processors.py +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/qmd.py +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/scrubmagics.py +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/serve.py +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/serve_drv.py +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev/showdoc.py +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev.egg-info/SOURCES.txt +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev.egg-info/dependency_links.txt +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev.egg-info/entry_points.txt +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev.egg-info/requires.txt +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/nbdev.egg-info/top_level.txt +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/pyproject.toml +0 -0
- {nbdev-3.0.8 → nbdev-3.0.10}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nbdev
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.10
|
|
4
4
|
Summary: Create delightful software with Jupyter Notebooks
|
|
5
5
|
Author-email: "Jeremy Howard and the fast.ai community" <j@fast.ai>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -58,12 +58,10 @@ Python packaging standards ([PEP
|
|
|
58
58
|
lives in the standard `[project]` section, while nbdev-specific settings
|
|
59
59
|
go in `[tool.nbdev]`.
|
|
60
60
|
|
|
61
|
-
**Migrating from nbdev2:** Run
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
nbdev3-compatible versions. Your existing notebooks and code don’t need
|
|
66
|
-
any changes.
|
|
61
|
+
**Migrating from nbdev2:** Run `nbdev-migrate-config` in your project
|
|
62
|
+
root to automatically convert your `settings.ini` to `pyproject.toml`
|
|
63
|
+
and update your GitHub Actions workflows to use nbdev3-compatible
|
|
64
|
+
versions. Your existing notebooks and code don’t need any changes.
|
|
67
65
|
|
|
68
66
|
`nbdev` is a notebook-driven development platform. Simply write
|
|
69
67
|
notebooks with lightweight markup and get high-quality documentation,
|
|
@@ -86,8 +84,7 @@ practices because tests and documentation are first class.
|
|
|
86
84
|
- **Two-way sync between notebooks and plaintext source code** allowing
|
|
87
85
|
you to use your IDE for code navigation or quick edits. Sync is
|
|
88
86
|
robust: each exported cell is tagged with its unique notebook cell ID,
|
|
89
|
-
so
|
|
90
|
-
always updates the correct cell
|
|
87
|
+
so `nbdev-update` always updates the correct cell
|
|
91
88
|
- **Tests** written as ordinary notebook cells are run in parallel with
|
|
92
89
|
a single command
|
|
93
90
|
- **Continuous integration** out-of-the-box with [GitHub
|
|
@@ -129,47 +126,47 @@ walkthrough](https://youtu.be/67FdzLSt4aA) with coding sections sped up
|
|
|
129
126
|
using the `unsilence` Python library – it’s 27 minutes faster, but a bit
|
|
130
127
|
harder to follow.
|
|
131
128
|
|
|
132
|
-
You can also run `
|
|
129
|
+
You can also run `nbdev-help` from the terminal to see the full list of
|
|
133
130
|
available commands:
|
|
134
131
|
|
|
135
132
|
``` python
|
|
136
|
-
!
|
|
133
|
+
!nbdev-help
|
|
137
134
|
```
|
|
138
135
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
136
|
+
nb-export Export a single nbdev notebook to a python script.
|
|
137
|
+
nbdev-bump-version Increment version in __init__.py by one
|
|
138
|
+
nbdev-changelog Create a CHANGELOG.md file from closed and labeled GitHub issues
|
|
139
|
+
nbdev-clean Clean all notebooks in `fname` to avoid merge conflicts
|
|
140
|
+
nbdev-conda Create a `meta.yaml` file ready to be built into a package, and optionally build and upload it
|
|
141
|
+
nbdev-contributing Create CONTRIBUTING.md from contributing_nb (defaults to 'contributing.ipynb' if present). Skips if the file doesn't exist.
|
|
142
|
+
nbdev-create-config Create a pyproject.toml config file.
|
|
143
|
+
nbdev-docs Create Quarto docs and README.md
|
|
144
|
+
nbdev-export Export notebooks in `path` to Python modules
|
|
145
|
+
nbdev-filter A notebook filter for Quarto
|
|
146
|
+
nbdev-fix Create working notebook from conflicted notebook `nbname`
|
|
147
|
+
nbdev-help Show help for all console scripts
|
|
148
|
+
nbdev-install Install Quarto and the current library
|
|
149
|
+
nbdev-install-hooks Install Jupyter and git hooks to automatically clean, trust, and fix merge conflicts in notebooks
|
|
150
|
+
nbdev-install-quarto Install latest Quarto on macOS or Linux, prints instructions for Windows
|
|
151
|
+
nbdev-merge Git merge driver for notebooks
|
|
152
|
+
nbdev-migrate Convert all markdown and notebook files in `path` from v1 to v2
|
|
153
|
+
nbdev-migrate-config Migrate settings.ini to pyproject.toml
|
|
154
|
+
nbdev-new Create an nbdev project.
|
|
155
|
+
nbdev-prepare Export, test, and clean notebooks, and render README if needed
|
|
156
|
+
nbdev-preview Preview docs locally
|
|
157
|
+
nbdev-proc-nbs Process notebooks in `path` for docs rendering
|
|
158
|
+
nbdev-pypi Create and upload Python package to PyPI
|
|
159
|
+
nbdev-readme Create README.md from readme_nb (index.ipynb by default)
|
|
160
|
+
nbdev-release-both Release both conda and PyPI packages
|
|
161
|
+
nbdev-release-gh Calls `nbdev_changelog`, lets you edit the result, then pushes to git and calls `nbdev_release_git`
|
|
162
|
+
nbdev-release-git Tag and create a release in GitHub for the current version
|
|
163
|
+
nbdev-requirements Writes a `requirements.txt` file to `directory` based on pyproject.toml.
|
|
164
|
+
nbdev-sidebar Create sidebar.yml
|
|
165
|
+
nbdev-test Test in parallel notebooks matching `path`, passing along `flags`
|
|
166
|
+
nbdev-trust Trust notebooks matching `fname`.
|
|
167
|
+
nbdev-update Propagate change in modules matching `fname` to notebooks that created them
|
|
168
|
+
nbdev-update-license Allows you to update the license of your project.
|
|
169
|
+
watch-export Use `nb_export` on ipynb files in `nbs` directory on changes using nbdev config if available
|
|
173
170
|
|
|
174
171
|
## FAQ
|
|
175
172
|
|
|
@@ -248,8 +245,7 @@ strive to abide by generally accepted best practices in open-source
|
|
|
248
245
|
software development.
|
|
249
246
|
|
|
250
247
|
Make sure you have `nbdev`’s git hooks installed by running
|
|
251
|
-
|
|
252
|
-
in the cloned repository.
|
|
248
|
+
`nbdev-install-hooks` in the cloned repository.
|
|
253
249
|
|
|
254
250
|
## Copyright
|
|
255
251
|
|
|
@@ -14,12 +14,10 @@ Python packaging standards ([PEP
|
|
|
14
14
|
lives in the standard `[project]` section, while nbdev-specific settings
|
|
15
15
|
go in `[tool.nbdev]`.
|
|
16
16
|
|
|
17
|
-
**Migrating from nbdev2:** Run
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
nbdev3-compatible versions. Your existing notebooks and code don’t need
|
|
22
|
-
any changes.
|
|
17
|
+
**Migrating from nbdev2:** Run `nbdev-migrate-config` in your project
|
|
18
|
+
root to automatically convert your `settings.ini` to `pyproject.toml`
|
|
19
|
+
and update your GitHub Actions workflows to use nbdev3-compatible
|
|
20
|
+
versions. Your existing notebooks and code don’t need any changes.
|
|
23
21
|
|
|
24
22
|
`nbdev` is a notebook-driven development platform. Simply write
|
|
25
23
|
notebooks with lightweight markup and get high-quality documentation,
|
|
@@ -42,8 +40,7 @@ practices because tests and documentation are first class.
|
|
|
42
40
|
- **Two-way sync between notebooks and plaintext source code** allowing
|
|
43
41
|
you to use your IDE for code navigation or quick edits. Sync is
|
|
44
42
|
robust: each exported cell is tagged with its unique notebook cell ID,
|
|
45
|
-
so
|
|
46
|
-
always updates the correct cell
|
|
43
|
+
so `nbdev-update` always updates the correct cell
|
|
47
44
|
- **Tests** written as ordinary notebook cells are run in parallel with
|
|
48
45
|
a single command
|
|
49
46
|
- **Continuous integration** out-of-the-box with [GitHub
|
|
@@ -85,47 +82,47 @@ walkthrough](https://youtu.be/67FdzLSt4aA) with coding sections sped up
|
|
|
85
82
|
using the `unsilence` Python library – it’s 27 minutes faster, but a bit
|
|
86
83
|
harder to follow.
|
|
87
84
|
|
|
88
|
-
You can also run `
|
|
85
|
+
You can also run `nbdev-help` from the terminal to see the full list of
|
|
89
86
|
available commands:
|
|
90
87
|
|
|
91
88
|
``` python
|
|
92
|
-
!
|
|
89
|
+
!nbdev-help
|
|
93
90
|
```
|
|
94
91
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
92
|
+
nb-export Export a single nbdev notebook to a python script.
|
|
93
|
+
nbdev-bump-version Increment version in __init__.py by one
|
|
94
|
+
nbdev-changelog Create a CHANGELOG.md file from closed and labeled GitHub issues
|
|
95
|
+
nbdev-clean Clean all notebooks in `fname` to avoid merge conflicts
|
|
96
|
+
nbdev-conda Create a `meta.yaml` file ready to be built into a package, and optionally build and upload it
|
|
97
|
+
nbdev-contributing Create CONTRIBUTING.md from contributing_nb (defaults to 'contributing.ipynb' if present). Skips if the file doesn't exist.
|
|
98
|
+
nbdev-create-config Create a pyproject.toml config file.
|
|
99
|
+
nbdev-docs Create Quarto docs and README.md
|
|
100
|
+
nbdev-export Export notebooks in `path` to Python modules
|
|
101
|
+
nbdev-filter A notebook filter for Quarto
|
|
102
|
+
nbdev-fix Create working notebook from conflicted notebook `nbname`
|
|
103
|
+
nbdev-help Show help for all console scripts
|
|
104
|
+
nbdev-install Install Quarto and the current library
|
|
105
|
+
nbdev-install-hooks Install Jupyter and git hooks to automatically clean, trust, and fix merge conflicts in notebooks
|
|
106
|
+
nbdev-install-quarto Install latest Quarto on macOS or Linux, prints instructions for Windows
|
|
107
|
+
nbdev-merge Git merge driver for notebooks
|
|
108
|
+
nbdev-migrate Convert all markdown and notebook files in `path` from v1 to v2
|
|
109
|
+
nbdev-migrate-config Migrate settings.ini to pyproject.toml
|
|
110
|
+
nbdev-new Create an nbdev project.
|
|
111
|
+
nbdev-prepare Export, test, and clean notebooks, and render README if needed
|
|
112
|
+
nbdev-preview Preview docs locally
|
|
113
|
+
nbdev-proc-nbs Process notebooks in `path` for docs rendering
|
|
114
|
+
nbdev-pypi Create and upload Python package to PyPI
|
|
115
|
+
nbdev-readme Create README.md from readme_nb (index.ipynb by default)
|
|
116
|
+
nbdev-release-both Release both conda and PyPI packages
|
|
117
|
+
nbdev-release-gh Calls `nbdev_changelog`, lets you edit the result, then pushes to git and calls `nbdev_release_git`
|
|
118
|
+
nbdev-release-git Tag and create a release in GitHub for the current version
|
|
119
|
+
nbdev-requirements Writes a `requirements.txt` file to `directory` based on pyproject.toml.
|
|
120
|
+
nbdev-sidebar Create sidebar.yml
|
|
121
|
+
nbdev-test Test in parallel notebooks matching `path`, passing along `flags`
|
|
122
|
+
nbdev-trust Trust notebooks matching `fname`.
|
|
123
|
+
nbdev-update Propagate change in modules matching `fname` to notebooks that created them
|
|
124
|
+
nbdev-update-license Allows you to update the license of your project.
|
|
125
|
+
watch-export Use `nb_export` on ipynb files in `nbs` directory on changes using nbdev config if available
|
|
129
126
|
|
|
130
127
|
## FAQ
|
|
131
128
|
|
|
@@ -204,8 +201,7 @@ strive to abide by generally accepted best practices in open-source
|
|
|
204
201
|
software development.
|
|
205
202
|
|
|
206
203
|
Make sure you have `nbdev`’s git hooks installed by running
|
|
207
|
-
|
|
208
|
-
in the cloned repository.
|
|
204
|
+
`nbdev-install-hooks` in the cloned repository.
|
|
209
205
|
|
|
210
206
|
## Copyright
|
|
211
207
|
|
|
@@ -184,16 +184,16 @@ def watch_export(nbs:str=None, # Nb directory to watch for changes
|
|
|
184
184
|
lib = lib or (cfg.lib_path if cfg else '.')
|
|
185
185
|
if cfg and (nbs != cfg.nbs_path or lib != cfg.lib_path) and not force:
|
|
186
186
|
raise ValueError("In nbdev project. Use --force to override config.")
|
|
187
|
-
run(
|
|
187
|
+
run('nbdev-export')
|
|
188
188
|
def _export(e,lib=lib):
|
|
189
189
|
p = e.src_path
|
|
190
190
|
if (not '.ipynb_checkpoints' in p and p.endswith('.ipynb') and not Path(p).name.startswith(('tmp','.~'))):
|
|
191
191
|
if e.event_type == 'modified':
|
|
192
192
|
time.sleep(0.1)
|
|
193
|
-
try: run(f'
|
|
193
|
+
try: run(f'nb-export --lib_path {lib} "{p}"')
|
|
194
194
|
except IOError:
|
|
195
195
|
time.sleep(0.3)
|
|
196
|
-
run(f'
|
|
196
|
+
run(f'nb-export --lib_path {lib} "{p}"')
|
|
197
197
|
with fs_watchdog(_export, nbs):
|
|
198
198
|
while True: time.sleep(1)
|
|
199
199
|
|
|
@@ -152,7 +152,7 @@ def _load_toml(p):
|
|
|
152
152
|
|
|
153
153
|
def _has_nbdev(p):
|
|
154
154
|
"True if pyproject.toml at `p` has [tool.nbdev]"
|
|
155
|
-
try: return
|
|
155
|
+
try: return _load_toml(p).get('tool', {}).get('nbdev') is not None
|
|
156
156
|
except Exception: return False
|
|
157
157
|
|
|
158
158
|
def _find_nbdev_pyproject(path=None):
|
|
@@ -163,11 +163,11 @@ def _find_nbdev_pyproject(path=None):
|
|
|
163
163
|
if f.exists() and _has_nbdev(f): return f
|
|
164
164
|
for d in [p] + list(p.parents):
|
|
165
165
|
if (d/'settings.ini').exists():
|
|
166
|
-
raise ValueError(f"Found old settings.ini. Migrate to pyproject.toml using `
|
|
166
|
+
raise ValueError(f"Found old settings.ini. Migrate to pyproject.toml using `nbdev-migrate-config`. See https://nbdev.fast.ai/getting_started.html")
|
|
167
167
|
|
|
168
168
|
# %% ../nbs/api/01_config.ipynb #3dac70e0
|
|
169
169
|
nbdev_defaults = dict(nbs_path='nbs', doc_path='_docs', tst_flags='notest', recursive=True, readme_nb='index.ipynb',
|
|
170
|
-
clean_ids=True, clear_all=False, put_version_in_init=True, jupyter_hooks=False, branch='main',
|
|
170
|
+
clean_ids=True, clear_all=False, put_version_in_init=True, jupyter_hooks=False, custom_sidebar=False, branch='main',
|
|
171
171
|
doc_procs=[], export_procs=[])
|
|
172
172
|
|
|
173
173
|
_path_keys = 'lib_path', 'nbs_path', 'doc_path'
|
|
@@ -64,7 +64,7 @@ def _iter_py_cells(p):
|
|
|
64
64
|
nb = ' '.join(parts[:-1])
|
|
65
65
|
else:
|
|
66
66
|
raise ValueError(f"Cell ID required but not found in '{p}' at:\n```\n# %% {top}\n```\n"
|
|
67
|
-
"Run `
|
|
67
|
+
"Run `nbdev-export` to regenerate .py files with cell IDs.")
|
|
68
68
|
if nb=='auto': continue # Skip auto-generated __all__ cell
|
|
69
69
|
nb_path = (p.parent/nb).resolve() # NB paths are stored relative to .py file
|
|
70
70
|
if code.endswith('\n'): code=code[:-1]
|
|
@@ -147,7 +147,7 @@ def nbdev_export(
|
|
|
147
147
|
**kwargs):
|
|
148
148
|
"Export notebooks in `path` to Python modules"
|
|
149
149
|
if os.environ.get('IN_TEST',0): return
|
|
150
|
-
if not is_nbdev(): raise Exception('`
|
|
150
|
+
if not is_nbdev(): raise Exception('`nbdev-export` must be called from a directory within a nbdev project.')
|
|
151
151
|
cfg = get_config()
|
|
152
152
|
procs = procs.split() if procs else cfg.get('export_procs', [])
|
|
153
153
|
procs = [import_obj(p) for p in procs] if procs else None
|
|
@@ -53,7 +53,7 @@ def nb_export(nbname:str, # Filename of notebook
|
|
|
53
53
|
nm = ifnone(name, getattr(exp, 'default_exp', None) if mod=='#' else mod)
|
|
54
54
|
if not nm:
|
|
55
55
|
warn(f"Notebook '{nbname}' uses `#| export` without `#| default_exp` cell.\n"
|
|
56
|
-
"Note nbdev2 no longer supports nbdev1 syntax. Run `
|
|
56
|
+
"Note nbdev2 no longer supports nbdev1 syntax. Run `nbdev-migrate` to upgrade.\n"
|
|
57
57
|
"See https://nbdev.fast.ai/getting_started.html for more information.")
|
|
58
58
|
return
|
|
59
59
|
mm = mod_maker(dest=lib_path, name=nm, nb_path=nbname, is_new=bool(name) or mod=='#', solo_nb=solo_nb)
|
|
@@ -223,7 +223,7 @@ def _doc_mtime_not_older(readme_path, readme_nb_path):
|
|
|
223
223
|
|
|
224
224
|
# %% ../nbs/api/14_quarto.ipynb #7b70b5c8
|
|
225
225
|
class _SidebarYmlRemoved:
|
|
226
|
-
"Context manager for `
|
|
226
|
+
"Context manager for `nbdev-readme` to avoid rendering whole docs website"
|
|
227
227
|
def __init__(self,path): self._path=path
|
|
228
228
|
def __enter__(self):
|
|
229
229
|
self._yml_path = self._path/'sidebar.yml'
|
|
@@ -127,7 +127,7 @@ def release_git(token:str=None):
|
|
|
127
127
|
def release_gh(
|
|
128
128
|
token:str=None # Optional GitHub token (otherwise `token` file is used)
|
|
129
129
|
):
|
|
130
|
-
"Calls `
|
|
130
|
+
"Calls `nbdev-changelog`, lets you edit the result, then pushes to git and calls `nbdev-release-git`"
|
|
131
131
|
cfg = _find_config()
|
|
132
132
|
Release().changelog()
|
|
133
133
|
subprocess.run([os.environ.get('EDITOR','nano'), cfg.config_path/'CHANGELOG.md'])
|
|
@@ -73,7 +73,7 @@ def _update_mod(py_path, lib_dir):
|
|
|
73
73
|
@call_parse
|
|
74
74
|
def nbdev_update(fname:str=None): # A Python file name to update
|
|
75
75
|
"Propagate change in modules matching `fname` to notebooks that created them"
|
|
76
|
-
if fname and fname.endswith('.ipynb'): raise ValueError("`
|
|
76
|
+
if fname and fname.endswith('.ipynb'): raise ValueError("`nbdev-update` operates on .py files. If you wish to convert notebooks instead, see `nbdev-export`.")
|
|
77
77
|
if os.environ.get('IN_TEST',0): return
|
|
78
78
|
cfg = get_config()
|
|
79
79
|
fname = Path(fname or cfg.lib_path)
|
|
@@ -28,7 +28,8 @@ def test_nb(fn, # file name of notebook to test
|
|
|
28
28
|
force_flags=None, # list of flags marking cells to always run
|
|
29
29
|
do_print=False, # print completion?
|
|
30
30
|
showerr=True, # print errors to stderr?
|
|
31
|
-
basepath=None
|
|
31
|
+
basepath=None, # path to add to sys.path
|
|
32
|
+
verbose=False): # stream stdout/stderr from cells to console?
|
|
32
33
|
"Execute tests in notebook in `fn` except those with `skip_flags`"
|
|
33
34
|
if basepath: sys.path.insert(0, str(basepath))
|
|
34
35
|
if not IN_NOTEBOOK: os.environ["IN_TEST"] = '1'
|
|
@@ -49,7 +50,7 @@ def test_nb(fn, # file name of notebook to test
|
|
|
49
50
|
if do_print: print(f'Starting {fn}')
|
|
50
51
|
try:
|
|
51
52
|
with working_directory(fn.parent):
|
|
52
|
-
k.run_all(nb, exc_stop=True, preproc=_no_eval)
|
|
53
|
+
k.run_all(nb, exc_stop=True, preproc=_no_eval, verbose=verbose)
|
|
53
54
|
res = True
|
|
54
55
|
except:
|
|
55
56
|
if showerr: sys.stderr.write(k.prettytb(fname=fn)+'\n')
|
|
@@ -76,6 +77,7 @@ def nbdev_test(
|
|
|
76
77
|
do_print:bool=False, # Print start and end of each notebook
|
|
77
78
|
pause:float=0.01, # Pause time (in seconds) between notebooks to avoid race conditions
|
|
78
79
|
ignore_fname:str='.notest', # Filename that will result in siblings being ignored
|
|
80
|
+
verbose:bool=False, # Print stdout/stderr from notebook cells?
|
|
79
81
|
**kwargs):
|
|
80
82
|
"Test in parallel notebooks matching `path`, passing along `flags`"
|
|
81
83
|
skip_flags = get_config().tst_flags
|
|
@@ -90,7 +92,7 @@ def nbdev_test(
|
|
|
90
92
|
wd_pth = get_config().nbs_path
|
|
91
93
|
with working_directory(wd_pth if (wd_pth and wd_pth.exists()) else os.getcwd()):
|
|
92
94
|
results = parallel(test_nb, files, skip_flags=skip_flags, force_flags=force_flags, n_workers=n_workers,
|
|
93
|
-
basepath=get_config().config_path, pause=pause, do_print=do_print, **kw)
|
|
95
|
+
basepath=get_config().config_path, pause=pause, do_print=do_print, verbose=verbose, **kw)
|
|
94
96
|
passed,times = zip(*results)
|
|
95
97
|
if all(passed): print("Success.")
|
|
96
98
|
else:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nbdev
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.10
|
|
4
4
|
Summary: Create delightful software with Jupyter Notebooks
|
|
5
5
|
Author-email: "Jeremy Howard and the fast.ai community" <j@fast.ai>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -58,12 +58,10 @@ Python packaging standards ([PEP
|
|
|
58
58
|
lives in the standard `[project]` section, while nbdev-specific settings
|
|
59
59
|
go in `[tool.nbdev]`.
|
|
60
60
|
|
|
61
|
-
**Migrating from nbdev2:** Run
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
nbdev3-compatible versions. Your existing notebooks and code don’t need
|
|
66
|
-
any changes.
|
|
61
|
+
**Migrating from nbdev2:** Run `nbdev-migrate-config` in your project
|
|
62
|
+
root to automatically convert your `settings.ini` to `pyproject.toml`
|
|
63
|
+
and update your GitHub Actions workflows to use nbdev3-compatible
|
|
64
|
+
versions. Your existing notebooks and code don’t need any changes.
|
|
67
65
|
|
|
68
66
|
`nbdev` is a notebook-driven development platform. Simply write
|
|
69
67
|
notebooks with lightweight markup and get high-quality documentation,
|
|
@@ -86,8 +84,7 @@ practices because tests and documentation are first class.
|
|
|
86
84
|
- **Two-way sync between notebooks and plaintext source code** allowing
|
|
87
85
|
you to use your IDE for code navigation or quick edits. Sync is
|
|
88
86
|
robust: each exported cell is tagged with its unique notebook cell ID,
|
|
89
|
-
so
|
|
90
|
-
always updates the correct cell
|
|
87
|
+
so `nbdev-update` always updates the correct cell
|
|
91
88
|
- **Tests** written as ordinary notebook cells are run in parallel with
|
|
92
89
|
a single command
|
|
93
90
|
- **Continuous integration** out-of-the-box with [GitHub
|
|
@@ -129,47 +126,47 @@ walkthrough](https://youtu.be/67FdzLSt4aA) with coding sections sped up
|
|
|
129
126
|
using the `unsilence` Python library – it’s 27 minutes faster, but a bit
|
|
130
127
|
harder to follow.
|
|
131
128
|
|
|
132
|
-
You can also run `
|
|
129
|
+
You can also run `nbdev-help` from the terminal to see the full list of
|
|
133
130
|
available commands:
|
|
134
131
|
|
|
135
132
|
``` python
|
|
136
|
-
!
|
|
133
|
+
!nbdev-help
|
|
137
134
|
```
|
|
138
135
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
136
|
+
nb-export Export a single nbdev notebook to a python script.
|
|
137
|
+
nbdev-bump-version Increment version in __init__.py by one
|
|
138
|
+
nbdev-changelog Create a CHANGELOG.md file from closed and labeled GitHub issues
|
|
139
|
+
nbdev-clean Clean all notebooks in `fname` to avoid merge conflicts
|
|
140
|
+
nbdev-conda Create a `meta.yaml` file ready to be built into a package, and optionally build and upload it
|
|
141
|
+
nbdev-contributing Create CONTRIBUTING.md from contributing_nb (defaults to 'contributing.ipynb' if present). Skips if the file doesn't exist.
|
|
142
|
+
nbdev-create-config Create a pyproject.toml config file.
|
|
143
|
+
nbdev-docs Create Quarto docs and README.md
|
|
144
|
+
nbdev-export Export notebooks in `path` to Python modules
|
|
145
|
+
nbdev-filter A notebook filter for Quarto
|
|
146
|
+
nbdev-fix Create working notebook from conflicted notebook `nbname`
|
|
147
|
+
nbdev-help Show help for all console scripts
|
|
148
|
+
nbdev-install Install Quarto and the current library
|
|
149
|
+
nbdev-install-hooks Install Jupyter and git hooks to automatically clean, trust, and fix merge conflicts in notebooks
|
|
150
|
+
nbdev-install-quarto Install latest Quarto on macOS or Linux, prints instructions for Windows
|
|
151
|
+
nbdev-merge Git merge driver for notebooks
|
|
152
|
+
nbdev-migrate Convert all markdown and notebook files in `path` from v1 to v2
|
|
153
|
+
nbdev-migrate-config Migrate settings.ini to pyproject.toml
|
|
154
|
+
nbdev-new Create an nbdev project.
|
|
155
|
+
nbdev-prepare Export, test, and clean notebooks, and render README if needed
|
|
156
|
+
nbdev-preview Preview docs locally
|
|
157
|
+
nbdev-proc-nbs Process notebooks in `path` for docs rendering
|
|
158
|
+
nbdev-pypi Create and upload Python package to PyPI
|
|
159
|
+
nbdev-readme Create README.md from readme_nb (index.ipynb by default)
|
|
160
|
+
nbdev-release-both Release both conda and PyPI packages
|
|
161
|
+
nbdev-release-gh Calls `nbdev_changelog`, lets you edit the result, then pushes to git and calls `nbdev_release_git`
|
|
162
|
+
nbdev-release-git Tag and create a release in GitHub for the current version
|
|
163
|
+
nbdev-requirements Writes a `requirements.txt` file to `directory` based on pyproject.toml.
|
|
164
|
+
nbdev-sidebar Create sidebar.yml
|
|
165
|
+
nbdev-test Test in parallel notebooks matching `path`, passing along `flags`
|
|
166
|
+
nbdev-trust Trust notebooks matching `fname`.
|
|
167
|
+
nbdev-update Propagate change in modules matching `fname` to notebooks that created them
|
|
168
|
+
nbdev-update-license Allows you to update the license of your project.
|
|
169
|
+
watch-export Use `nb_export` on ipynb files in `nbs` directory on changes using nbdev config if available
|
|
173
170
|
|
|
174
171
|
## FAQ
|
|
175
172
|
|
|
@@ -248,8 +245,7 @@ strive to abide by generally accepted best practices in open-source
|
|
|
248
245
|
software development.
|
|
249
246
|
|
|
250
247
|
Make sure you have `nbdev`’s git hooks installed by running
|
|
251
|
-
|
|
252
|
-
in the cloned repository.
|
|
248
|
+
`nbdev-install-hooks` in the cloned repository.
|
|
253
249
|
|
|
254
250
|
## Copyright
|
|
255
251
|
|
|
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
|