nbdev 2.3.37__py3-none-any.whl → 2.4.0__py3-none-any.whl

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/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "2.3.37"
1
+ __version__ = "2.4.0"
2
2
 
3
3
  from .doclinks import nbdev_export
4
4
  from .showdoc import show_doc
nbdev/_modidx.py CHANGED
@@ -1,6 +1,6 @@
1
1
  # Autogenerated by nbdev
2
2
 
3
- d = { 'settings': { 'branch': 'master',
3
+ d = { 'settings': { 'branch': 'main',
4
4
  'doc_baseurl': '/',
5
5
  'doc_host': 'https://nbdev.fast.ai',
6
6
  'git_url': 'https://github.com/AnswerDotAI/nbdev',
@@ -46,6 +46,7 @@ d = { 'settings': { 'branch': 'master',
46
46
  'nbdev.config.is_nbdev': ('api/config.html#is_nbdev', 'nbdev/config.py'),
47
47
  'nbdev.config.nbdev_create_config': ('api/config.html#nbdev_create_config', 'nbdev/config.py'),
48
48
  'nbdev.config.show_src': ('api/config.html#show_src', 'nbdev/config.py'),
49
+ 'nbdev.config.update_proj': ('api/config.html#update_proj', 'nbdev/config.py'),
49
50
  'nbdev.config.update_version': ('api/config.html#update_version', 'nbdev/config.py'),
50
51
  'nbdev.config.write_cells': ('api/config.html#write_cells', 'nbdev/config.py')},
51
52
  'nbdev.doclinks': { 'nbdev.doclinks.NbdevLookup': ('api/doclinks.html#nbdevlookup', 'nbdev/doclinks.py'),
nbdev/config.py CHANGED
@@ -3,8 +3,8 @@
3
3
  # AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/api/01_config.ipynb.
4
4
 
5
5
  # %% auto 0
6
- __all__ = ['nbdev_create_config', 'get_config', 'config_key', 'is_nbdev', 'create_output', 'show_src', 'update_version',
7
- 'add_init', 'write_cells']
6
+ __all__ = ['pyproj_tmpl', 'nbdev_create_config', 'get_config', 'config_key', 'is_nbdev', 'create_output', 'show_src',
7
+ 'update_version', 'update_proj', 'add_init', 'write_cells']
8
8
 
9
9
  # %% ../nbs/api/01_config.ipynb
10
10
  from datetime import datetime
@@ -49,7 +49,7 @@ def _apply_defaults(
49
49
  license='apache2', # License for the package
50
50
  copyright:str=None, # Copyright for the package, defaults to '`current_year` onwards, `author`'
51
51
  status='3', # Development status PyPI classifier
52
- min_python='3.7', # Minimum Python version PyPI classifier
52
+ min_python='3.9', # Minimum Python version PyPI classifier
53
53
  audience='Developers', # Intended audience PyPI classifier
54
54
  language='English', # Language PyPI classifier
55
55
  recursive:bool_arg=True, # Include subfolders in notebook globs?
@@ -63,6 +63,7 @@ def _apply_defaults(
63
63
  clear_all:bool_arg=False, # Remove all cell metadata and cell outputs?
64
64
  cell_number:bool_arg=True, # Add cell number to the exported file
65
65
  put_version_in_init:bool_arg=True, # Add the version to the main __init__.py in nbdev_export
66
+ update_pyproject:bool_arg=True, # Create/update pyproject.toml with correct project name
66
67
  skip_procs:str='', # A comma-separated list of processors that you want to skip
67
68
  ):
68
69
  "Apply default settings where missing in `cfg`."
@@ -142,7 +143,7 @@ _nbdev_cfg_head = '''# All sections below are required unless otherwise specifie
142
143
 
143
144
  '''
144
145
  _nbdev_cfg_sections = {'Python library': 'repo lib_name version min_python license black_formatting',
145
- 'nbdev': 'doc_path lib_path nbs_path recursive tst_flags put_version_in_init',
146
+ 'nbdev': 'doc_path lib_path nbs_path recursive tst_flags put_version_in_init update_pyproject',
146
147
  'Docs': 'branch custom_sidebar doc_host doc_baseurl git_url title',
147
148
  'PyPI': 'audience author author_email copyright description keywords language status user'}
148
149
  _nbdev_cfg_tail = '''### Optional ###
@@ -219,9 +220,26 @@ def create_output(txt, mime):
219
220
  # %% ../nbs/api/01_config.ipynb
220
221
  def show_src(src, lang='python'): return Markdown(f'```{lang}\n{src}\n```')
221
222
 
223
+ # %% ../nbs/api/01_config.ipynb
224
+ pyproj_tmpl = """[build-system]
225
+ requires = ["setuptools>=64.0"]
226
+ build-backend = "setuptools.build_meta"
227
+
228
+ [project]
229
+ name = "FILL_IN"
230
+ requires-python="FILL_IN"
231
+ dynamic = ["description", "version","dependencies", "optional-dependencies", "readme", "requires-python", "license", "authors", "keywords", "classifiers", "entry-points", "urls"]
232
+
233
+ [tool.uv]
234
+ cache-keys = [{ file = "pyproject.toml" }, { file = "settings.ini" }, { file = "setup.py" }]
235
+ """
236
+
222
237
  # %% ../nbs/api/01_config.ipynb
223
238
  _re_version = re.compile(r'^__version__\s*=.*$', re.MULTILINE)
239
+ _re_proj = re.compile(r'^name\s*=\s*".*$', re.MULTILINE)
240
+ _re_reqpy = re.compile(r'^requires-python\s*=\s*".*$', re.MULTILINE)
224
241
  _init = '__init__.py'
242
+ _pyproj = 'pyproject.toml'
225
243
 
226
244
  def update_version(path=None):
227
245
  "Add or update `__version__` in the main `__init__.py` of the library."
@@ -236,6 +254,15 @@ def update_version(path=None):
236
254
 
237
255
  def _has_py(fs): return any(1 for f in fs if f.endswith('.py'))
238
256
 
257
+ def update_proj(path):
258
+ "Create or update `pyproject.toml` in the project root."
259
+ fname = path/_pyproj
260
+ if not fname.exists(): fname.write_text(pyproj_tmpl)
261
+ txt = fname.read_text()
262
+ txt = _re_proj.sub(f'name="{get_config().lib_name}"', txt)
263
+ txt = _re_reqpy.sub(f'requires-python=">={get_config().min_python}"', txt)
264
+ fname.write_text(txt)
265
+
239
266
  def add_init(path=None):
240
267
  "Add `__init__.py` in all subdirs of `path` containing python files if it's not there already."
241
268
  # we add the lowest-level `__init__.py` files first, which ensures _has_py succeeds for parent modules
@@ -247,6 +274,7 @@ def add_init(path=None):
247
274
  subds = (os.listdir(r/d) for d in ds)
248
275
  if _has_py(fs) or any(filter(_has_py, subds)) and not (r/_init).exists(): (r/_init).touch()
249
276
  if get_config().get('put_version_in_init', True): update_version(path)
277
+ if get_config().get('update_pyproject', True): update_proj(path.parent)
250
278
 
251
279
  # %% ../nbs/api/01_config.ipynb
252
280
  def write_cells(cells, hdr, file, offset=0, cell_number=True, solo_nb=False):
nbdev/showdoc.py CHANGED
@@ -13,7 +13,6 @@ from fastcore.utils import *
13
13
  from importlib import import_module
14
14
  import inspect, sys
15
15
  from collections import OrderedDict
16
- from plum import Function
17
16
  from textwrap import fill
18
17
  from types import FunctionType
19
18
 
@@ -189,7 +188,7 @@ def show_doc(sym, # Symbol to document
189
188
  elif isinstance(renderer,str):
190
189
  p,m = renderer.rsplit('.', 1)
191
190
  renderer = getattr(import_module(p), m)
192
- if isinstance(sym, Function): pass
191
+ if isinstance_str(sym, "Function"): pass
193
192
  elif isinstance_str(sym, "TypeDispatch"): pass # use _str as TypeDispatch will be removed from fastcore
194
193
  else:return renderer(sym or show_doc, name=name, title_level=title_level)
195
194
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nbdev
3
- Version: 2.3.37
3
+ Version: 2.4.0
4
4
  Summary: Create delightful software with Jupyter Notebooks
5
5
  Home-page: https://github.com/AnswerDotAI/nbdev
6
6
  Author: Jeremy Howard and Hamel Husain
@@ -11,14 +11,12 @@ Keywords: nbdev fastai jupyter notebook export
11
11
  Classifier: Development Status :: 5 - Production/Stable
12
12
  Classifier: Intended Audience :: Developers
13
13
  Classifier: Natural Language :: English
14
- Classifier: Programming Language :: Python :: 3.7
15
- Classifier: Programming Language :: Python :: 3.8
16
14
  Classifier: Programming Language :: Python :: 3.9
17
15
  Classifier: Programming Language :: Python :: 3.10
18
16
  Classifier: Programming Language :: Python :: 3.12
19
17
  Classifier: Programming Language :: Python :: 3.13
20
18
  Classifier: License :: OSI Approved :: Apache Software License
21
- Requires-Python: >=3.7
19
+ Requires-Python: >=3.9
22
20
  Description-Content-Type: text/markdown
23
21
  License-File: LICENSE
24
22
  Requires-Dist: packaging
@@ -29,7 +27,6 @@ Requires-Dist: ghapi>=1.0.3
29
27
  Requires-Dist: watchdog
30
28
  Requires-Dist: asttokens
31
29
  Requires-Dist: setuptools
32
- Requires-Dist: plum-dispatch
33
30
  Requires-Dist: PyYAML
34
31
  Provides-Extra: dev
35
32
  Requires-Dist: ipywidgets; extra == "dev"
@@ -43,6 +40,7 @@ Requires-Dist: nbclassic; extra == "dev"
43
40
  Requires-Dist: pysymbol_llm; extra == "dev"
44
41
  Requires-Dist: llms-txt; extra == "dev"
45
42
  Requires-Dist: sphinx; extra == "dev"
43
+ Requires-Dist: plum-dispatch; extra == "dev"
46
44
 
47
45
  # Getting Started
48
46
 
@@ -1,8 +1,8 @@
1
- nbdev/__init__.py,sha256=54mRbsaiGjBIpmzV7bxlN32tRU1qlURA4Jv9GanxAnE,90
2
- nbdev/_modidx.py,sha256=zOSOxxECJWwE8_VBaiKguawI8YbQ9e3jPmefZQPW1lU,41526
1
+ nbdev/__init__.py,sha256=iuOpXxTxcBkD1UFn9nO9GFYm7oRzifCRi0M6FxtRGA4,89
2
+ nbdev/_modidx.py,sha256=zVxnzO5QaU03Hg9VaA_IgwyZNEbdy8qnvPUIV94m3Kg,41634
3
3
  nbdev/clean.py,sha256=mVgsW2_g7KIXAVh8mwpj86UwMN6QVM-q33PDzA27nWw,9410
4
4
  nbdev/cli.py,sha256=vPBg1OrqzXW_b2NHiUn9g7CflP2M_Bk3pdbKXuKXwjM,7107
5
- nbdev/config.py,sha256=8U_0mZ3DPuHbFqSVoVSYVpfSPHKB-3jB1Opvws3d9ig,12296
5
+ nbdev/config.py,sha256=nCLPScimz4KA4rVlnsn1jmCVJ0-xet2raUMPFwXFB3U,13506
6
6
  nbdev/doclinks.py,sha256=Y-pk3-9wDKFqDtPhAd2tNUCkcQ4B4i0WeNKhORcRP3Q,12427
7
7
  nbdev/export.py,sha256=dX_mAnH6-vLHJEb4vp-QS2pY78Hk5YXsdvdgzMTiymY,4059
8
8
  nbdev/extract_attachments.py,sha256=O4mS4EFIOXL_yQ3jmsnBStrWxGR_nPNvxLYXHtLeimw,2208
@@ -18,12 +18,11 @@ nbdev/quarto.py,sha256=YnYwM1gTSIuitfUnK-R3gxqfrUh6rHPZmBN1OqhLuQ0,13816
18
18
  nbdev/release.py,sha256=MDTFjwD8xRUeR7VINgiakOx1JNFAdBTi58zbzrYlLlI,14326
19
19
  nbdev/serve.py,sha256=HcYoNQiSROdMS1J8YlOlyTya-LmmrR-8v3ho5D9g700,3146
20
20
  nbdev/serve_drv.py,sha256=IZ2acem_KKsXYYe0iUECiR_orkYLBkT1ZG_258ZS7SQ,657
21
- nbdev/showdoc.py,sha256=eurFJKcl6_jSWOY7BWYW8tL88DR_ocEIcBsJ8-t8vXk,10121
21
+ nbdev/showdoc.py,sha256=M6vZEyhzWzL8oyVx7gBXaSyG1e8LM1fNrDbInqjN0Eo,10101
22
22
  nbdev/sync.py,sha256=ld-lSOmlX1FdnTOzaSHcxKyIuIguI_SpluqfPSH2BZ8,3201
23
23
  nbdev/test.py,sha256=_ECBd5fvfGEICIfkTI2S8w8YatL5CaPltCeDSsiH6yw,4435
24
- nbdev-2.3.37.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
25
- nbdev-2.3.37.dist-info/METADATA,sha256=uAZ04ttCiQj_ooNOtsy_dAQOXo_KaqZxzadBydNpS6w,10569
26
- nbdev-2.3.37.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
27
- nbdev-2.3.37.dist-info/entry_points.txt,sha256=1ADLbIIJxZeLgOD8NpizkPULSsd_fgUQxwAkbGk45b8,1453
28
- nbdev-2.3.37.dist-info/top_level.txt,sha256=3cWYLMuaXsZjz3TQRGEkWGs9Z8ieEDmYcq8TZS3y3vU,6
29
- nbdev-2.3.37.dist-info/RECORD,,
24
+ nbdev-2.4.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
25
+ nbdev-2.4.0.dist-info/METADATA,sha256=TAbZm_FG8njwyk6dmfMOj1Hq5IomVxnbC05iWTksgj0,10484
26
+ nbdev-2.4.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
27
+ nbdev-2.4.0.dist-info/top_level.txt,sha256=3cWYLMuaXsZjz3TQRGEkWGs9Z8ieEDmYcq8TZS3y3vU,6
28
+ nbdev-2.4.0.dist-info/RECORD,,
@@ -1,37 +0,0 @@
1
- [console_scripts]
2
- nb_export = nbdev.cli:nb_export_cli
3
- nbdev_bump_version = nbdev.release:nbdev_bump_version
4
- nbdev_changelog = nbdev.release:changelog
5
- nbdev_clean = nbdev.clean:nbdev_clean
6
- nbdev_conda = nbdev.release:release_conda
7
- nbdev_contributing = nbdev.quarto:nbdev_contributing
8
- nbdev_create_config = nbdev.config:nbdev_create_config
9
- nbdev_docs = nbdev.quarto:nbdev_docs
10
- nbdev_export = nbdev.doclinks:nbdev_export
11
- nbdev_filter = nbdev.cli:nbdev_filter
12
- nbdev_fix = nbdev.merge:nbdev_fix
13
- nbdev_help = nbdev.cli:chelp
14
- nbdev_install = nbdev.quarto:install
15
- nbdev_install_hooks = nbdev.clean:nbdev_install_hooks
16
- nbdev_install_quarto = nbdev.quarto:install_quarto
17
- nbdev_merge = nbdev.merge:nbdev_merge
18
- nbdev_migrate = nbdev.migrate:nbdev_migrate
19
- nbdev_new = nbdev.cli:nbdev_new
20
- nbdev_prepare = nbdev.quarto:prepare
21
- nbdev_preview = nbdev.quarto:nbdev_preview
22
- nbdev_proc_nbs = nbdev.quarto:nbdev_proc_nbs
23
- nbdev_pypi = nbdev.release:release_pypi
24
- nbdev_readme = nbdev.quarto:nbdev_readme
25
- nbdev_release_both = nbdev.release:release_both
26
- nbdev_release_gh = nbdev.release:release_gh
27
- nbdev_release_git = nbdev.release:release_git
28
- nbdev_requirements = nbdev.release:write_requirements
29
- nbdev_sidebar = nbdev.quarto:nbdev_sidebar
30
- nbdev_test = nbdev.test:nbdev_test
31
- nbdev_trust = nbdev.clean:nbdev_trust
32
- nbdev_update = nbdev.sync:nbdev_update
33
- nbdev_update_license = nbdev.cli:nbdev_update_license
34
- watch_export = nbdev.cli:watch_export
35
-
36
- [nbdev]
37
- nbdev = nbdev._modidx:d
File without changes