Skip to content

Commit 16084b5

Browse files
committed
fix: preserve v0.1.0 version through nbdev-export
nbdev-export always resets __version__ to 0.0.1 because it reads from the overwritten __init__.py. Fix: add explicit __version__ = "0.1.0" export cell in index.ipynb so nbdev preserves it during export. Also add version to [tool.nbdev] in pyproject.toml.
1 parent a006e4e commit 16084b5

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

fasterbench/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
__version__ = "0.1.0"
21
"""Comprehensive benchmarking toolkit for deep learning models"""
32

43
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/index.ipynb.
54

65
# %% auto #0
76
__all__ = []
87

8+
# %% ../nbs/index.ipynb #version_cell
9+
__version__ = "0.1.0"
10+
911
# %% ../nbs/index.ipynb #8b6f8c52
1012
from .benchmark import benchmark, BenchmarkResult
1113
from .size import SizeMetrics, compute_size, get_model_size, get_num_parameters

nbs/index.ipynb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@
2020
"#| default_exp __init__"
2121
]
2222
},
23+
{
24+
"cell_type": "code",
25+
"execution_count": null,
26+
"id": "version_cell",
27+
"metadata": {},
28+
"outputs": [],
29+
"source": [
30+
"#| export\n",
31+
"__version__ = \"0.1.0\""
32+
]
33+
},
2334
{
2435
"cell_type": "code",
2536
"execution_count": null,

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ version = {attr = "fasterbench.__version__"}
2828
include = ["fasterbench"]
2929

3030
[tool.nbdev]
31+
version = "0.1.0"
3132
tst_flags = 'notest'
3233
jupyter_hooks = true

0 commit comments

Comments
 (0)