- Update to 8.30

* improve the documentatation for custom IPython formatters, and how 
    you can register formatters for custom mime types.
  * fix a bug in which commands that were not assigned a shortcut could 
    not be assigned one.
  * fix a bug in which a single / on an empty line would not be an error. 
    This is due to the autocall behavior that we are thinking of deprecating.
- Add py3131.patch to fix behaviour with Python 3.13.1

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:jupyter/python-ipython?expand=0&rev=137
This commit is contained in:
Markéta Machová 2024-12-10 15:54:12 +00:00 committed by Git OBS Bridge
commit a6c0e87f1d
11 changed files with 1933 additions and 0 deletions

25
.gitattributes vendored Normal file
View File

@ -0,0 +1,25 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
## Specific LFS patterns
JupyterConsole.svg filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

3
JupyterConsole.svg Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5c964ec992b736edcebbaac49eb1ce18f474a12689e7a5437f30f54e3f723cec
size 26397

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

3
ipython-8.25.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c6ed726a140b6e725b911528f80439c534fac915246af3efc39440a6b0f9d716
size 5492936

3
ipython-8.27.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0b99a2dc9f15fd68692e898e5568725c6d49c527d36a9fb5960ffbdeaa82ff7e
size 5494984

3
ipython-8.29.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:40b60e15b22591450eef73e40a027cf77bd652e757523eebc5bd7c7c498290eb
size 5497513

3
ipython-8.30.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cb0a405a306d2995a5cbb9901894d240784a9f341394c6ba3f4fe8c6eb89ff6e
size 5592205

24
py3131.patch Normal file
View File

@ -0,0 +1,24 @@
From c1e945b5bc8fb673109cf32c4f238f6d5e0f5149 Mon Sep 17 00:00:00 2001
From: M Bussonnier <bussonniermatthias@gmail.com>
Date: Sun, 8 Dec 2024 11:37:11 +0100
Subject: [PATCH] Fix pdb issues in Python 3.13.1
For some reason it is not always set, it was/is a bug in IPython to not
check.
---
IPython/core/debugger.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/IPython/core/debugger.py b/IPython/core/debugger.py
index 1f0d7b2fba..76c42e0230 100644
--- a/IPython/core/debugger.py
+++ b/IPython/core/debugger.py
@@ -550,7 +550,7 @@ def _get_frame_locals(self, frame):
So if frame is self.current_frame we instead return self.curframe_locals
"""
- if frame is self.curframe:
+ if frame is getattr(self, "curframe", None):
return self.curframe_locals
else:
return frame.f_locals

1608
python-ipython.changes Normal file

File diff suppressed because it is too large Load Diff

257
python-ipython.spec Normal file
View File

@ -0,0 +1,257 @@
#
# spec file for package python-ipython
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
# extra tests are skipped automatically, don't require these packages for Ring1
%bcond_with localtest
%{?sle15_python_module_pythons}
Name: python-ipython%{psuffix}
Version: 8.30.0
Release: 0
Summary: Rich architecture for interactive computing with Python
License: BSD-3-Clause
URL: https://github.com/ipython/ipython
Source: https://files.pythonhosted.org/packages/source/i/ipython/ipython-%{version}.tar.gz
Source1: https://raw.githubusercontent.com/jupyter/qtconsole/4.0.0/qtconsole/resources/icon/JupyterConsole.svg
# PATCH-FIX-UPSTREAM https://github.com/ipython/ipython/pull/14598 Fix pdb issues in Python 3.13.1
Patch0: py3131.patch
BuildRequires: %{python_module base >= 3.10}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools >= 61.2}
BuildRequires: %{python_module wheel}
BuildRequires: %{pythons}
BuildRequires: fdupes
BuildRequires: python-rpm-macros >= 20210929
# requires the full stdlib including sqlite3
Requires: python
Requires: python-decorator
Requires: python-jedi >= 0.16
Requires: python-matplotlib-inline
Requires: python-pexpect >= 4.3
Requires: python-pygments >= 2.4.0
Requires: python-stack-data
Requires: python-traitlets >= 5.13.0
Requires: (python-prompt_toolkit >= 3.0.41 with python-prompt_toolkit < 3.1)
%if %{python_version_nodots} < 311
Requires: python-exceptiongroup
%endif
%if %{python_version_nodots} < 312
Requires: python-typing_extensions >= 4.6
%endif
Recommends: jupyter
Recommends: python-ipykernel
Recommends: python-ipyparallel
Recommends: python-ipywidgets
Provides: IPython3 = %{version}
Obsoletes: IPython3 < %{version}
Provides: python-IPython = %{version}
Obsoletes: python-IPython < %{version}
Provides: python-jupyter_ipython = %{version}
Obsoletes: python-jupyter_ipython < %{version}
Provides: jupyter-ipython = %{version}
Provides: python-ipython-doc = %{version}
Obsoletes: python-ipython-doc < %{version}
Provides: python-jupyter_ipython-doc = %{version}
Obsoletes: python-jupyter_ipython-doc < %{version}
Provides: python-jupyter_ipython-doc-html = %{version}
Obsoletes: python-jupyter_ipython-doc-html < %{version}
Provides: python-jupyter_ipython-doc-pdf = %{version}
Obsoletes: python-jupyter_ipython-doc-pdf < %{version}
BuildArch: noarch
%if %{with test}
BuildRequires: %{python_module ipython = %{version}}
BuildRequires: %{python_module matplotlib}
BuildRequires: %{python_module numpy >= 1.23}
BuildRequires: %{python_module pandas}
BuildRequires: %{python_module pickleshare}
BuildRequires: %{python_module pytest-asyncio}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module testpath}
BuildRequires: %{python_module trio}
%endif
%if %{with localtest}
BuildRequires: %{python_module nbformat}
%endif
%if !%{with test}
BuildRequires: desktop-file-utils
BuildRequires: hicolor-icon-theme
%if %{with libalternatives}
BuildRequires: alts
Requires: alts
%else
Requires(post): update-alternatives
Requires(postun): update-alternatives
%endif
%if %{with ico}
BuildRequires: icoutils
%endif
%endif
%python_subpackages
%description
IPython provides a rich toolkit to help you make the
most out of using Python interactively. Its main
components are:
* A powerful interactive Python shell
* A Jupyter kernel to work with Python code in
Jupyter notebooks and other interactive frontends.
The enhanced interactive Python shells have the
following main features:
* Comprehensive object introspection.
* Input history, persistent across sessions.
* Caching of output results during a session with automatically
generated references.
* Extensible tab completion, with support by default for completion
of python variables and keywords, filenames and function keywords.
* Extensible system of magic commands for controlling the
environment and performing many tasks related either to IPython or
the operating system.
* A rich configuration system with easy switching between different
setups (simpler than changing $PYTHONSTARTUP environment variables
every time).
* Session logging and reloading.
* Extensible syntax processing for special purpose situations.
* Access to the system shell with user-extensible alias system.
* Easily embeddable in other Python programs and GUIs.
* Integrated access to the pdb debugger and the Python profiler.
%prep
%autosetup -p1 -n ipython-%{version}
%build
%pyproject_wheel
%if !%{with test}
%if %{with ico}
pushd scripts
icotool -x ipython.ico
icotool -x ipython_nb.ico
popd
%endif
%endif
%install
%if !%{with test}
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/ipython
%python_clone -a %{buildroot}%{_bindir}/ipython3
# must clone after copy
cp %{buildroot}%{_mandir}/man1/ipython{,3}.1
%python_clone -a %{buildroot}%{_mandir}/man1/ipython.1
%python_clone -a %{buildroot}%{_mandir}/man1/ipython3.1
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/
%python_expand cp %{SOURCE1} %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/IPython-%{$python_bin_suffix}.svg
%if %{with ico}
# Install the icons
for x in 16 24 32 48 256 ; do
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${x}x${x}/apps/
ipyf=(scripts/ipython_*_${x}x${x}x32.png)
ipynbf=(scripts/ipython_nb_*_${x}x${x}x32.png)
%python_expand cp ${ipyf[0]} %{buildroot}%{_datadir}/icons/hicolor/${x}x${x}/apps/IPython-%{$python_bin_suffix}.png
%python_expand cp ${ipynbf[0]} %{buildroot}%{_datadir}/icons/hicolor/${x}x${x}/apps/IPythonNotebook-%{$python_bin_suffix}.png
done
%endif
%{python_expand # Modify and install .desktop file
f=ipython-%{$python_bin_suffix}.desktop
cp examples/IPython\ Kernel/ipython.desktop $f
desktop-file-edit \
--set-comment="Enhanced interactive Python %{$python_bin_suffix} shell" \
--set-name="ipython %{$python_bin_suffix}" \
--set-generic-name="IPython %{$python_bin_suffix}" \
--set-key="Exec" --set-value="ipython-%{$python_bin_suffix}" \
--set-icon="IPython-%{$python_bin_suffix}" \
$f
desktop-file-install $f
}
%{python_expand # These can be run stand-alone, so make them executable rather than removing shebang
find %{buildroot}%{$python_sitelib} -type f -name "*.py" -exec sed -i "s|^#!%{_bindir}/env python$|#!%{__$python}|" {} \;
find %{buildroot}%{$python_sitelib} -type f -name "*.py" -exec sed -i "s|^#!%{_bindir}/python$|#!%{__$python}|" {} \;
find %{buildroot}%{$python_sitelib} -type f -name "*.py" -exec grep -q "#!%{__$python}" {} \; -exec chmod a+x {} \;
$python -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/IPython
$python -O -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/IPython
%fdupes %{buildroot}%{$python_sitelib}
}
%fdupes %{buildroot}%{_bindir}
%fdupes %{buildroot}%{_mandir}
%endif
%if %{with test}
%check
export PYTHONPATH=$(pwd)
%pytest
%endif
%if !%{with test}
%pre
# If libalternatives is used: Removing old update-alternatives entries.
%python_libalternatives_reset_alternative ipython
%post
%python_install_alternative ipython ipython3 ipython.1.gz ipython3.1.gz
%desktop_database_post
%icon_theme_cache_post
%postun
%python_uninstall_alternative ipython
%desktop_database_postun
%icon_theme_cache_postun
%endif
%if !%{with test}
%files %{python_files}
%license COPYING.rst
%doc README.rst docs/source/about/license_and_copyright.rst
%python_alternative %{_bindir}/ipython
%python_alternative %{_bindir}/ipython3
%python_alternative %{_mandir}/man1/ipython.1.gz
%python_alternative %{_mandir}/man1/ipython3.1.gz
%{python_sitelib}/IPython/
%{python_sitelib}/ipython-%{version}.dist-info
%{_datadir}/applications/ipython-%{python_bin_suffix}.desktop
%{_datadir}/icons/hicolor/scalable/apps/IPython-%{python_bin_suffix}.svg
%if %{with ico}
%{_datadir}/icons/hicolor/*x*/apps/IPython-%{python_bin_suffix}.png
%{_datadir}/icons/hicolor/*x*/apps/IPythonNotebook-%{python_bin_suffix}.png
%endif
%endif
%changelog