##// END OF EJS Templates
Add new '%autoreload 3' option...
Add new '%autoreload 3' option Example: When an IPython session is ran with the 'autoreload' extension, you will now have the option '3' to select which means the following: 1. replicate all functionality from option 2 2. autoload all new funcs/classes/enums/globals from the module when they're added 3. autoload all newly imported funcs/classes/enums/globals from external modules Try ``%autoreload 3`` in an IPython session after running ``%load_ext autoreload`` For more information please see unit test - extensions/tests/test_autoreload.py : 'test_autoload_newly_added_objects'

File last commit:

r26016:50a8bd8a
r26238:1d3018a9
Show More
fixup_whats_new_pr.py
39 lines | 1.1 KiB | text/x-python | PythonLexer
/ tools / fixup_whats_new_pr.py
Matthias Bussonnier
Tool to go around sphinx limitation during developpement
r24523 """
This tool is used during CI testing to make sure sphinx raise no error.
During development, we like to have whatsnew/pr/*.rst documents to track
individual new features. Unfortunately they other either:
- have no title (sphinx complains)
- are not included in any toctree (sphinx complain)
This fix-them up by "inventing" a title, before building the docs. At release
time, these title and files will anyway be rewritten into the actual release
notes.
"""
rushabh-v
use pathlib in fixup_whats_new_pr.py
r26015 from pathlib import Path
Matthias Bussonnier
Tool to go around sphinx limitation during developpement
r24523
def main():
rushabh-v
run darker
r26016 folder = Path("docs/source/whatsnew/pr/")
files = list(folder.glob("*.rst"))
Matthias Bussonnier
Tool to go around sphinx limitation during developpement
r24523 print(files)
rushabh-v
use pathlib in fixup_whats_new_pr.py
r26015 for filepath in files:
rushabh-v
run darker
r26016 print("Adding pseudo-title to:", filepath.name)
title = filepath.name[:-4].split("/")[-1].replace("-", " ").capitalize()
Matthias Bussonnier
Tool to go around sphinx limitation during developpement
r24523
rushabh-v
use pathlib in fixup_whats_new_pr.py
r26015 data = filepath.read_text()
Matthias Bussonnier
Start to updates the what's new / changelog....
r24535 try:
if data and data.splitlines()[1].startswith('='):
continue
except IndexError:
pass
Matthias Bussonnier
Tool to go around sphinx limitation during developpement
r24523
rushabh-v
run darker
r26016 with filepath.open("w") as f:
f.write(title + "\n")
f.write("=" * len(title) + "\n\n")
Matthias Bussonnier
Tool to go around sphinx limitation during developpement
r24523 f.write(data)
if __name__ == '__main__':
main()