%if 0%{?epel} # disable build of docs and tests for epel because of missing dependencies: # - python3-ipykernel # - python3-jupyter-client # - python3-nbformat # - python3-testpath # tests and docs subpackages are also disabled %bcond_with check %bcond_with doc %else %bcond_without check %bcond_without doc %endif %global python3_pkgversion 3.11 Name: ipython Version: 8.22.2 Release: 3.ac7%{?dist} Summary: An enhanced interactive Python shell # See bug #603178 for a quick overview for the choice of licenses # most files are under BSD and just a few under Python or MIT # There are some extensions released under GPLv2+ License: (BSD and MIT and Python) and GPLv2+ URL: http://ipython.org/ Source0: %pypi_source BuildArch: noarch BuildRequires: make BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-stack-data %if %{with doc} BuildRequires: python%{python3_pkgversion}-sphinx BuildRequires: python%{python3_pkgversion}-sphinx_rtd_theme BuildRequires: python%{python3_pkgversion}-ipykernel BuildRequires: python%{python3_pkgversion}-matplotlib BuildRequires: python%{python3_pkgversion}-numpy BuildRequires: python%{python3_pkgversion}-typing-extensions %endif %if %{with check} BuildRequires: python%{python3_pkgversion}-Cython BuildRequires: python%{python3_pkgversion}-matplotlib BuildRequires: python%{python3_pkgversion}-matplotlib-inline BuildRequires: python%{python3_pkgversion}-pymongo BuildRequires: python%{python3_pkgversion}-tornado >= 4.0 BuildRequires: python%{python3_pkgversion}-zmq BuildRequires: python%{python3_pkgversion}-zmq-tests BuildRequires: python%{python3_pkgversion}-nbformat BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python%{python3_pkgversion}-pytest-asyncio BuildRequires: python%{python3_pkgversion}-ipykernel BuildRequires: python%{python3_pkgversion}-jupyter-client BuildRequires: python%{python3_pkgversion}-testpath # for frontend BuildRequires: python%{python3_pkgversion}-pygments # for latex BuildRequires: /usr/bin/dvipng BuildRequires: tex(amsmath.sty) BuildRequires: tex(amssymb.sty) BuildRequires: tex(amsthm.sty) BuildRequires: tex(bm.sty) %endif %global ipython_desc_base \ IPython provides a replacement for the interactive Python interpreter with\ extra functionality.\ \ Main features:\ * Comprehensive object introspection.\ * Input history, persistent across sessions.\ * Caching of output results during a session with automatically generated\ references.\ * Readline based name completion.\ * Extensible system of 'magic' commands for controlling the environment and\ performing many tasks related either to IPython or the operating system.\ * 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.\ * Integrated access to the pdb debugger and the Python profiler. %description %{ipython_desc_base} %package -n python%{python3_pkgversion}-ipython Summary: An enhanced interactive Python shell %{?python_provide:%python_provide python3-ipython} %{?python_provide:%python_provide python3-ipython-console} Provides: ipython3 = %{version}-%{release} Provides: ipython = %{version}-%{release} Provides: python3-ipython-console = %{version}-%{release} Obsoletes: python3-ipython-console < 5.3.0-1 Conflicts: python2-ipython < 7 BuildRequires: python%{python3_pkgversion}-backcall BuildRequires: python%{python3_pkgversion}-decorator BuildRequires: python%{python3_pkgversion}-jedi >= 0.10 BuildRequires: python%{python3_pkgversion}-pexpect BuildRequires: python%{python3_pkgversion}-pickleshare BuildRequires: python%{python3_pkgversion}-prompt-toolkit >= 2 BuildRequires: python%{python3_pkgversion}-traitlets >= 5.13.0 Requires: (tex(amsmath.sty) if /usr/bin/dvipng) Requires: (tex(amssymb.sty) if /usr/bin/dvipng) Requires: (tex(amsthm.sty) if /usr/bin/dvipng) Requires: (tex(bm.sty) if /usr/bin/dvipng) %description -n python%{python3_pkgversion}-ipython %{ipython_desc_base} This package provides IPython for in a terminal. %{?python_extras_subpkg:%python_extras_subpkg -n python3-ipython -i %{python3_sitelib}/*.egg-info notebook} %package -n python%{python3_pkgversion}-ipython-sphinx Summary: Sphinx directive to support embedded IPython code %{?python_provide:%python_provide python3-ipython-sphinx} Requires: python%{python3_pkgversion}-ipython = %{version}-%{release} BuildRequires: python%{python3_pkgversion}-sphinx Requires: python%{python3_pkgversion}-sphinx %description -n python%{python3_pkgversion}-ipython-sphinx %{ipython_desc_base} This package contains the ipython sphinx extension. %if %{with check} %package -n python%{python3_pkgversion}-ipython+test Summary: Tests for %{name} Provides: python3-ipython-tests = %{version}-%{release} Obsoletes: python3-ipython-tests < 8.7.0-2 %{?python_provide:%python_provide python3-ipython-tests} %{?python_provide:%python_provide python3-ipython+test} Requires: python%{python3_pkgversion}-ipykernel Requires: python%{python3_pkgversion}-ipython = %{version}-%{release} Requires: python%{python3_pkgversion}-jupyter-client Requires: python%{python3_pkgversion}-nbformat Requires: python%{python3_pkgversion}-zmq-tests # For latex Requires: /usr/bin/dvipng Requires: tex(amsmath.sty) Requires: tex(amssymb.sty) Requires: tex(amsthm.sty) Requires: tex(bm.sty) %description -n python%{python3_pkgversion}-ipython+test This package contains the tests of %{name}. You can check this way, if ipython works on your platform. %endif %if %{with doc} %package -n python%{python3_pkgversion}-ipython-doc Summary: Documentation for %{name} %{?python_provide:%python_provide python3-ipython-doc} %description -n python%{python3_pkgversion}-ipython-doc This package contains the documentation of %{name}. %endif %prep %autosetup -p1 # delete bundling libs pushd IPython/external ls -l ls -l * popd # Remove shebangs sed -i '1d' $(grep -lr '^#!/usr/' IPython) find . -name '*.py' -print0 | xargs -0 sed -i '1s|^#!python|#!%{__python3}|' %build %py3_build %if %{with doc} pushd docs PYTHONPATH=.. make html SPHINXBUILD='sphinx-build-3 -D intersphinx_timeout=1' mkdir -p build/html/ rm -rf build/html/.buildinfo popd %endif %install %py3_install # link the manpage to ipython3 mv %{buildroot}%{_mandir}/man1/ipython{,3}.1 ln -s ./ipython3.1 %{buildroot}%{_mandir}/man1/ipython.1 %if %{with check} %check for m in $(find %{buildroot}%{_datadir}/locale/* -type f) ; do mv "$m" $(sed -re "s/(.*).mo$/\1%{python3_pkgversion}.mo/"<<<"$m"); done for d in core extensions external lib terminal testing; do mkdir %{buildroot}%{python3_sitelib}/IPython/$d; cp -r IPython/$d/test %{buildroot}%{python3_sitelib}/IPython/$d; done # Ensure that the user's .pythonrc.py is not invoked during any tests. export PYTHONSTARTUP="" # Koji builders can be slow, especially on arms, we scale timeouts 4 times export IPYTHON_TESTING_TIMEOUT_SCALE=4 # To prevent _pytest.pathlib.ImportPathMismatchError, we are # testing directly in buildroot pushd %{buildroot}%{python3_sitelib}/IPython %pytest rm -rf .pytest_cache popd %else rm -r %{buildroot}%{python3_sitelib}/IPython/*/tests %endif mv %{buildroot}%{_bindir}/ipython{3,%{python3_pkgversion}} mv %{buildroot}%{_mandir}/man1/ipython{3,%{python3_pkgversion}}.1 ln -sf ./ipython%{python3_pkgversion}.1 %{buildroot}%{_mandir}/man1/ipython.1 %files -n python%{python3_pkgversion}-ipython %{_bindir}/ipython%{python3_pkgversion} %{_bindir}/ipython %{_mandir}/man1/ipython.* %{_mandir}/man1/ipython3.* %dir %{python3_sitelib}/IPython %{python3_sitelib}/IPython/external %{python3_sitelib}/IPython/__pycache__/ %{python3_sitelib}/IPython/*.py* %{python3_sitelib}/IPython/py.typed %dir %{python3_sitelib}/IPython/testing %{python3_sitelib}/IPython/testing/__pycache__/ %{python3_sitelib}/IPython/testing/*.py* %{python3_sitelib}/IPython/testing/plugin %{python3_sitelib}/ipython-%{version}-py%{python3_version}.egg-info/ %{python3_sitelib}/IPython/core/ %{python3_sitelib}/IPython/extensions/ %{python3_sitelib}/IPython/lib/ %{python3_sitelib}/IPython/terminal/ %{python3_sitelib}/IPython/utils/ # tests go into subpackage %exclude %{python3_sitelib}/IPython/*/tests/ %files -n python%{python3_pkgversion}-ipython-sphinx %{python3_sitelib}/IPython/sphinxext/ %if %{with check} %files -n python%{python3_pkgversion}-ipython+test %ghost %{python3_sitelib}/ipython-%{version}-py%{python3_version}.egg-info/ %{python3_sitelib}/IPython/*/tests %endif %if %{with doc} %files -n python%{python3_pkgversion}-ipython-doc %doc docs/build/html %endif %changelog * Thu Mar 28 2024 Ding-Yi Chen - 8.22.2-3.ac7 - Cut corner packaging