diff --git a/IPython/core/inputtransformer2.py b/IPython/core/inputtransformer2.py index f697399..20237ce 100644 --- a/IPython/core/inputtransformer2.py +++ b/IPython/core/inputtransformer2.py @@ -541,7 +541,6 @@ class TransformerManager: cell += '\n' # Ensure the cell has a trailing newline lines = cell.splitlines(keepends=True) for transform in self.cleanup_transforms + self.line_transforms: - #print(transform, lines) lines = transform(lines) lines = self.do_token_transforms(lines) diff --git a/docs/source/conf.py b/docs/source/conf.py index 7d99ebd..edb9309 100755 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -87,8 +87,10 @@ def is_stable(extra): if is_stable(iprelease['_version_extra']): tags.add('ipystable') + print('Adding Tag: ipystable') else: tags.add('ipydev') + print('Adding Tag: ipydev') rst_prolog += """ .. warning:: @@ -143,8 +145,7 @@ today_fmt = '%B %d, %Y' # Exclude these glob-style patterns when looking for source files. They are # relative to the source/ directory. -exclude_patterns = ['whatsnew/pr/antigravity-feature.*', - 'whatsnew/pr/incompat-switching-to-perl.*'] +exclude_patterns = [] # If true, '()' will be appended to :func: etc. cross-reference text. diff --git a/docs/source/coredev/index.rst b/docs/source/coredev/index.rst index 5cb5b17..67e2c01 100644 --- a/docs/source/coredev/index.rst +++ b/docs/source/coredev/index.rst @@ -19,18 +19,17 @@ need to be backported to an earlier release; then it should be tagged with the correct ``milestone``. If you tag a pull request with a milestone **before** merging the pull request, -and the base ref is `master`, then our backport bot should automatically create +and the base ref is ``master``, then our backport bot should automatically create a corresponding pull-request that backport on the correct branch. -If you are an admin on the IPython repository you can also just mention the +If you have write access to the IPython repository you can also just mention the **backport bot** to do the work for you. The bot is evolving so instructions may be different. At the time of this writing you can use:: - @meeseeksdev[bot] backport [to ] + @meeseeksdev[bot] backport [to] The bot will attempt to backport the current pull-request and issue a PR if -possible. If the milestone is set on the issue you can omit the branch to -backport to. +possible. .. note:: @@ -149,8 +148,10 @@ If a major release: - Edit ``docs/source/whatsnew/index.rst`` to list the new ``github-stats-X`` file you just created. - - Remove temporarily the first entry called ``development`` (you'll need to - add it back after release). + - You do not need to temporarily remove the first entry called + ``development``, nor re-add it after the release, it will automatically be + hidden when releasing a stable version of IPython (if ``_version_extra`` + in ``release.py`` is an empty string. Make sure that the stats file has a header or it won't be rendered in the final documentation. diff --git a/docs/source/interactive/autoawait.rst b/docs/source/interactive/autoawait.rst index 0164f93..f0c2dab 100644 --- a/docs/source/interactive/autoawait.rst +++ b/docs/source/interactive/autoawait.rst @@ -5,7 +5,7 @@ Asynchronous in REPL: Autoawait .. note:: - This feature is experimental and behavior can change betwen python and + This feature is experimental and behavior can change between python and IPython version without prior deprecation. Starting with IPython 7.0, and when user Python 3.6 and above, IPython offer the diff --git a/docs/source/whatsnew/development.rst b/docs/source/whatsnew/development.rst index b8b2f00..532ba74 100644 --- a/docs/source/whatsnew/development.rst +++ b/docs/source/whatsnew/development.rst @@ -18,24 +18,10 @@ Need to be updated: .. toctree:: :maxdepth: 2 - :glob: + :glob: pr/* -IPython 6 feature a major improvement in the completion machinery which is now -capable of completing non-executed code. It is also the first version of IPython -to stop compatibility with Python 2, which is still supported on the bugfix only -5.x branch. Read below to have a non-exhaustive list of new features. - -Make sure you have pip > 9.0 before upgrading. -You should be able to update by using: - -.. code:: - - pip install ipython --upgrade - - - .. DO NOT EDIT THIS LINE BEFORE RELEASE. FEATURE INSERTION POINT. diff --git a/docs/source/whatsnew/index.rst b/docs/source/whatsnew/index.rst index 3ea26c3..62ae2c1 100644 --- a/docs/source/whatsnew/index.rst +++ b/docs/source/whatsnew/index.rst @@ -12,6 +12,29 @@ What's new in IPython ===================== +.. + this will appear in the docs if we are not releasing a versin (ie is + `_version_extra` in release.py is empty string + +.. only:: ipydev + + Development version in-progress features: + + .. toctree:: + + development + +.. + this make a hidden toctree that avoid sphinx to complain about documents + included nowhere when building docs for stable + +.. only:: ipystable + + .. toctree:: + :hidden: + + development + This section documents the changes that have been made in various versions of IPython. Users should consult these pages to learn about new features, bug fixes and backwards incompatibilities. Developers should summarize the @@ -20,7 +43,7 @@ development work they do here in a user friendly format. .. toctree:: :maxdepth: 1 - development + version7 version6 github-stats-6 version5 diff --git a/docs/source/whatsnew/pr/antigravity-feature.rst b/docs/source/whatsnew/pr/antigravity-feature.rst index e69de29..a53f8c7 100644 --- a/docs/source/whatsnew/pr/antigravity-feature.rst +++ b/docs/source/whatsnew/pr/antigravity-feature.rst @@ -0,0 +1,5 @@ +Antigravity feature +=================== + +Example new antigravity feature. Try ``import antigravity`` in a Python 3 +console. diff --git a/docs/source/whatsnew/pr/deprecations.rst b/docs/source/whatsnew/pr/deprecations.rst deleted file mode 100644 index 1d10c26..0000000 --- a/docs/source/whatsnew/pr/deprecations.rst +++ /dev/null @@ -1,10 +0,0 @@ -Deprecations -============ - -A couple of unused function and methods have been deprecated and will be removed -in future versions: - - - ``IPython.utils.io.raw_print_err`` - - ``IPython.utils.io.raw_print`` - - diff --git a/docs/source/whatsnew/pr/improve-autoreload.md b/docs/source/whatsnew/pr/improve-autoreload.md deleted file mode 100644 index 7062299..0000000 --- a/docs/source/whatsnew/pr/improve-autoreload.md +++ /dev/null @@ -1,30 +0,0 @@ -magic `%autoreload 2` now captures new methods added to classes. Earlier, only methods existing as of the initial import were being tracked and updated. - -This new feature helps dual environement development - Jupyter+IDE - where the code gradually moves from notebook cells to package files, as it gets structured. - -**Example**: An instance of the class `MyClass` will be able to access the method `cube()` after it is uncommented and the file `file1.py` saved on disk. - -````python -# notebook - -from mymodule import MyClass -first = MyClass(5) -```` - -````python -# mymodule/file1.py - -class MyClass: - - def __init__(self, a=10): - self.a = a - - def square(self): - print('compute square') - return self.a*self.a - - # def cube(self): - # print('compute cube') - # return self.a*self.a*self.a -```` - diff --git a/docs/source/whatsnew/pr/incompat-inputtransformer2.rst b/docs/source/whatsnew/pr/incompat-inputtransformer2.rst deleted file mode 100644 index ee3bd56..0000000 --- a/docs/source/whatsnew/pr/incompat-inputtransformer2.rst +++ /dev/null @@ -1,3 +0,0 @@ -* The API for transforming input before it is parsed as Python code has been - completely redesigned, and any custom input transformations will need to be - rewritten. See :doc:`/config/inputtransforms` for details of the new API. diff --git a/docs/source/whatsnew/pr/incompat-switching-to-perl.rst b/docs/source/whatsnew/pr/incompat-switching-to-perl.rst index e69de29..35f73df 100644 --- a/docs/source/whatsnew/pr/incompat-switching-to-perl.rst +++ b/docs/source/whatsnew/pr/incompat-switching-to-perl.rst @@ -0,0 +1 @@ +Starting with IPython 42, only perl code execution is allowed. See :ghpull:`42` diff --git a/docs/source/whatsnew/pr/magic-run-bug-fix.md b/docs/source/whatsnew/pr/magic-run-bug-fix.md deleted file mode 100644 index bd0ab76..0000000 --- a/docs/source/whatsnew/pr/magic-run-bug-fix.md +++ /dev/null @@ -1 +0,0 @@ -Make ``%run -n -i ...`` work correctly. Earlier, if ``%run`` was passed both arguments, ``-n`` would be silently ignored. diff --git a/docs/source/whatsnew/pr/re-autoindent.rst b/docs/source/whatsnew/pr/re-autoindent.rst deleted file mode 100644 index a670d5f..0000000 --- a/docs/source/whatsnew/pr/re-autoindent.rst +++ /dev/null @@ -1,2 +0,0 @@ -The autoindent feature that was deprecated in 5.x was re-enabled and -un-deprecated in :ghpull:`11257` diff --git a/docs/source/whatsnew/version0.13.rst b/docs/source/whatsnew/version0.13.rst index b1106eb..6314012 100644 --- a/docs/source/whatsnew/version0.13.rst +++ b/docs/source/whatsnew/version0.13.rst @@ -155,7 +155,7 @@ Other improvements to the Notebook These are some other notable small improvements to the notebook, in addition to many bug fixes and minor changes to add polish and robustness throughout: -* The notebook pager (the area at the bottom) is now resizeable by dragging its +* The notebook pager (the area at the bottom) is now Resizable by dragging its divider handle, a feature that had been requested many times by just about anyone who had used the notebook system. :ghpull:`1705`. diff --git a/docs/source/whatsnew/version3.rst b/docs/source/whatsnew/version3.rst index 56c5d9f..f230943 100644 --- a/docs/source/whatsnew/version3.rst +++ b/docs/source/whatsnew/version3.rst @@ -182,7 +182,7 @@ Other new features * ``NotebookApp.webapp_settings`` is deprecated and replaced with the more informatively named ``NotebookApp.tornado_settings``. -* Using :magic:`timeit` prints warnings if there is atleast a 4x difference in timings +* Using :magic:`timeit` prints warnings if there is at least a 4x difference in timings between the slowest and fastest runs, since this might meant that the multiple runs are not independent of one another. diff --git a/docs/source/whatsnew/pr/await-repl.rst b/docs/source/whatsnew/version7.rst similarity index 61% rename from docs/source/whatsnew/pr/await-repl.rst rename to docs/source/whatsnew/version7.rst index d61dc2e..7f35c4a 100644 --- a/docs/source/whatsnew/pr/await-repl.rst +++ b/docs/source/whatsnew/version7.rst @@ -1,3 +1,52 @@ +============ + 7.x Series +============ + +.. _whatsnew700: + +IPython 7.0.0 +============= + +.. warning:: + + IPython 7.0 is currently in Beta, Feedback on API/changes and + addition/updates to this cahngelog are welcomed. + +Released .... ...., 2017 + +IPython 7 include major features improvement as you can read in the following +changelog. This is also the second major version of IPython to stop support only +Python 3 – starting at Python 3.4. Python 2 is still still community supported +on the bugfix only 5.x branch, but we remind you that Python 2 EOL is Jan 1st +2020. + +We were able to backport bug fixes to the 5.x branch thanks to our backport bot which +backported more than `70 Pull-Requests +`_, but there are still many PRs that required manually work, and this is an area of the project were you can easily contribute by looking for `PRs still needed backport `_ + +IPython 6.x branch will likely not see any further release unless we critical +bugs are found. + +Make sure you have pip > 9.0 before upgrading. You should be able to update by simply runngin + +.. code:: + + pip install ipython --upgrade + +Or if you have conda installed: + +.. code:: + + conda install ipython + + + +Prompt Toolkit 2.0 +------------------ + +IPython 7.0+ now use ``prompt_toolkit 2.0``, if you still need to use earlier +``prompt_toolkit`` version you may need to pin IPython to ``<7.0``. + Autowait: Asynchronous REPL --------------------------- @@ -28,7 +77,7 @@ yourself. To know more read the :ref:`autoawait` section of our docs, see Async integration is experimental code, behavior may change or be removed between Python and IPython versions without warnings. -Integration is by default with `asyncio`, but other libraries can be configured, +Integration is by default with `asyncio`, but other libraries can be configured, like ``curio`` or ``trio``, to improve concurrency in the REPL:: In [1]: %autoawait trio @@ -61,8 +110,8 @@ See :ref:`autoawait` for more information. Asynchronous code in a Notebook interface or any other frontend using the Jupyter Protocol will need further updates of the IPykernel package. -Non-Asynchronous code ---------------------- +Non-Asynchronous code +~~~~~~~~~~~~~~~~~~~~~ As the internal API of IPython are now asynchronous, IPython need to run under an even loop. In order to allow many workflow, (like using the ``%run`` magic, @@ -71,29 +120,96 @@ is detected as not being asynchronous, IPython code is advanced via a pseudo-synchronous runner, and will not may not advance pending tasks. Change to Nested Embed ----------------------- +~~~~~~~~~~~~~~~~~~~~~~ The introduction of the ability to run async code had some effect on the ``IPython.embed()`` API. By default embed will not allow you to run asynchronous code unless a event loop is specified. Effects on Magics ------------------ +~~~~~~~~~~~~~~~~~ Some magics will not work with Async, and will need updates. Contribution welcome. Expected Future changes ------------------------ +~~~~~~~~~~~~~~~~~~~~~~~ We expect more internal but public IPython function to become ``async``, and will likely end up having a persisting event loop while IPython is running. Thanks ------- +~~~~~~ This took more than a year in the making, and the code was rebased a number of time leading to commit authorship that may have been lost in the final Pull-Request. Huge thanks to many people for contribution, discussion, code, documentation, use-case: dalejung, danielballan, ellisonbg, fperez, gnestor, minrk, njsmith, pganssle, tacaswell, takluyver , vidartf ... And many other. + + +Autoreload Improvement +---------------------- + +The magic ``%autoreload 2`` now captures new methods added to classes. Earlier, only methods existing as of the initial import were being tracked and updated. + +This new feature helps dual environment development - Jupyter+IDE - where the code gradually moves from notebook cells to package files, as it gets structured. + +**Example**: An instance of the class `MyClass` will be able to access the method `cube()` after it is uncommented and the file `file1.py` saved on disk. + + +..code:: + + # notebook + + from mymodule import MyClass + first = MyClass(5) + +.. code:: + + # mymodule/file1.py + + class MyClass: + + def __init__(self, a=10): + self.a = a + + def square(self): + print('compute square') + return self.a*self.a + + # def cube(self): + # print('compute cube') + # return self.a*self.a*self.a + + + + +Misc +---- + +The autoindent feature that was deprecated in 5.x was re-enabled and +un-deprecated in :ghpull:`11257` + +Make ``%run -n -i ...`` work correctly. Earlier, if ``%run`` was passed both arguments, ``-n`` would be silently ignored. See :ghpull:`10308` + + + + + +Deprecations +------------ + +A couple of unused function and methods have been deprecated and will be removed +in future versions: + + - ``IPython.utils.io.raw_print_err`` + - ``IPython.utils.io.raw_print`` + + +Backwards incompatible changes +------------------------------ + +* The API for transforming input before it is parsed as Python code has been + completely redesigned, and any custom input transformations will need to be + rewritten. See :doc:`/config/inputtransforms` for details of the new API. diff --git a/tools/fixup_whats_new_pr.py b/tools/fixup_whats_new_pr.py index bfba754..057b2e4 100644 --- a/tools/fixup_whats_new_pr.py +++ b/tools/fixup_whats_new_pr.py @@ -26,8 +26,11 @@ def main(): with open(filename) as f: data = f.read() - if data and data.splitlines()[1].startswith('='): - continue + try: + if data and data.splitlines()[1].startswith('='): + continue + except IndexError: + pass with open(filename, 'w') as f: f.write(title+'\n')