Skip to content

Commit aac4dd3

Browse files
committed
clean
1 parent 85de500 commit aac4dd3

11 files changed

+14
-27
lines changed

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Getting Started
2-
================
1+
# Getting Started
32

43
<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
54

nbdev/doclinks.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def patch_name(o):
4646
def _iter_py_cells(p):
4747
"Yield cells from an exported Python file."
4848
p = Path(p)
49-
cells = p.read_text().split("\n# %% ")
49+
cells = p.read_text(encoding='utf-8').split("\n# %% ")
5050
for cell in cells[1:]:
5151
top,code = cell.split('\n', 1)
5252
try:
@@ -93,7 +93,7 @@ def _build_modidx(dest=None, nbs_path=None, skip_exists=False):
9393
idxfile = dest/'_modidx.py'
9494
if skip_exists and idxfile.exists(): return
9595
with contextlib.suppress(FileNotFoundError): idxfile.unlink()
96-
if idxfile.exists(): res = exec_local(idxfile.read_text(), 'd')
96+
if idxfile.exists(): res = exec_local(idxfile.read_text(encoding='utf-8'), 'd')
9797
else: res = dict(syms={}, settings={})
9898
res['settings'] = {k:v for k,v in get_config().d.items()
9999
if k in ('doc_host','doc_baseurl','lib_path','git_url','branch')}
@@ -159,7 +159,7 @@ def _find_mod(mod):
159159
def _get_exps(mod):
160160
mf = _find_mod(mod)
161161
if not mf: return {}
162-
txt = mf.read_text()
162+
txt = mf.read_text(encoding='utf-8')
163163
_def_types = ast.FunctionDef,ast.AsyncFunctionDef,ast.ClassDef
164164
d = {}
165165
for tree in ast.parse(txt).body:

nbdev/maker.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def update_var(varname, func, fn=None, code=None):
4747
"Update the definition of `varname` in file `fn`, by calling `func` with the current definition"
4848
if fn:
4949
fn = Path(fn)
50-
code = fn.read_text()
50+
code = fn.read_text(encoding='utf-8')
5151
lines = code.splitlines()
5252
v = read_var(code, varname)
5353
res = func(v)

nbdev/merge.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def nbdev_fix(nbname:str, # Notebook filename to fix
6363
"Create working notebook from conflicted notebook `nbname`"
6464
nbname = Path(nbname)
6565
if not nobackup and not outname: shutil.copy(nbname, nbname.with_suffix('.ipynb.bak'))
66-
nbtxt = nbname.read_text()
66+
nbtxt = nbname.read_text(encoding='utf-8')
6767
a,b,branch1,branch2 = unpatch(nbtxt)
6868
ac,bc = dict2nb(loads(a)),dict2nb(loads(b))
6969
dest = bc if theirs else ac
@@ -85,7 +85,7 @@ def _git_rebase_head():
8585
for d in ('apply','merge'):
8686
d = Path(f'.git/rebase-{d}')
8787
if d.is_dir():
88-
cmt = (d/'orig-head').read_text()
88+
cmt = (d/'orig-head').read_text(encoding='utf-8')
8989
msg = run(f'git show-branch --no-name {cmt}')
9090
return f'{cmt[:7]} ({msg})'
9191

nbdev/serve.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ def _is_qpy(path:Path):
2222
"Is `path` a py script starting with frontmatter?"
2323
path = Path(path)
2424
if not path.suffix=='.py': return
25-
p = ast.parse(path.read_text())
26-
# try: p = ast.parse(path.read_text())
25+
p = ast.parse(path.read_text(encoding='utf-8'))
26+
# try: p = ast.parse(path.read_text(encoding='utf-8'))
2727
# except: return
2828
if not p.body: return
2929
a = p.body[0]

nbs/api/02_maker.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@
799799
],
800800
"metadata": {
801801
"kernelspec": {
802-
"display_name": "Python 3 (ipykernel)",
802+
"display_name": "python3",
803803
"language": "python",
804804
"name": "python3"
805805
}

nbs/api/05_doclinks.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@
823823
],
824824
"metadata": {
825825
"kernelspec": {
826-
"display_name": "Python 3 (ipykernel)",
826+
"display_name": "python3",
827827
"language": "python",
828828
"name": "python3"
829829
}

nbs/api/07_merge.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@
635635
"split_at_heading": true
636636
},
637637
"kernelspec": {
638-
"display_name": "Python 3 (ipykernel)",
638+
"display_name": "python3",
639639
"language": "python",
640640
"name": "python3"
641641
}

nbs/api/08_showdoc.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,7 @@
13451345
],
13461346
"metadata": {
13471347
"kernelspec": {
1348-
"display_name": "Python 3 (ipykernel)",
1348+
"display_name": "python3",
13491349
"language": "python",
13501350
"name": "python3"
13511351
}

nbs/api/17_serve.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
],
197197
"metadata": {
198198
"kernelspec": {
199-
"display_name": "Python 3 (ipykernel)",
199+
"display_name": "python3",
200200
"language": "python",
201201
"name": "python3"
202202
}

nbs/tutorials/best_practices.ipynb

-12
Original file line numberDiff line numberDiff line change
@@ -1470,18 +1470,6 @@
14701470
"display_name": "aa",
14711471
"language": "python",
14721472
"name": "aa"
1473-
},
1474-
"language_info": {
1475-
"codemirror_mode": {
1476-
"name": "ipython",
1477-
"version": 3
1478-
},
1479-
"file_extension": ".py",
1480-
"mimetype": "text/x-python",
1481-
"name": "python",
1482-
"nbconvert_exporter": "python",
1483-
"pygments_lexer": "ipython3",
1484-
"version": "3.10.6"
14851473
}
14861474
},
14871475
"nbformat": 4,

0 commit comments

Comments
 (0)