ipython 9.0.1__py3-none-any.whl → 9.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,6 +17,7 @@ import sys
17
17
  import tokenize
18
18
  from typing import List, Tuple, Optional, Any
19
19
  import warnings
20
+ from textwrap import dedent
20
21
 
21
22
  from IPython.utils import tokenutil
22
23
 
@@ -38,18 +39,11 @@ def leading_empty_lines(lines):
38
39
  def leading_indent(lines):
39
40
  """Remove leading indentation.
40
41
 
41
- If the first line starts with a spaces or tabs, the same whitespace will be
42
- removed from each following line in the cell.
42
+ Removes the minimum common leading indentation from all lines.
43
43
  """
44
44
  if not lines:
45
45
  return lines
46
- m = _indent_re.match(lines[0])
47
- if not m or lines[0].strip().startswith("#"):
48
- return lines
49
- space = m.group(0)
50
- n = len(space)
51
- return [l[n:] if l.startswith(space) else l
52
- for l in lines]
46
+ return dedent("".join(lines)).splitlines(keepends=True)
53
47
 
54
48
  class PromptStripper:
55
49
  """Remove matching input prompts from a block of input.
@@ -329,6 +329,7 @@ class InteractiveShell(SingletonConfigurable):
329
329
 
330
330
  _instance = None
331
331
  _user_ns: dict
332
+ _sys_modules_keys: set[str, AnyType]
332
333
 
333
334
  inspector: oinspect.Inspector
334
335
 
@@ -764,7 +765,9 @@ class InteractiveShell(SingletonConfigurable):
764
765
  if not new == new.lower():
765
766
  warn(
766
767
  f"`TerminalInteractiveShell.colors` is now lowercase: `{new.lower()}`,"
767
- " non lowercase, may invalid in the future."
768
+ " non lowercase, may be invalid in the future.",
769
+ DeprecationWarning,
770
+ stacklevel=2,
768
771
  )
769
772
  return new.lower()
770
773
 
@@ -781,7 +784,8 @@ class InteractiveShell(SingletonConfigurable):
781
784
  )
782
785
 
783
786
  try:
784
- self.inspector.set_theme_name(self.colors)
787
+ # Deprecation in 9.0, colors should always be lower
788
+ self.inspector.set_theme_name(self.colors.lower())
785
789
  except Exception:
786
790
  warn(
787
791
  "Error changing object inspector color schemes.\n%s"
@@ -804,20 +808,19 @@ class InteractiveShell(SingletonConfigurable):
804
808
 
805
809
  self.dir_stack = []
806
810
 
807
- def init_logger(self):
811
+ def init_logger(self) -> None:
808
812
  self.logger = Logger(self.home_dir, logfname='ipython_log.py',
809
813
  logmode='rotate')
810
814
 
811
- def init_logstart(self):
815
+ def init_logstart(self) -> None:
812
816
  """Initialize logging in case it was requested at the command line.
813
817
  """
814
818
  if self.logappend:
815
- self.magic('logstart %s append' % self.logappend)
819
+ self.run_line_magic("logstart", f"{self.logappend} append")
816
820
  elif self.logfile:
817
- self.magic('logstart %s' % self.logfile)
821
+ self.run_line_magic("logstart", self.logfile)
818
822
  elif self.logstart:
819
- self.magic('logstart')
820
-
823
+ self.run_line_magic("logstart", "")
821
824
 
822
825
  def init_builtins(self):
823
826
  # A single, static flag that we set to True. Its presence indicates
IPython/core/oinspect.py CHANGED
@@ -401,7 +401,13 @@ class Inspector(Configurable):
401
401
  parent=None,
402
402
  config=None,
403
403
  ):
404
- assert theme_name == theme_name.lower(), theme_name
404
+ if theme_name in ["Linux", "LightBG", "Neutral", "NoColor"]:
405
+ warnings.warn(
406
+ f"Theme names and color schemes are lowercase in IPython 9.0 use {theme_name.lower()} instead",
407
+ DeprecationWarning,
408
+ stacklevel=2,
409
+ )
410
+ theme_name = theme_name.lower()
405
411
  self._theme_name = theme_name
406
412
  super(Inspector, self).__init__(parent=parent, config=config)
407
413
  self.parser = PyColorize.Parser(out="str", theme_name=theme_name)
IPython/core/release.py CHANGED
@@ -17,7 +17,7 @@
17
17
  # version
18
18
  _version_major = 9
19
19
  _version_minor = 0
20
- _version_patch = 1
20
+ _version_patch = 2
21
21
  _version_extra = ".dev"
22
22
  # _version_extra = "b2"
23
23
  _version_extra = "" # Uncomment this for full releases
IPython/core/tbtools.py CHANGED
@@ -401,7 +401,13 @@ class TBTools:
401
401
  stacklevel=2,
402
402
  )
403
403
  theme_name = color_scheme
404
- assert theme_name.lower() == theme_name, theme_name
404
+ if theme_name in ["Linux", "LightBG", "Neutral", "NoColor"]:
405
+ warnings.warn(
406
+ f"Theme names and color schemes are lowercase in IPython 9.0 use {theme_name.lower()} instead",
407
+ DeprecationWarning,
408
+ stacklevel=2,
409
+ )
410
+ theme_name = theme_name.lower()
405
411
  # Whether to call the interactive pdb debugger after printing
406
412
  # tracebacks or not
407
413
  super().__init__()
IPython/core/tips.py CHANGED
@@ -76,7 +76,7 @@ _tips: Any = {
76
76
  "Use `object?` to see the help on `object`, `object??` to view it's source",
77
77
  "`?` alone on a line will brings up IPython's help",
78
78
  "You can use `%hist` to view history, see the options with `%history?`",
79
- "You can change the edditing mode of IPython to behave more like vi, or emacs.",
79
+ "You can change the editing mode of IPython to behave more like vi, or emacs.",
80
80
  "IPython 9.0+ have hooks to integrate AI/LLM completions.",
81
81
  "Use `%timeit` or `%%timeit`, and the `-r`, `-n`, and `-o` options to easily profile your code.",
82
82
  "Use `ipython --help-all | less` to view all the IPython configurations options.",
@@ -50,7 +50,6 @@ def inputhook(context):
50
50
  except AttributeError: # Only for Qt>=5.14.
51
51
  pass
52
52
  _appref = app = QtGui.QApplication([" "])
53
- _eventloop = QtCore.QEventLoop(app)
54
53
 
55
54
  # "reclaim" IPython sys.excepthook after event loop starts
56
55
  # without this, it defaults back to BaseIPythonApplication.excepthook
@@ -58,6 +57,9 @@ def inputhook(context):
58
57
  # formatting and look like "bug in IPython".
59
58
  QtCore.QTimer.singleShot(0, _reclaim_excepthook)
60
59
 
60
+ if _eventloop is None:
61
+ _eventloop = QtCore.QEventLoop(app)
62
+
61
63
  if sys.platform == 'win32':
62
64
  # The QSocketNotifier method doesn't appear to work on Windows.
63
65
  # Use polling instead.
@@ -203,7 +203,7 @@ AUTO_SUGGEST_BINDINGS = [
203
203
  Binding(
204
204
  auto_suggest.accept,
205
205
  ["right"],
206
- "has_suggestion & default_buffer_focused & emacs_like_insert_mode",
206
+ "has_suggestion & default_buffer_focused & emacs_like_insert_mode & is_cursor_at_the_end_of_line",
207
207
  ),
208
208
  Binding(
209
209
  auto_suggest.accept_word,
@@ -3,6 +3,7 @@ import os
3
3
  import sys
4
4
  import token
5
5
  import tokenize
6
+ import warnings
6
7
  from io import StringIO
7
8
  from typing import TypeAlias
8
9
 
@@ -353,7 +354,6 @@ class Parser:
353
354
  Call format() to process code.
354
355
  """
355
356
 
356
-
357
357
  assert theme_name is not None
358
358
 
359
359
  self.out = out
@@ -361,7 +361,13 @@ class Parser:
361
361
  self.lines = None
362
362
  self.raw = None
363
363
  if theme_name is not None:
364
- assert theme_name == theme_name.lower()
364
+ if theme_name in ["Linux", "LightBG", "Neutral", "NoColor"]:
365
+ warnings.warn(
366
+ f"Theme names and color schemes are lowercase in IPython 9.0 use {theme_name.lower()} instead",
367
+ DeprecationWarning,
368
+ stacklevel=2,
369
+ )
370
+ theme_name = theme_name.lower()
365
371
  if not theme_name:
366
372
  self.theme_name = "nocolor"
367
373
  else:
IPython/utils/_sysinfo.py CHANGED
@@ -1,2 +1,2 @@
1
1
  # GENERATED BY setup.py
2
- commit = "d64897cf0"
2
+ commit = "9970f5e4b"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ipython
3
- Version: 9.0.1
3
+ Version: 9.0.2
4
4
  Summary: IPython: Productive Interactive Computing
5
5
  Author: The IPython Development Team
6
6
  Author-email: ipython-dev@python.org
@@ -29,14 +29,14 @@ IPython/core/guarded_eval.py,sha256=dQXW-e3wM6z9WGcszdJLhqiK0UCii303GOOXd3z3ze8,
29
29
  IPython/core/history.py,sha256=aTBJxCtZ_gPPJbzhAj6bOqII8AJClVWTH7xZX44m5jk,40602
30
30
  IPython/core/historyapp.py,sha256=xVVF2UmWH7UUYg6L4bmpMnSgC1C7QXwNEDbQ1Waedkc,5871
31
31
  IPython/core/hooks.py,sha256=xBWTZqycxZi97yj01IFc-SoJBzV5B73IoDHbAAlKUpQ,5193
32
- IPython/core/inputtransformer2.py,sha256=90eWEZMKJdPTnRHCENGGp5BLDg4jn1a2PP-WCJzgUmg,29108
33
- IPython/core/interactiveshell.py,sha256=aqyzXD2VXYsTs9_OmcNCRkw3lClPKL4eBPU1Nohl8y8,153561
32
+ IPython/core/inputtransformer2.py,sha256=7sRleytrcAbp5PZMOrDw59MjUAGXg5BbaRbPkSW83-I,28909
33
+ IPython/core/interactiveshell.py,sha256=uAGkI0JslwYzc2WEhl3R38gqLG2w9xQpAJjhLuCVZ0g,153787
34
34
  IPython/core/latex_symbols.py,sha256=DzFecvqWVSsdN7vWAsp0mlYAHRDQKfZGAmvuDUh0M-s,30127
35
35
  IPython/core/logger.py,sha256=Iwe4xKMmxEdvSwHYPMfsTWkmdaqVCgvZT3R3I3qTmrU,8436
36
36
  IPython/core/macro.py,sha256=OhvXWNhLe393rI2wTpMgbUVHWSnmC_ycHiYqzqSHXZU,1726
37
37
  IPython/core/magic.py,sha256=sUPVeVSk70aGVaPXncrSJxYJU8u_6YGCnR3folx8wys,28967
38
38
  IPython/core/magic_arguments.py,sha256=utkhQzGmn9Uw-ye33VO9P8ryP1L6ghkPcCdmhjri8K0,9701
39
- IPython/core/oinspect.py,sha256=h7Q-2gcB-UomOa0RG2q03DvWQ-5y4-2oLBC2GCKOmVU,40008
39
+ IPython/core/oinspect.py,sha256=_C6tUncGVHmaU89_chHRknQJ264mDYxzsNxeHNYFOao,40280
40
40
  IPython/core/page.py,sha256=P8Dmo0MjUq71DEnIPM_kaSGZoKTaPkrk4sUuM4I6HDA,11788
41
41
  IPython/core/payload.py,sha256=uHcwG5Ahm3fnz2dsIKbzYK_lHOilqfen0IhQffOUQbE,1763
42
42
  IPython/core/payloadpage.py,sha256=xGz4Ov82-0lmhKSIlM-kyIa50COk-ojB7tXLkGIRnPw,1177
@@ -44,11 +44,11 @@ IPython/core/prefilter.py,sha256=JHQ3feaD4bhoBDqZcEgmlDjQ2sfRXC1DNjgJhpaMU7E,257
44
44
  IPython/core/profileapp.py,sha256=bFMFIyehxeF9pDUtxw_6D3b0nxeqsupKTe7XhH7GMkc,10711
45
45
  IPython/core/profiledir.py,sha256=-vjOa1I_UajMZJblJRYXh16Y0RaAUn5a2swQBsw2qEU,8459
46
46
  IPython/core/pylabtools.py,sha256=LfNV9xCJ3flCfJXmv1NaCRYj9jZDtHAQ5oSEHWo3Gmg,17376
47
- IPython/core/release.py,sha256=nu_JnLtjTGKAMSpAGsTpwjqQoqgAH_XxxPSCZuyIFVo,1505
47
+ IPython/core/release.py,sha256=Xh10_c3N-D5TcMiswCtqiR5brz6KpxliDhScbJLcRuI,1505
48
48
  IPython/core/shellapp.py,sha256=oZIzj_sqIXrN3qyyhinZ1gLXvFviKYHkmS4H3wVEb74,19307
49
49
  IPython/core/splitinput.py,sha256=bAX1puQjvYB-otJyqiqeOhWj6dooWuQeNVx2YdaKQs8,5006
50
- IPython/core/tbtools.py,sha256=Ykn8800kc2B2Z3UX91mDXUvR_px_PzmTo3LuSfJwre8,16608
51
- IPython/core/tips.py,sha256=agqHkb-vC4mKdNqWvcOvdvILWCruBY6-tdJ9ToIs2jg,6165
50
+ IPython/core/tbtools.py,sha256=X4iB5zKAT2y4TK1R9l3d3kiW5htrzKn3qxalFFe2xzI,16880
51
+ IPython/core/tips.py,sha256=EBvLHsSwa5EwXjIJDotgm_t5r_dWWvnkJy-e1WvphoU,6164
52
52
  IPython/core/ultratb.py,sha256=ItaUt56wPnptv6f5ecbcBR3FtHljTDoIRHKsU-ZWGqI,46265
53
53
  IPython/core/usage.py,sha256=agrZE5eZIvJnXoqI8VV9e-oWZx5LbLxUq9MdQpEyts4,13542
54
54
  IPython/core/magics/__init__.py,sha256=pkd-UfzjDGp5UHuFKjw192vZnigpTP9ftXzG3oLdiS8,1619
@@ -109,10 +109,10 @@ IPython/terminal/pt_inputhooks/gtk3.py,sha256=_MuZIjZuLsW2i4vvUjNQh9u4xIU8kcITyJ
109
109
  IPython/terminal/pt_inputhooks/gtk4.py,sha256=r_MxCT7a0nTHZtqyuZpPgCW2Cl7iuomC0PjgFteSL9c,557
110
110
  IPython/terminal/pt_inputhooks/osx.py,sha256=TnndyR_SPbmWC_A--0ORB06rhH7IS2_7kjphfPcRqXo,4448
111
111
  IPython/terminal/pt_inputhooks/pyglet.py,sha256=wDDQDgilvK9uzwGB3XyAqcf8LfKr-Lc_NMAzunZMu_Y,2371
112
- IPython/terminal/pt_inputhooks/qt.py,sha256=mdPInyP_AXl3OiKsuCnwaaPHCQuBcny7YiULMqB5wyo,3451
112
+ IPython/terminal/pt_inputhooks/qt.py,sha256=ivVQu3UzzfGGeuowh6lNeVtuOJOL7g_VTKcgMG8JHpM,3479
113
113
  IPython/terminal/pt_inputhooks/tk.py,sha256=FjejvtwbvpeBZLoBCci1RDo_jWD5qElMy7PP-atd8j4,3651
114
114
  IPython/terminal/pt_inputhooks/wx.py,sha256=9yI52lDSZ3O_5Gww_3IeenEk_3PepLIME3Onh4X3kW0,7126
115
- IPython/terminal/shortcuts/__init__.py,sha256=QlXJBs_B6Sb_rla9-m2Mtn5b69LjUPGXFBI9On8cmDY,18532
115
+ IPython/terminal/shortcuts/__init__.py,sha256=irSX9mwHzeLDQ95fXRGdZxduRknwATtESvm2NIov7KU,18563
116
116
  IPython/terminal/shortcuts/auto_match.py,sha256=9uT1fDb-c4Ew7TSIs_zET1jSxDlbfWGluxfW_pj39tk,3066
117
117
  IPython/terminal/shortcuts/auto_suggest.py,sha256=dJGZGymi8xEmCurPYsqYeWHMP5kfqcnCcezDdBlv9wk,23177
118
118
  IPython/terminal/shortcuts/filters.py,sha256=MgRTQWq8YfIyWvMASuQ9BGKq5RQwiEY5trSyMnMtJAo,10998
@@ -134,7 +134,7 @@ IPython/testing/plugin/test_example.txt,sha256=CGM8aZIYHlePDdAnR1yX3MfDGu0OceZpU
134
134
  IPython/testing/plugin/test_exampleip.txt,sha256=5gLcj8iCk-WCOGz0ObpQpuZMhGwS1jUMyH3mouGxQJI,814
135
135
  IPython/testing/plugin/test_ipdoctest.py,sha256=Lc3qQdZ3amXf9EKA7JlXf30b3BzP8RwdNS9-SMRe2P0,1907
136
136
  IPython/testing/plugin/test_refs.py,sha256=y-Y2Q8niRIbaanbwpIzvEwwaHkJfAq10HYfb4bAXHBc,715
137
- IPython/utils/PyColorize.py,sha256=kdxL1H7O3xKF7VUt22Sqr_GllCpemZ8458ekNCksiX0,15230
137
+ IPython/utils/PyColorize.py,sha256=VyNAE6pgw8sCrS2-1v4p30TZIHe6SFz_0YqLUdsOc4k,15553
138
138
  IPython/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
139
139
  IPython/utils/_process_cli.py,sha256=tJWYMEgNYgeMx9v-n3YLbKW0tPbFtpczfDH28RC3n4A,2020
140
140
  IPython/utils/_process_common.py,sha256=hMFRGOJh-n-uBcSAOnr2qetQXAthMVpS8mwRcZuQqlo,7306
@@ -142,7 +142,7 @@ IPython/utils/_process_emscripten.py,sha256=lGLQb2IgmanNtb502KflfuKIhgOF119Ji3cw
142
142
  IPython/utils/_process_posix.py,sha256=aOEtguhS3vdWngBpws1XQURO8Ozqd5gRiCk9VLky6tA,7502
143
143
  IPython/utils/_process_win32.py,sha256=Pcf6ZiqMbqDT79edzegE_AX3D367UtE8bbhT41no54A,6775
144
144
  IPython/utils/_process_win32_controller.py,sha256=hi2eR7mLbl3TTMCVbgps85GppxdtYbhOYK_l13WvYaM,21343
145
- IPython/utils/_sysinfo.py,sha256=8HN3ofgcQohynlP6vnyusj49LkUxp-9OHe7bqtdxD0E,45
145
+ IPython/utils/_sysinfo.py,sha256=k_tFtBwenx5P8zcV-6FTx5UbGvbQ9A6h5D7WevWmHoI,45
146
146
  IPython/utils/capture.py,sha256=h5yL5Lxq8bgO1SFpoNDYjEi6mh1IW_2X9CE7vOsUxE4,5137
147
147
  IPython/utils/coloransi.py,sha256=CML-SkzLa7oaIK1qypb3uwcfPXDeKHxZQiMJ0IWvUY0,293
148
148
  IPython/utils/contexts.py,sha256=w5_uXc0WTU3KKV1kcCW9A0_Mz5mGRoeGWMq_P_eo-Dg,1610
@@ -174,11 +174,11 @@ IPython/utils/text.py,sha256=6s-y4KvDmnJxLs0urf5D-1auZGSnj2xmXgQ-9jVu0N8,18788
174
174
  IPython/utils/timing.py,sha256=nND-ZUBkHWfYevvbRG-YfOSIFczz_epzMqWK5PH6nqA,4275
175
175
  IPython/utils/tokenutil.py,sha256=x6KQ6ZCGOY7j5GQcr7byJRZSBFgyBcfkTiLtjxkl9f8,6552
176
176
  IPython/utils/wildcard.py,sha256=6EEc3OEYp-IuSoidL6nwpaHg--GxnzbAJTmFiz77CNE,4612
177
- ipython-9.0.1.data/data/share/man/man1/ipython.1,sha256=PVdQP2hHmHyUEwzLOPcgavnCe9jTDVrM1jKZt4cnF_Q,2058
178
- ipython-9.0.1.dist-info/COPYING.rst,sha256=NBr8vXKYh7cEb-e5j8T07f867Y048G7v2bMGcPBD3xc,1639
179
- ipython-9.0.1.dist-info/LICENSE,sha256=4OOQdI7UQKuJPKHxNaiKkgqvVAnbuQpbQnx1xeUSaPs,1720
180
- ipython-9.0.1.dist-info/METADATA,sha256=-GSrdUkwuLrI2UsbP60kMdapEz3kwuEB1NO9_Fk3Y1I,4254
181
- ipython-9.0.1.dist-info/WHEEL,sha256=XxkkpgK2r2Jb4a42aU-gRIepycpd86SLWyfAe8xqfHg,90
182
- ipython-9.0.1.dist-info/entry_points.txt,sha256=z5BEEohWgg0SHdgdeNABf4T3fu-lr9W6F_bWOQHLdVs,83
183
- ipython-9.0.1.dist-info/top_level.txt,sha256=PKjvHtNCBZ9EHTmd2mwJ1J_k3j0F6D1lTFzIcJFFPEU,8
184
- ipython-9.0.1.dist-info/RECORD,,
177
+ ipython-9.0.2.data/data/share/man/man1/ipython.1,sha256=PVdQP2hHmHyUEwzLOPcgavnCe9jTDVrM1jKZt4cnF_Q,2058
178
+ ipython-9.0.2.dist-info/COPYING.rst,sha256=NBr8vXKYh7cEb-e5j8T07f867Y048G7v2bMGcPBD3xc,1639
179
+ ipython-9.0.2.dist-info/LICENSE,sha256=4OOQdI7UQKuJPKHxNaiKkgqvVAnbuQpbQnx1xeUSaPs,1720
180
+ ipython-9.0.2.dist-info/METADATA,sha256=7S5uSfcEcaNZ9JJsCMTJ_lBitQ-QnvsIZjPLk6DZc6Q,4254
181
+ ipython-9.0.2.dist-info/WHEEL,sha256=RnOlZk4WRTvz4xhLM2LyBNUiU6tTosLZam4r642KGVM,90
182
+ ipython-9.0.2.dist-info/entry_points.txt,sha256=z5BEEohWgg0SHdgdeNABf4T3fu-lr9W6F_bWOQHLdVs,83
183
+ ipython-9.0.2.dist-info/top_level.txt,sha256=PKjvHtNCBZ9EHTmd2mwJ1J_k3j0F6D1lTFzIcJFFPEU,8
184
+ ipython-9.0.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (9.0.1)
2
+ Generator: setuptools (9.0.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5