nbdev 2.3.13__tar.gz → 2.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.
Files changed (38) hide show
  1. {nbdev-2.3.13/nbdev.egg-info → nbdev-2.3.15}/PKG-INFO +31 -43
  2. {nbdev-2.3.13 → nbdev-2.3.15}/README.md +29 -42
  3. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/__init__.py +1 -1
  4. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/_modidx.py +2 -1
  5. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/cli.py +64 -9
  6. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/config.py +2 -0
  7. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/quarto.py +5 -1
  8. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/release.py +3 -2
  9. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/serve.py +1 -1
  10. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/showdoc.py +2 -2
  11. {nbdev-2.3.13 → nbdev-2.3.15/nbdev.egg-info}/PKG-INFO +31 -43
  12. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev.egg-info/entry_points.txt +1 -0
  13. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev.egg-info/requires.txt +1 -0
  14. {nbdev-2.3.13 → nbdev-2.3.15}/settings.ini +2 -1
  15. {nbdev-2.3.13 → nbdev-2.3.15}/setup.py +2 -1
  16. {nbdev-2.3.13 → nbdev-2.3.15}/CONTRIBUTING.md +0 -0
  17. {nbdev-2.3.13 → nbdev-2.3.15}/LICENSE +0 -0
  18. {nbdev-2.3.13 → nbdev-2.3.15}/MANIFEST.in +0 -0
  19. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/clean.py +0 -0
  20. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/doclinks.py +0 -0
  21. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/export.py +0 -0
  22. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/extract_attachments.py +0 -0
  23. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/frontmatter.py +0 -0
  24. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/imports.py +0 -0
  25. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/maker.py +0 -0
  26. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/merge.py +0 -0
  27. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/migrate.py +0 -0
  28. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/process.py +0 -0
  29. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/processors.py +0 -0
  30. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/qmd.py +0 -0
  31. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/serve_drv.py +0 -0
  32. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/sync.py +0 -0
  33. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev/test.py +0 -0
  34. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev.egg-info/SOURCES.txt +0 -0
  35. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev.egg-info/dependency_links.txt +0 -0
  36. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev.egg-info/not-zip-safe +0 -0
  37. {nbdev-2.3.13 → nbdev-2.3.15}/nbdev.egg-info/top_level.txt +0 -0
  38. {nbdev-2.3.13 → nbdev-2.3.15}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nbdev
3
- Version: 2.3.13
3
+ Version: 2.3.15
4
4
  Summary: Create delightful software with Jupyter Notebooks
5
5
  Home-page: https://github.com/fastai/nbdev
6
6
  Author: Jeremy Howard and Hamel Husain
@@ -20,6 +20,7 @@ Classifier: License :: OSI Approved :: Apache Software License
20
20
  Requires-Python: >=3.7
21
21
  Description-Content-Type: text/markdown
22
22
  License-File: LICENSE
23
+ Requires-Dist: packaging
23
24
  Requires-Dist: ipywidgets<=8.0.4
24
25
  Requires-Dist: fastcore>=1.5.27
25
26
  Requires-Dist: execnb>=0.1.4
@@ -39,19 +40,11 @@ Requires-Dist: jupyter; extra == "dev"
39
40
 
40
41
  # Getting Started
41
42
 
43
+
42
44
  <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
43
45
 
44
46
  ![CI](https://github.com/fastai/nbdev/actions/workflows/test.yaml/badge.svg)
45
47
 
46
- *NB: This is nbdev v2, a major upgrade of nbdev. Whilst the differences
47
- to nbdev1 aren’t huge, it does require some changes. The old version
48
- docs are at [nbdev1.fast.ai](https://nbdev1.fast.ai). You can use
49
- version-pinning in `settings.ini` (i.e `'nbdev<2'`) to stop nbdev from
50
- upgrading. To upgrade, follow the [migration
51
- tutorial](https://nbdev.fast.ai/migrating.html).*
52
-
53
- ------------------------------------------------------------------------
54
-
55
48
  `nbdev` is a notebook-driven development platform. Simply write
56
49
  notebooks with lightweight markup and get high-quality documentation,
57
50
  tests, continuous integration, and packaging for free!
@@ -109,15 +102,11 @@ The best way to learn how to use nbdev is to complete either the
109
102
  [written walkthrough](https://nbdev.fast.ai/tutorials/tutorial.html) or
110
103
  video walkthrough:
111
104
 
112
- <div>
113
-
114
105
  <a href="http://www.youtube.com/watch?v=l7zS8Ld4_iA" target="_blank"
115
106
  title="nbdev walkthrough"><img
116
107
  src="https://github.com/fastai/logos/raw/main/nbdev_walkthrough.png"
117
108
  style="border-radius: 10px" width="560" height="315" /></a>
118
109
 
119
- </div>
120
-
121
110
  Alternatively, there’s a [shortened version of the video
122
111
  walkthrough](https://youtu.be/67FdzLSt4aA) with coding sections sped up
123
112
  using the `unsilence` Python library – it’s 27 minutes faster, but a bit
@@ -130,35 +119,34 @@ available commands:
130
119
  !nbdev_help
131
120
  ```
132
121
 
133
- nbdev_bump_version Increment version in settings.ini by one
134
- nbdev_changelog Create a CHANGELOG.md file from closed and labeled GitHub issues
135
- nbdev_clean Clean all notebooks in `fname` to avoid merge conflicts
136
- nbdev_conda Create a `meta.yaml` file ready to be built into a package, and optionally build and upload it
137
- nbdev_create_config Create a config file.
138
- nbdev_deploy Deploy docs to GitHub Pages
139
- nbdev_docs Create Quarto docs and README.md
140
- nbdev_export Export notebooks in `path` to Python modules
141
- nbdev_filter A notebook filter for Quarto
142
- nbdev_fix Create working notebook from conflicted notebook `nbname`
143
- nbdev_help Show help for all console scripts
144
- nbdev_install Install Quarto and the current library
145
- nbdev_install_hooks Install Jupyter and git hooks to automatically clean, trust, and fix merge conflicts in notebooks
146
- nbdev_install_quarto Install latest Quarto on macOS or Linux, prints instructions for Windows
147
- nbdev_merge Git merge driver for notebooks
148
- nbdev_migrate Convert all directives and callouts in `fname` from v1 to v2
149
- nbdev_new Create an nbdev project.
150
- nbdev_prepare Export, test, and clean notebooks, and render README if needed
151
- nbdev_preview Preview docs locally
152
- nbdev_proc_nbs Process notebooks in `path` for docs rendering
153
- nbdev_pypi Create and upload Python package to PyPI
154
- nbdev_readme None
155
- nbdev_release_both Release both conda and PyPI packages
156
- nbdev_release_gh Calls `nbdev_changelog`, lets you edit the result, then pushes to git and calls `nbdev_release_git`
157
- nbdev_release_git Tag and create a release in GitHub for the current version
158
- nbdev_sidebar Create sidebar.yml
159
- nbdev_test Test in parallel notebooks matching `path`, passing along `flags`
160
- nbdev_trust Trust notebooks matching `fname`
161
- nbdev_update Propagate change in modules matching `fname` to notebooks that created them
122
+ nbdev_bump_version Increment version in settings.ini by one
123
+ nbdev_changelog Create a CHANGELOG.md file from closed and labeled GitHub issues
124
+ nbdev_clean Clean all notebooks in `fname` to avoid merge conflicts
125
+ nbdev_conda Create a `meta.yaml` file ready to be built into a package, and optionally build and upload it
126
+ nbdev_create_config Create a config file.
127
+ nbdev_docs Create Quarto docs and README.md
128
+ nbdev_export Export notebooks in `path` to Python modules
129
+ nbdev_filter A notebook filter for Quarto
130
+ nbdev_fix Create working notebook from conflicted notebook `nbname`
131
+ nbdev_help Show help for all console scripts
132
+ nbdev_install Install Quarto and the current library
133
+ nbdev_install_hooks Install Jupyter and git hooks to automatically clean, trust, and fix merge conflicts in notebooks
134
+ nbdev_install_quarto Install latest Quarto on macOS or Linux, prints instructions for Windows
135
+ nbdev_merge Git merge driver for notebooks
136
+ nbdev_migrate Convert all markdown and notebook files in `path` from v1 to v2
137
+ nbdev_new Create an nbdev project.
138
+ nbdev_prepare Export, test, and clean notebooks, and render README if needed
139
+ nbdev_preview Preview docs locally
140
+ nbdev_proc_nbs Process notebooks in `path` for docs rendering
141
+ nbdev_pypi Create and upload Python package to PyPI
142
+ nbdev_readme Create README.md from readme_nb (index.ipynb by default)
143
+ nbdev_release_both Release both conda and PyPI packages
144
+ nbdev_release_gh Calls `nbdev_changelog`, lets you edit the result, then pushes to git and calls `nbdev_release_git`
145
+ nbdev_release_git Tag and create a release in GitHub for the current version
146
+ nbdev_sidebar Create sidebar.yml
147
+ nbdev_test Test in parallel notebooks matching `path`, passing along `flags`
148
+ nbdev_trust Trust notebooks matching `fname`
149
+ nbdev_update Propagate change in modules matching `fname` to notebooks that created them
162
150
 
163
151
  ## FAQ
164
152
 
@@ -1,18 +1,10 @@
1
1
  # Getting Started
2
2
 
3
+
3
4
  <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
4
5
 
5
6
  ![CI](https://github.com/fastai/nbdev/actions/workflows/test.yaml/badge.svg)
6
7
 
7
- *NB: This is nbdev v2, a major upgrade of nbdev. Whilst the differences
8
- to nbdev1 aren’t huge, it does require some changes. The old version
9
- docs are at [nbdev1.fast.ai](https://nbdev1.fast.ai). You can use
10
- version-pinning in `settings.ini` (i.e `'nbdev<2'`) to stop nbdev from
11
- upgrading. To upgrade, follow the [migration
12
- tutorial](https://nbdev.fast.ai/migrating.html).*
13
-
14
- ------------------------------------------------------------------------
15
-
16
8
  `nbdev` is a notebook-driven development platform. Simply write
17
9
  notebooks with lightweight markup and get high-quality documentation,
18
10
  tests, continuous integration, and packaging for free!
@@ -70,15 +62,11 @@ The best way to learn how to use nbdev is to complete either the
70
62
  [written walkthrough](https://nbdev.fast.ai/tutorials/tutorial.html) or
71
63
  video walkthrough:
72
64
 
73
- <div>
74
-
75
65
  <a href="http://www.youtube.com/watch?v=l7zS8Ld4_iA" target="_blank"
76
66
  title="nbdev walkthrough"><img
77
67
  src="https://github.com/fastai/logos/raw/main/nbdev_walkthrough.png"
78
68
  style="border-radius: 10px" width="560" height="315" /></a>
79
69
 
80
- </div>
81
-
82
70
  Alternatively, there’s a [shortened version of the video
83
71
  walkthrough](https://youtu.be/67FdzLSt4aA) with coding sections sped up
84
72
  using the `unsilence` Python library – it’s 27 minutes faster, but a bit
@@ -91,35 +79,34 @@ available commands:
91
79
  !nbdev_help
92
80
  ```
93
81
 
94
- nbdev_bump_version Increment version in settings.ini by one
95
- nbdev_changelog Create a CHANGELOG.md file from closed and labeled GitHub issues
96
- nbdev_clean Clean all notebooks in `fname` to avoid merge conflicts
97
- nbdev_conda Create a `meta.yaml` file ready to be built into a package, and optionally build and upload it
98
- nbdev_create_config Create a config file.
99
- nbdev_deploy Deploy docs to GitHub Pages
100
- nbdev_docs Create Quarto docs and README.md
101
- nbdev_export Export notebooks in `path` to Python modules
102
- nbdev_filter A notebook filter for Quarto
103
- nbdev_fix Create working notebook from conflicted notebook `nbname`
104
- nbdev_help Show help for all console scripts
105
- nbdev_install Install Quarto and the current library
106
- nbdev_install_hooks Install Jupyter and git hooks to automatically clean, trust, and fix merge conflicts in notebooks
107
- nbdev_install_quarto Install latest Quarto on macOS or Linux, prints instructions for Windows
108
- nbdev_merge Git merge driver for notebooks
109
- nbdev_migrate Convert all directives and callouts in `fname` from v1 to v2
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 None
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_sidebar Create sidebar.yml
120
- nbdev_test Test in parallel notebooks matching `path`, passing along `flags`
121
- nbdev_trust Trust notebooks matching `fname`
122
- nbdev_update Propagate change in modules matching `fname` to notebooks that created them
82
+ nbdev_bump_version Increment version in settings.ini by one
83
+ nbdev_changelog Create a CHANGELOG.md file from closed and labeled GitHub issues
84
+ nbdev_clean Clean all notebooks in `fname` to avoid merge conflicts
85
+ nbdev_conda Create a `meta.yaml` file ready to be built into a package, and optionally build and upload it
86
+ nbdev_create_config Create a config file.
87
+ nbdev_docs Create Quarto docs and README.md
88
+ nbdev_export Export notebooks in `path` to Python modules
89
+ nbdev_filter A notebook filter for Quarto
90
+ nbdev_fix Create working notebook from conflicted notebook `nbname`
91
+ nbdev_help Show help for all console scripts
92
+ nbdev_install Install Quarto and the current library
93
+ nbdev_install_hooks Install Jupyter and git hooks to automatically clean, trust, and fix merge conflicts in notebooks
94
+ nbdev_install_quarto Install latest Quarto on macOS or Linux, prints instructions for Windows
95
+ nbdev_merge Git merge driver for notebooks
96
+ nbdev_migrate Convert all markdown and notebook files in `path` from v1 to v2
97
+ nbdev_new Create an nbdev project.
98
+ nbdev_prepare Export, test, and clean notebooks, and render README if needed
99
+ nbdev_preview Preview docs locally
100
+ nbdev_proc_nbs Process notebooks in `path` for docs rendering
101
+ nbdev_pypi Create and upload Python package to PyPI
102
+ nbdev_readme Create README.md from readme_nb (index.ipynb by default)
103
+ nbdev_release_both Release both conda and PyPI packages
104
+ nbdev_release_gh Calls `nbdev_changelog`, lets you edit the result, then pushes to git and calls `nbdev_release_git`
105
+ nbdev_release_git Tag and create a release in GitHub for the current version
106
+ nbdev_sidebar Create sidebar.yml
107
+ nbdev_test Test in parallel notebooks matching `path`, passing along `flags`
108
+ nbdev_trust Trust notebooks matching `fname`
109
+ nbdev_update Propagate change in modules matching `fname` to notebooks that created them
123
110
 
124
111
  ## FAQ
125
112
 
@@ -1,4 +1,4 @@
1
- __version__ = "2.3.13"
1
+ __version__ = "2.3.15"
2
2
 
3
3
  from .doclinks import nbdev_export
4
4
  from .showdoc import show_doc
@@ -24,7 +24,8 @@ d = { 'settings': { 'branch': 'master',
24
24
  'nbdev.cli.chelp': ('api/cli.html#chelp', 'nbdev/cli.py'),
25
25
  'nbdev.cli.extract_tgz': ('api/cli.html#extract_tgz', 'nbdev/cli.py'),
26
26
  'nbdev.cli.nbdev_filter': ('api/cli.html#nbdev_filter', 'nbdev/cli.py'),
27
- 'nbdev.cli.nbdev_new': ('api/cli.html#nbdev_new', 'nbdev/cli.py')},
27
+ 'nbdev.cli.nbdev_new': ('api/cli.html#nbdev_new', 'nbdev/cli.py'),
28
+ 'nbdev.cli.nbdev_update_license': ('api/cli.html#nbdev_update_license', 'nbdev/cli.py')},
28
29
  'nbdev.config': { 'nbdev.config._apply_defaults': ('api/config.html#_apply_defaults', 'nbdev/config.py'),
29
30
  'nbdev.config._basic_export_nb': ('api/config.html#_basic_export_nb', 'nbdev/config.py'),
30
31
  'nbdev.config._cfg2txt': ('api/config.html#_cfg2txt', 'nbdev/config.py'),
@@ -25,7 +25,7 @@ from contextlib import redirect_stdout
25
25
  import os, tarfile, sys
26
26
 
27
27
  # %% auto 0
28
- __all__ = ['nbdev_filter', 'extract_tgz', 'nbdev_new', 'chelp']
28
+ __all__ = ['mapping', 'nbdev_filter', 'extract_tgz', 'nbdev_new', 'nbdev_update_license', 'chelp']
29
29
 
30
30
  # %% ../nbs/api/13_cli.ipynb 5
31
31
  @call_parse
@@ -67,7 +67,7 @@ def _render_nb(fn, cfg):
67
67
  def _update_repo_meta(cfg):
68
68
  "Enable gh pages and update the homepage and description in your GitHub repo."
69
69
  token=os.getenv('GITHUB_TOKEN')
70
- if token:
70
+ if token:
71
71
  from ghapi.core import GhApi
72
72
  api = GhApi(owner=cfg.user, repo=cfg.repo, token=token)
73
73
  try: api.repos.update(homepage=f'{cfg.doc_host}{cfg.doc_baseurl}', description=cfg.description)
@@ -85,13 +85,28 @@ def nbdev_new(**kwargs):
85
85
  _update_repo_meta(cfg)
86
86
 
87
87
  path = Path()
88
- with warnings.catch_warnings():
89
- warnings.simplefilter('ignore', UserWarning)
90
- tag = GhApi(gh_host='https://api.github.com', authenticate=False).repos.get_latest_release('fastai', 'nbdev-template').tag_name
91
- url = f"https://github.com/fastai/nbdev-template/archive/{tag}.tar.gz"
92
- extract_tgz(url)
93
- tmpl_path = path/f'nbdev-template-{tag}'
94
88
 
89
+ _ORG_OR_USR = 'fastai'
90
+ _REPOSITORY = 'nbdev-template'
91
+ _TEMPLATE = f'{_ORG_OR_USR}/{_TEMPLATE}'
92
+ template = kwargs.get('template', _TEMPLATE)
93
+ try:
94
+ org_or_usr, repo = template.split('/')
95
+ except ValueError:
96
+ org_or_usr, repo = _ORG_OR_USR, _REPOSITORY
97
+
98
+
99
+ tag = kwargs.get('tag', None)
100
+ if tag is None:
101
+ with warnings.catch_warnings():
102
+ warnings.simplefilter('ignore', UserWarning)
103
+
104
+ tag = GhApi(gh_host='https://api.github.com', authenticate=False).repos.get_latest_release(org_or_usr, repo).tag_name
105
+
106
+ url = f"https://github.com/{org_or_usr}/{repo}/archive/{tag}.tar.gz"
107
+ extract_tgz(url)
108
+ tmpl_path = path/f'{repo}-{tag}'
109
+
95
110
  cfg.nbs_path.mkdir(exist_ok=True)
96
111
  nbexists = bool(first(cfg.nbs_path.glob('*.ipynb')))
97
112
  _nbs_path_sufs = ('.ipynb','.css')
@@ -108,7 +123,47 @@ def nbdev_new(**kwargs):
108
123
  nbdev_export.__wrapped__()
109
124
  nbdev_readme.__wrapped__()
110
125
 
111
- # %% ../nbs/api/13_cli.ipynb 15
126
+ # %% ../nbs/api/13_cli.ipynb 13
127
+ mapping = {
128
+ 'mit': 'mit',
129
+ 'apache2': 'apache-2.0',
130
+ 'gpl2': 'gpl-2.0',
131
+ 'gpl3': 'gpl-3.0',
132
+ 'bsd3': 'bsd-3-clause'
133
+ }
134
+
135
+ # %% ../nbs/api/13_cli.ipynb 14
136
+ @call_parse
137
+ def nbdev_update_license(
138
+ to: str=None, # update license to
139
+ ):
140
+ "Allows you to update the license of your project."
141
+ from ghapi.core import GhApi
142
+ warnings.filterwarnings("ignore")
143
+ avail_lic = GhApi().licenses.get_all_commonly_used().map(lambda x: x['key'])
144
+
145
+ cfg = get_config()
146
+ curr_lic = cfg['license']
147
+
148
+ mapped = mapping.get(to, None)
149
+
150
+ if mapped not in avail_lic: raise ValueError(f"{to} is not an available license")
151
+ body = GhApi().licenses.get(mapped)['body']
152
+
153
+ body = body.replace('[year], [fullname]', cfg['copyright'])
154
+ body = body.replace('[year] [fullname]', cfg['copyright'])
155
+
156
+ content = open("settings.ini", "r").read()
157
+ content = re.sub(r"^(license\s*=\s*).*?$", r"\1 " + to, content, flags=re.MULTILINE)
158
+
159
+ config = open("settings.ini", "w")
160
+ config.write(content)
161
+
162
+ lic = open('LICENSE', 'w')
163
+ lic.write(body)
164
+ print(f"License updated from {curr_lic} to {to}")
165
+
166
+ # %% ../nbs/api/13_cli.ipynb 17
112
167
  @call_parse
113
168
  def chelp():
114
169
  "Show help for all console scripts"
@@ -152,6 +152,8 @@ _nbdev_cfg_tail = '''### Optional ###
152
152
  # requirements = fastcore pandas
153
153
  # dev_requirements =
154
154
  # console_scripts =
155
+ # conda_user =
156
+ # package_data =
155
157
  '''
156
158
 
157
159
  # %% ../nbs/api/01_config.ipynb 21
@@ -3,7 +3,7 @@
3
3
  # %% ../nbs/api/14_quarto.ipynb 3
4
4
  from __future__ import annotations
5
5
  import subprocess,sys,shutil,ast,warnings,traceback
6
- from os import system, uname
6
+ from os import system
7
7
  from contextlib import contextmanager
8
8
 
9
9
  from .config import *
@@ -30,6 +30,7 @@ def _sprun(cmd):
30
30
  BASE_QUARTO_URL='https://www.quarto.org/download/latest/'
31
31
 
32
32
  def _install_linux():
33
+ from os import uname
33
34
  machine = 'arm' if uname().machine in ('arm64', 'aarch64', 'armv8', 'armv8l') else 'amd'
34
35
  system(f'curl -LO {BASE_QUARTO_URL}quarto-linux-{machine}64.deb')
35
36
  system(f'sudo dpkg -i quarto-linux-{machine}64.deb && rm quarto-linux-{machine}64.deb')
@@ -251,6 +252,7 @@ def _save_cached_readme(cache, cfg):
251
252
  def nbdev_readme(
252
253
  path:str=None, # Path to notebooks
253
254
  chk_time:bool=False): # Only build if out of date
255
+ "Create README.md from readme_nb (index.ipynb by default)"
254
256
  cfg = get_config()
255
257
  path = Path(path) if path else cfg.nbs_path
256
258
  if chk_time and _readme_mtime_not_older(cfg.config_path/'README.md', path/cfg.readme_nb): return
@@ -309,6 +311,7 @@ def nbdev_preview(
309
311
  path:str=None, # Path to notebooks
310
312
  port:int=None, # The port on which to run preview
311
313
  host:str=None, # The host on which to run preview
314
+ no_browser:bool=False, # Do not open a browser
312
315
  n_workers:int=defaults.cpus, # Number of workers
313
316
  **kwargs):
314
317
  "Preview docs locally"
@@ -317,6 +320,7 @@ def nbdev_preview(
317
320
  xtra = []
318
321
  if port: xtra += ['--port', str(port)]
319
322
  if host: xtra += ['--host', host]
323
+ if no_browser: xtra += ['--no-browser']
320
324
 
321
325
  def _f(e):
322
326
  res = _proc_file(Path(e.src_path), cache, path)
@@ -201,8 +201,9 @@ def _get_conda_meta():
201
201
  doc_url = (cfg.doc_host + cfg.doc_baseurl) if (cfg.doc_host and cfg.doc_baseurl) else url
202
202
  dev_url = cfg.git_url if cfg.git_url else url
203
203
 
204
- hostreqs = ['pip', 'packaging', f'python >={cfg.min_python}']
205
- if cfg.get('requirements'): reqs = hostreqs[-1:] + cfg.requirements.split()
204
+ hostreqs = ['packaging', f'python >={cfg.min_python}']
205
+ reqs = hostreqs+[]
206
+ if cfg.get('requirements'): reqs += cfg.requirements.split()
206
207
  if cfg.get('conda_requirements'): reqs += cfg.conda_requirements.split()
207
208
 
208
209
  pypi = pypi_json(f'{name}/{ver}')
@@ -70,7 +70,7 @@ def proc_nbs(
70
70
  chk_mtime = max(cfg.config_file.stat().st_mtime, Path(__file__).stat().st_mtime)
71
71
  cache.mkdir(parents=True, exist_ok=True)
72
72
  cache_mtime = cache.stat().st_mtime
73
- if force or (cache.exists and cache_mtime<chk_mtime): rmtree(cache)
73
+ if force or (cache.exists() and cache_mtime<chk_mtime): rmtree(cache)
74
74
 
75
75
  files = files.map(_proc_file, mtime=cache_mtime, cache=cache, path=path).filter()
76
76
  kw = {} if IN_NOTEBOOK else {'method':'spawn'}
@@ -171,7 +171,7 @@ class BasicMarkdownRenderer(ShowDocRenderer):
171
171
  doc += f'{h} {self.nm}\n\n'
172
172
  sig = _wrap_sig(f"{self.nm} {_fmt_sig(self.sig)}") if self.sig else ''
173
173
  doc += f'{sig}'
174
- if self.docs: doc += f"\n\n{self.docs}"
174
+ if self.docs: doc += f"\n\n*{self.docs}*"
175
175
  if self.dm.has_docment: doc += f"\n\n{self.dm}"
176
176
  return doc
177
177
  __repr__=__str__=_repr_markdown_
@@ -199,7 +199,7 @@ class BasicHtmlRenderer(ShowDocRenderer):
199
199
  doc = '<hr/>\n'
200
200
  doc += f'<h{self.title_level}>{self.nm}</h{self.title_level}>\n'
201
201
  doc += f'<blockquote><pre><code>{self.nm}{_fmt_sig(self.sig)}</code></pre></blockquote>'
202
- if self.docs: doc += f"<p>{self.docs}</p>"
202
+ if self.docs: doc += f"<p><i>{self.docs}</i></p>"
203
203
  return doc
204
204
 
205
205
  def doc(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nbdev
3
- Version: 2.3.13
3
+ Version: 2.3.15
4
4
  Summary: Create delightful software with Jupyter Notebooks
5
5
  Home-page: https://github.com/fastai/nbdev
6
6
  Author: Jeremy Howard and Hamel Husain
@@ -20,6 +20,7 @@ Classifier: License :: OSI Approved :: Apache Software License
20
20
  Requires-Python: >=3.7
21
21
  Description-Content-Type: text/markdown
22
22
  License-File: LICENSE
23
+ Requires-Dist: packaging
23
24
  Requires-Dist: ipywidgets<=8.0.4
24
25
  Requires-Dist: fastcore>=1.5.27
25
26
  Requires-Dist: execnb>=0.1.4
@@ -39,19 +40,11 @@ Requires-Dist: jupyter; extra == "dev"
39
40
 
40
41
  # Getting Started
41
42
 
43
+
42
44
  <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
43
45
 
44
46
  ![CI](https://github.com/fastai/nbdev/actions/workflows/test.yaml/badge.svg)
45
47
 
46
- *NB: This is nbdev v2, a major upgrade of nbdev. Whilst the differences
47
- to nbdev1 aren’t huge, it does require some changes. The old version
48
- docs are at [nbdev1.fast.ai](https://nbdev1.fast.ai). You can use
49
- version-pinning in `settings.ini` (i.e `'nbdev<2'`) to stop nbdev from
50
- upgrading. To upgrade, follow the [migration
51
- tutorial](https://nbdev.fast.ai/migrating.html).*
52
-
53
- ------------------------------------------------------------------------
54
-
55
48
  `nbdev` is a notebook-driven development platform. Simply write
56
49
  notebooks with lightweight markup and get high-quality documentation,
57
50
  tests, continuous integration, and packaging for free!
@@ -109,15 +102,11 @@ The best way to learn how to use nbdev is to complete either the
109
102
  [written walkthrough](https://nbdev.fast.ai/tutorials/tutorial.html) or
110
103
  video walkthrough:
111
104
 
112
- <div>
113
-
114
105
  <a href="http://www.youtube.com/watch?v=l7zS8Ld4_iA" target="_blank"
115
106
  title="nbdev walkthrough"><img
116
107
  src="https://github.com/fastai/logos/raw/main/nbdev_walkthrough.png"
117
108
  style="border-radius: 10px" width="560" height="315" /></a>
118
109
 
119
- </div>
120
-
121
110
  Alternatively, there’s a [shortened version of the video
122
111
  walkthrough](https://youtu.be/67FdzLSt4aA) with coding sections sped up
123
112
  using the `unsilence` Python library – it’s 27 minutes faster, but a bit
@@ -130,35 +119,34 @@ available commands:
130
119
  !nbdev_help
131
120
  ```
132
121
 
133
- nbdev_bump_version Increment version in settings.ini by one
134
- nbdev_changelog Create a CHANGELOG.md file from closed and labeled GitHub issues
135
- nbdev_clean Clean all notebooks in `fname` to avoid merge conflicts
136
- nbdev_conda Create a `meta.yaml` file ready to be built into a package, and optionally build and upload it
137
- nbdev_create_config Create a config file.
138
- nbdev_deploy Deploy docs to GitHub Pages
139
- nbdev_docs Create Quarto docs and README.md
140
- nbdev_export Export notebooks in `path` to Python modules
141
- nbdev_filter A notebook filter for Quarto
142
- nbdev_fix Create working notebook from conflicted notebook `nbname`
143
- nbdev_help Show help for all console scripts
144
- nbdev_install Install Quarto and the current library
145
- nbdev_install_hooks Install Jupyter and git hooks to automatically clean, trust, and fix merge conflicts in notebooks
146
- nbdev_install_quarto Install latest Quarto on macOS or Linux, prints instructions for Windows
147
- nbdev_merge Git merge driver for notebooks
148
- nbdev_migrate Convert all directives and callouts in `fname` from v1 to v2
149
- nbdev_new Create an nbdev project.
150
- nbdev_prepare Export, test, and clean notebooks, and render README if needed
151
- nbdev_preview Preview docs locally
152
- nbdev_proc_nbs Process notebooks in `path` for docs rendering
153
- nbdev_pypi Create and upload Python package to PyPI
154
- nbdev_readme None
155
- nbdev_release_both Release both conda and PyPI packages
156
- nbdev_release_gh Calls `nbdev_changelog`, lets you edit the result, then pushes to git and calls `nbdev_release_git`
157
- nbdev_release_git Tag and create a release in GitHub for the current version
158
- nbdev_sidebar Create sidebar.yml
159
- nbdev_test Test in parallel notebooks matching `path`, passing along `flags`
160
- nbdev_trust Trust notebooks matching `fname`
161
- nbdev_update Propagate change in modules matching `fname` to notebooks that created them
122
+ nbdev_bump_version Increment version in settings.ini by one
123
+ nbdev_changelog Create a CHANGELOG.md file from closed and labeled GitHub issues
124
+ nbdev_clean Clean all notebooks in `fname` to avoid merge conflicts
125
+ nbdev_conda Create a `meta.yaml` file ready to be built into a package, and optionally build and upload it
126
+ nbdev_create_config Create a config file.
127
+ nbdev_docs Create Quarto docs and README.md
128
+ nbdev_export Export notebooks in `path` to Python modules
129
+ nbdev_filter A notebook filter for Quarto
130
+ nbdev_fix Create working notebook from conflicted notebook `nbname`
131
+ nbdev_help Show help for all console scripts
132
+ nbdev_install Install Quarto and the current library
133
+ nbdev_install_hooks Install Jupyter and git hooks to automatically clean, trust, and fix merge conflicts in notebooks
134
+ nbdev_install_quarto Install latest Quarto on macOS or Linux, prints instructions for Windows
135
+ nbdev_merge Git merge driver for notebooks
136
+ nbdev_migrate Convert all markdown and notebook files in `path` from v1 to v2
137
+ nbdev_new Create an nbdev project.
138
+ nbdev_prepare Export, test, and clean notebooks, and render README if needed
139
+ nbdev_preview Preview docs locally
140
+ nbdev_proc_nbs Process notebooks in `path` for docs rendering
141
+ nbdev_pypi Create and upload Python package to PyPI
142
+ nbdev_readme Create README.md from readme_nb (index.ipynb by default)
143
+ nbdev_release_both Release both conda and PyPI packages
144
+ nbdev_release_gh Calls `nbdev_changelog`, lets you edit the result, then pushes to git and calls `nbdev_release_git`
145
+ nbdev_release_git Tag and create a release in GitHub for the current version
146
+ nbdev_sidebar Create sidebar.yml
147
+ nbdev_test Test in parallel notebooks matching `path`, passing along `flags`
148
+ nbdev_trust Trust notebooks matching `fname`
149
+ nbdev_update Propagate change in modules matching `fname` to notebooks that created them
162
150
 
163
151
  ## FAQ
164
152
 
@@ -27,6 +27,7 @@ nbdev_sidebar = nbdev.quarto:nbdev_sidebar
27
27
  nbdev_test = nbdev.test:nbdev_test
28
28
  nbdev_trust = nbdev.clean:nbdev_trust
29
29
  nbdev_update = nbdev.sync:nbdev_update
30
+ nbdev_update_license = nbdev.cli:nbdev_update_license
30
31
 
31
32
  [nbdev]
32
33
  nbdev = nbdev._modidx:d
@@ -1,3 +1,4 @@
1
+ packaging
1
2
  ipywidgets<=8.0.4
2
3
  fastcore>=1.5.27
3
4
  execnb>=0.1.4
@@ -9,7 +9,7 @@ author = Jeremy Howard and Hamel Husain
9
9
  author_email = j@fast.ai
10
10
  branch = master
11
11
  min_python = 3.7
12
- version = 2.3.13
12
+ version = 2.3.15
13
13
  audience = Developers
14
14
  language = English
15
15
  custom_sidebar = True
@@ -22,6 +22,7 @@ conda_user = fastai
22
22
  dev_requirements = nbdev-numpy nbdev-stdlib pandas matplotlib black svg.py jupyter
23
23
  console_scripts = nbdev_create_config=nbdev.config:nbdev_create_config
24
24
  nbdev_update=nbdev.sync:nbdev_update
25
+ nbdev_update_license=nbdev.cli:nbdev_update_license
25
26
  nbdev_export=nbdev.doclinks:nbdev_export
26
27
  nbdev_fix=nbdev.merge:nbdev_fix
27
28
  nbdev_merge=nbdev.merge:nbdev_merge
@@ -28,7 +28,8 @@ statuses = [ '0 - Pre-Planning', '1 - Planning', '2 - Pre-Alpha', '3 - Alpha',
28
28
  '4 - Beta', '5 - Production/Stable', '6 - Mature', '7 - Inactive' ]
29
29
  py_versions = '3.7 3.8 3.9 3.10 3.11'.split()
30
30
 
31
- requirements = shlex.split(cfg.get('requirements', ''))
31
+ requirements = ['packaging']
32
+ requirements += shlex.split(cfg.get('requirements', ''))
32
33
  if cfg.get('pip_requirements'): requirements += shlex.split(cfg.get('pip_requirements', ''))
33
34
  min_python = cfg['min_python']
34
35
  lic = licenses.get(cfg['license'].lower(), (cfg['license'], None))
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