From 30c4c7ca7d730483df833ec1bfa70abbfc8a5090 2013-10-06 19:52:53 From: Min RK Date: 2013-10-06 19:52:53 Subject: [PATCH] Merge pull request #4349 from takluyver/update-whatsnew Script to update What's New file --- diff --git a/docs/source/whatsnew/development.rst b/docs/source/whatsnew/development.rst index 21239df..7b295ef 100644 --- a/docs/source/whatsnew/development.rst +++ b/docs/source/whatsnew/development.rst @@ -14,6 +14,24 @@ This document describes in-flight development work. - `%%capture` cell magic now captures the rich display output, not just stdout/stderr +Select Notebook Name When Renaming a Notebook +--------------------------------------------- + +The default notebook name is Untitled. It's unlikely you want to keep this name +or part of it when naming your notebook. Instead, IPython will select the text +in the input field so the user can easily type over the name and change it. + +clear_output changes +-------------------- + +* There is no longer a 500ms delay when calling ``clear_output``. +* The ability to clear stderr and stdout individually was removed. +* A new ``wait`` flag that prevents ``clear_output`` from being executed until new + output is available. This eliminates animation flickering by allowing the + user to double buffer the output. +* The output div height is remembered when the ``wait=True`` flag is used. + +.. DO NOT EDIT THIS LINE BEFORE RELEASE. FEATURE INSERTION POINT. Backwards incompatible changes ------------------------------ @@ -24,3 +42,21 @@ Backwards incompatible changes their `call` methods for them have been renamed to `preprocess`. * The `call` methods of nbconvert post-processsors have been renamed to `postprocess`. + +* The module ``IPython.core.fakemodule`` has been removed. + +* The alias system has been reimplemented to use magic functions. There should be little + visible difference while automagics are enabled, as they are by default, but parts of the + :class:`~IPython.core.alias.AliasManager` API have been removed. + +* We fixed an issue with switching between matplotlib inline and GUI backends, + but the fix requires matplotlib 1.1 or newer. So from now on, we consider + matplotlib 1.1 to be the minimally supported version for IPython. Older + versions for the most part will work, but we make no guarantees about it. + +* The :command:`pycolor` command has been removed. We recommend the much more capable + :command:`pygmentize` command from the `Pygments `_ project. + If you need to keep the exact output of :command:`pycolor`, you can still use + ``python -m IPython.utils.PyColorize foo.py``. + +.. DO NOT EDIT THIS LINE BEFORE RELEASE. INCOMPAT INSERTION POINT. \ No newline at end of file diff --git a/docs/source/whatsnew/pr/clear_output.rst b/docs/source/whatsnew/pr/clear_output.rst deleted file mode 100644 index 0040ad1..0000000 --- a/docs/source/whatsnew/pr/clear_output.rst +++ /dev/null @@ -1,9 +0,0 @@ -clear_output changes --------------------- - -* There is no longer a 500ms delay when calling ``clear_output``. -* The ability to clear stderr and stdout individually was removed. -* A new ``wait`` flag that prevents ``clear_output`` from being executed until new - output is available. This eliminates animation flickering by allowing the - user to double buffer the output. -* The output div height is remembered when the ``wait=True`` flag is used. diff --git a/docs/source/whatsnew/pr/incompat-drop-alias.rst b/docs/source/whatsnew/pr/incompat-drop-alias.rst deleted file mode 100644 index 570a7cf..0000000 --- a/docs/source/whatsnew/pr/incompat-drop-alias.rst +++ /dev/null @@ -1,3 +0,0 @@ -- The alias system has been reimplemented to use magic functions. There should be little - visible difference while automagics are enabled, as they are by default, but parts of the - :class:`~IPython.core.alias.AliasManager` API have been removed. diff --git a/docs/source/whatsnew/pr/incompat-drop-fakemodule.rst b/docs/source/whatsnew/pr/incompat-drop-fakemodule.rst deleted file mode 100644 index 65bfa11..0000000 --- a/docs/source/whatsnew/pr/incompat-drop-fakemodule.rst +++ /dev/null @@ -1 +0,0 @@ -* The module ``IPython.core.fakemodule`` has been removed. diff --git a/docs/source/whatsnew/pr/incompat-drop-pycolor.rst b/docs/source/whatsnew/pr/incompat-drop-pycolor.rst deleted file mode 100644 index c5c1cd2..0000000 --- a/docs/source/whatsnew/pr/incompat-drop-pycolor.rst +++ /dev/null @@ -1,4 +0,0 @@ -* The :command:`pycolor` command has been removed. We recommend the much more capable - :command:`pygmentize` command from the `Pygments `_ project. - If you need to keep the exact output of :command:`pycolor`, you can still use - ``python -m IPython.utils.PyColorize foo.py``. diff --git a/docs/source/whatsnew/pr/incompat-mpl-backend.rst b/docs/source/whatsnew/pr/incompat-mpl-backend.rst deleted file mode 100644 index f62e70c..0000000 --- a/docs/source/whatsnew/pr/incompat-mpl-backend.rst +++ /dev/null @@ -1,4 +0,0 @@ -We fixed an issue with switching between matplotlib inline and GUI backends, -but the fix requires matplotlib 1.1 or newer. So from now on, we consider -matplotlib 1.1 to be the minimally supported version for IPython. Older -versions for the most part will work, but we make no guarantees about it. diff --git a/docs/source/whatsnew/pr/select-notebook-rename.rst b/docs/source/whatsnew/pr/select-notebook-rename.rst deleted file mode 100644 index b731736..0000000 --- a/docs/source/whatsnew/pr/select-notebook-rename.rst +++ /dev/null @@ -1,6 +0,0 @@ -Select Notebook Name When Renaming a Notebook ---------------------------------------------- - -The default notebook name is Untitled. It's unlikely you want to keep this name -or part of it when naming your notebook. Instead, IPython will select the text -in the input field so the user can easily type over the name and change it. diff --git a/tools/update_whatsnew.py b/tools/update_whatsnew.py new file mode 100644 index 0000000..4d3a82d --- /dev/null +++ b/tools/update_whatsnew.py @@ -0,0 +1,74 @@ +"""Update the What's New doc (development version) + +This collects the snippets from whatsnew/pr/, moves their content into +whatsnew/development.rst (chronologically ordered), and deletes the snippets. +""" + +import io +import os +from os.path import dirname, basename, abspath, join as pjoin +from subprocess import check_call, check_output + +repo_root = dirname(dirname(abspath(__file__))) +whatsnew_dir = pjoin(repo_root, 'docs', 'source', 'whatsnew') +pr_dir = pjoin(whatsnew_dir, 'pr') +target = pjoin(whatsnew_dir, 'development.rst') + +FEATURE_MARK = ".. DO NOT EDIT THIS LINE BEFORE RELEASE. FEATURE INSERTION POINT." +INCOMPAT_MARK = ".. DO NOT EDIT THIS LINE BEFORE RELEASE. INCOMPAT INSERTION POINT." + +# 1. Collect the whatsnew snippet files --------------------------------------- + +files = set(os.listdir(pr_dir)) +# Ignore explanatory and example files +files.difference_update({'README.md', + 'incompat-switching-to-perl.rst', + 'antigravity-feature.rst'} + ) + +# Absolute paths +files = {pjoin(pr_dir, f) for f in files} + +def getmtime(f): + return check_output(['git', 'log', '-1', '--format="%ai"', '--', f]) + +files = sorted(files, key=getmtime) + +features, incompats = [], [] +for path in files: + with io.open(path, encoding='utf-8') as f: + content = f.read().rstrip() + if basename(path).startswith('incompat-'): + incompats.append(content) + else: + features.append(content) + +# Put the insertion markers back on the end, so they're ready for next time. +feature_block = '\n\n'.join(features + [FEATURE_MARK]) +incompat_block = '\n\n'.join(incompats + [INCOMPAT_MARK]) + +# 2. Update the target file --------------------------------------------------- + +with io.open(target, encoding='utf-8') as f: + content = f.read() + +assert content.count(FEATURE_MARK) == 1 +assert content.count(INCOMPAT_MARK) == 1 + +content = content.replace(FEATURE_MARK, feature_block) +content = content.replace(INCOMPAT_MARK, incompat_block) + +# Clean trailing whitespace +content = '\n'.join(l.rstrip() for l in content.splitlines()) + +with io.open(target, 'w', encoding='utf-8') as f: + f.write(content) + +# 3. Stage the changes in git ------------------------------------------------- + +for file in files: + check_call(['git', 'rm', file]) + +check_call(['git', 'add', target]) + +print("Merged what's new changes. Check the diff and commit the change.") \ No newline at end of file