From 2863324126bd7f4f79876828221052148b2dfa28 2021-10-21 02:31:24 From: Matthias Bussonnier Date: 2021-10-21 02:31:24 Subject: [PATCH] Merge pull request #13205 from DimitriPapadopoulos/codespell Typos found by codespell --- diff --git a/IPython/core/completer.py b/IPython/core/completer.py index 8ec99f4..736d226 100644 --- a/IPython/core/completer.py +++ b/IPython/core/completer.py @@ -157,8 +157,8 @@ except ImportError: #----------------------------------------------------------------------------- # ranges where we have most of the valid unicode names. We could be more finer -# grained but is it worth it for performace While unicode have character in the -# rage 0, 0x110000, we seem to have name for about 10% of those. (131808 as I +# grained but is it worth it for performance While unicode have character in the +# range 0, 0x110000, we seem to have name for about 10% of those. (131808 as I # write this). With below range we cover them all, with a density of ~67% # biggest next gap we consider only adds up about 1% density and there are 600 # gaps that would need hard coding. @@ -2062,7 +2062,7 @@ class IPCompleter(Completer): A tuple of N elements which are (likely): matched_text: ? the text that the complete matched matches: list of completions ? - matches_origin: ? list same lenght as matches, and where each completion came from + matches_origin: ? list same length as matches, and where each completion came from jedi_matches: list of Jedi matches, have it's own structure. """ @@ -2179,7 +2179,7 @@ class IPCompleter(Completer): # TODO: self.unicode_names is here a list we traverse each time with ~100k elements. # We could do a faster match using a Trie. - # Using pygtrie the follwing seem to work: + # Using pygtrie the following seem to work: # s = PrefixSet() diff --git a/IPython/core/debugger.py b/IPython/core/debugger.py index 7511458..978af30 100644 --- a/IPython/core/debugger.py +++ b/IPython/core/debugger.py @@ -69,8 +69,8 @@ or configure it in your ``.pdbrc`` -Licencse --------- +License +------- Modified from the standard pdb.Pdb class to avoid including readline, so that the command line completion of other programs which include this isn't @@ -429,7 +429,7 @@ class Pdb(OldPdb): # The f_locals dictionary is updated from the actual frame # locals whenever the .f_locals accessor is called, so we # avoid calling it here to preserve self.curframe_locals. - # Futhermore, there is no good reason to hide the current frame. + # Furthermore, there is no good reason to hide the current frame. ip_hide = [self._hidden_predicate(s[0]) for s in stack] ip_start = [i for i, s in enumerate(ip_hide) if s == "__ipython_bottom__"] if ip_start and self._predicates["ipython_internal"]: @@ -522,8 +522,8 @@ class Pdb(OldPdb): def _get_frame_locals(self, frame): """ " - Acessing f_local of current frame reset the namespace, so we want to avoid - that or the following can happend + Accessing f_local of current frame reset the namespace, so we want to avoid + that or the following can happen ipdb> foo "old" @@ -995,7 +995,7 @@ class Pdb(OldPdb): if counter >= count: break else: - # if no break occured. + # if no break occurred. self.error( "all frames above hidden, use `skip_hidden False` to get get into those." ) @@ -1040,7 +1040,7 @@ class Pdb(OldPdb): break else: self.error( - "all frames bellow hidden, use `skip_hidden False` to get get into those." + "all frames below hidden, use `skip_hidden False` to get get into those." ) return diff --git a/IPython/core/tests/test_alias.py b/IPython/core/tests/test_alias.py index 90971de..a84b009 100644 --- a/IPython/core/tests/test_alias.py +++ b/IPython/core/tests/test_alias.py @@ -49,7 +49,7 @@ def test_alias_args_commented(): _ip.run_cell('commetarg') # strip() is for pytest compat; testing via iptest patch IPython shell - # in testin.globalipapp and replace the system call which messed up the + # in testing.globalipapp and replace the system call which messed up the # \r\n assert cap.stdout.strip() == 'this is %s a commented out arg' diff --git a/IPython/core/tests/test_completer.py b/IPython/core/tests/test_completer.py index ad5a080..689b93e 100644 --- a/IPython/core/tests/test_completer.py +++ b/IPython/core/tests/test_completer.py @@ -86,7 +86,7 @@ def test_unicode_range(): size, start, stop, prct = recompute_unicode_ranges() message = f"""_UNICODE_RANGES likely wrong and need updating. This is likely due to a new release of Python. We've find that the biggest gap - in unicode characters has reduces in size to be {size} charaters + in unicode characters has reduces in size to be {size} characters ({prct}), from {start}, to {stop}. In completer.py likely update to _UNICODE_RANGES = [(32, {start}), ({stop}, 0xe01f0)] @@ -302,7 +302,7 @@ class TestCompleter(unittest.TestCase): def test_back_latex_completion(self): ip = get_ipython() - # do not return more than 1 matches fro \beta, only the latex one. + # do not return more than 1 matches for \beta, only the latex one. name, matches = ip.complete("\\β") nt.assert_equal(matches, ['\\beta']) diff --git a/IPython/core/tests/test_display.py b/IPython/core/tests/test_display.py index 4b783bc..15cae21 100644 --- a/IPython/core/tests/test_display.py +++ b/IPython/core/tests/test_display.py @@ -125,7 +125,7 @@ def test_image_filename_defaults(): embed=True) nt.assert_raises(ValueError, display.Image) nt.assert_raises(ValueError, display.Image, data='this is not an image', format='badformat', embed=True) - # check boths paths to allow packages to test at build and install time + # check both paths to allow packages to test at build and install time imgfile = os.path.join(tpath, 'core/tests/2x2.png') img = display.Image(filename=imgfile) nt.assert_equal('png', img.format) diff --git a/IPython/core/tests/test_inputtransformer2.py b/IPython/core/tests/test_inputtransformer2.py index e024d7c..cd7c531 100644 --- a/IPython/core/tests/test_inputtransformer2.py +++ b/IPython/core/tests/test_inputtransformer2.py @@ -300,7 +300,7 @@ def test_check_complete_II(): def test_check_complete_invalidates_sunken_brackets(): """ Test that a single line with more closing brackets than the opening ones is - interpretted as invalid + interpreted as invalid """ cc = ipt2.TransformerManager().check_complete nt.assert_equal(cc(")"), ("invalid", None)) diff --git a/IPython/core/tests/test_run.py b/IPython/core/tests/test_run.py index 9634913..5b69064 100644 --- a/IPython/core/tests/test_run.py +++ b/IPython/core/tests/test_run.py @@ -557,7 +557,7 @@ def test_multiprocessing_run(): """Set we can run mutiprocesgin without messing up up main namespace Note that import `nose.tools as nt` mdify the value s - sys.module['__mp_main__'] so wee need to temporarily set it to None to test + sys.module['__mp_main__'] so we need to temporarily set it to None to test the issue. """ with TemporaryDirectory() as td: diff --git a/IPython/extensions/tests/test_autoreload.py b/IPython/extensions/tests/test_autoreload.py index a84c8c9..4bccd40 100644 --- a/IPython/extensions/tests/test_autoreload.py +++ b/IPython/extensions/tests/test_autoreload.py @@ -303,7 +303,7 @@ class TestAutoreload(Fixture): self.shell.run_code("t = Test()") # test global built-in var now exists self.shell.run_code("number") - # test the enumerations gets loaded succesfully + # test the enumerations gets loaded successfully self.shell.run_code("TestEnum.A") # ----------- TEST NEW OBJ CAN BE CHANGED -------------------- diff --git a/IPython/external/qt_loaders.py b/IPython/external/qt_loaders.py index 7980535..982590e 100644 --- a/IPython/external/qt_loaders.py +++ b/IPython/external/qt_loaders.py @@ -198,7 +198,7 @@ def import_pyqt4(version=2): Which QString/QVariant API to use. Set to None to use the system default - ImportErrors rasied within this function are non-recoverable + ImportErrors raised within this function are non-recoverable """ # The new-style string API (version=2) automatically # converts QStrings to Unicode Python strings. Also, automatically unpacks @@ -229,7 +229,7 @@ def import_pyqt5(): """ Import PyQt5 - ImportErrors rasied within this function are non-recoverable + ImportErrors raised within this function are non-recoverable """ from PyQt5 import QtCore, QtSvg, QtWidgets, QtGui @@ -251,7 +251,7 @@ def import_pyqt6(): """ Import PyQt6 - ImportErrors rasied within this function are non-recoverable + ImportErrors raised within this function are non-recoverable """ from PyQt6 import QtCore, QtSvg, QtWidgets, QtGui diff --git a/IPython/lib/backgroundjobs.py b/IPython/lib/backgroundjobs.py index 31997e1..588c15b 100644 --- a/IPython/lib/backgroundjobs.py +++ b/IPython/lib/backgroundjobs.py @@ -135,7 +135,7 @@ class BackgroundJobManager(object): job_manager.new(myfunc, x, y, kw=dict(z=1)) - The reason for this assymmetry is that the new() method needs to + The reason for this asymmetry is that the new() method needs to maintain access to its own keywords, and this prevents name collisions between arguments to new() and arguments to your own functions. diff --git a/IPython/lib/demo.py b/IPython/lib/demo.py index bfef82f..8367a6f 100644 --- a/IPython/lib/demo.py +++ b/IPython/lib/demo.py @@ -532,7 +532,7 @@ class Demo(object): elif token[0] == Token.Comment.Single: toks.append((Token.Comment.Single, token[1][0])) # parse comment content by rst lexer - # remove the extrat newline added by rst lexer + # remove the extra newline added by rst lexer toks += list(pygments.lex(token[1][1:], self.rst_lexer))[:-1] else: toks.append(token) diff --git a/IPython/testing/decorators.py b/IPython/testing/decorators.py index e31a47b..a2458ce 100644 --- a/IPython/testing/decorators.py +++ b/IPython/testing/decorators.py @@ -156,7 +156,7 @@ def make_label_dec(label, ds=None): def skip_iptest_but_not_pytest(f): """ - Warnign this will make the test invisible to iptest. + Warning this will make the test invisible to iptest. """ import os diff --git a/IPython/utils/path.py b/IPython/utils/path.py index cc10dff..b347e98 100644 --- a/IPython/utils/path.py +++ b/IPython/utils/path.py @@ -209,7 +209,7 @@ def get_home_dir(require_writable=False) -> str: pass if (not require_writable) or _writable_dir(homedir): - assert isinstance(homedir, str), "Homedir shoudl be unicode not bytes" + assert isinstance(homedir, str), "Homedir should be unicode not bytes" return homedir else: raise HomeDirError('%s is not a writable dir, ' diff --git a/examples/IPython Kernel/gui/gui-gtk.py b/examples/IPython Kernel/gui/gui-gtk.py index 80d888a..3df9922 100755 --- a/examples/IPython Kernel/gui/gui-gtk.py +++ b/examples/IPython Kernel/gui/gui-gtk.py @@ -13,7 +13,7 @@ pygtk.require('2.0') import gtk -def hello_world(wigdet, data=None): +def hello_world(widget, data=None): print("Hello World") def delete_event(widget, event, data=None): diff --git a/examples/IPython Kernel/gui/gui-gtk3.py b/examples/IPython Kernel/gui/gui-gtk3.py index 935c026..f35f498 100644 --- a/examples/IPython Kernel/gui/gui-gtk3.py +++ b/examples/IPython Kernel/gui/gui-gtk3.py @@ -11,7 +11,7 @@ In [2]: %run gui-gtk3.py from gi.repository import Gtk -def hello_world(wigdet, data=None): +def hello_world(widget, data=None): print("Hello World") def delete_event(widget, event, data=None): diff --git a/examples/IPython Kernel/gui/gui-gtk4.py b/examples/IPython Kernel/gui/gui-gtk4.py index bb8c56b..44ff1d9 100644 --- a/examples/IPython Kernel/gui/gui-gtk4.py +++ b/examples/IPython Kernel/gui/gui-gtk4.py @@ -14,7 +14,7 @@ gi.require_version("Gtk", "4.0") from gi.repository import Gtk, GLib # noqa -def hello_world(wigdet, data=None): +def hello_world(widget, data=None): print("Hello World") diff --git a/tools/release_helper.sh b/tools/release_helper.sh index ee7c06b..1c1d5e6 100644 --- a/tools/release_helper.sh +++ b/tools/release_helper.sh @@ -62,7 +62,7 @@ maybe_edit(){ echo -if ask_section "Updating what's new with informations from docs/source/whatsnew/pr" +if ask_section "Updating what's new with information from docs/source/whatsnew/pr" then python tools/update_whatsnew.py @@ -100,7 +100,7 @@ then git checkout $PREV_RELEASE echo $BLUE"Saving API to file $PREV_RELEASE"$NOR frappuccino IPython --save IPython-$PREV_RELEASE.json - echo $BLUE"comming back to $BRANCH"$NOR + echo $BLUE"coming back to $BRANCH"$NOR git checkout $BRANCH echo $BLUE"comparing ..."$NOR frappuccino IPython --compare IPython-$PREV_RELEASE.json diff --git a/tools/retar.py b/tools/retar.py index 3615e74..b81345d 100644 --- a/tools/retar.py +++ b/tools/retar.py @@ -9,7 +9,7 @@ usage: The process of creating an sdist can be non-reproducible: - directory created during the process get a mtime of the creation date; - - gziping files embed the timestamp of fo zip creation. + - gziping files embed the timestamp of zip creation. This will untar-retar; ensuring that all mtime > SOURCE_DATE_EPOCH will be set equal to SOURCE_DATE_EPOCH. diff --git a/tools/tests/CSS Reference.ipynb b/tools/tests/CSS Reference.ipynb index a9e0c74..a567cc6 100644 --- a/tools/tests/CSS Reference.ipynb +++ b/tools/tests/CSS Reference.ipynb @@ -8144,7 +8144,7 @@ " \n", " \n", " \n", - " but thi\n", + " but this\n", " is the \n", " \n", " \n",