From 21dbcbc5857db398e1b8f637b9c7d9850b969238 Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Sat, 9 Dec 2023 23:23:52 +0000 Subject: [PATCH 1/2] check ipython for sphinxext, extend python_package_check macro --- build/pkgs/ipython/spkg-configure.m4 | 4 +++- m4/sage_python_package_check.m4 | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/build/pkgs/ipython/spkg-configure.m4 b/build/pkgs/ipython/spkg-configure.m4 index 02ab89f5193..8ee7cbc81dd 100644 --- a/build/pkgs/ipython/spkg-configure.m4 +++ b/build/pkgs/ipython/spkg-configure.m4 @@ -1 +1,3 @@ -SAGE_SPKG_CONFIGURE([ipython], [SAGE_PYTHON_PACKAGE_CHECK([ipython])]) +SAGE_SPKG_CONFIGURE([ipython], +[SAGE_PYTHON_PACKAGE_CHECK([ipython], ["import IPython.sphinxext.ipython_directive"]) +]) diff --git a/m4/sage_python_package_check.m4 b/m4/sage_python_package_check.m4 index e0713512ea0..4890afa061b 100644 --- a/m4/sage_python_package_check.m4 +++ b/m4/sage_python_package_check.m4 @@ -1,7 +1,7 @@ # # SYNOPSIS # -# SAGE_PYTHON_PACKAGE_CHECK(package) +# SAGE_PYTHON_PACKAGE_CHECK(package, [further_checks]) # # DESCRIPTION # @@ -38,6 +38,9 @@ # set --enable-system-site-packages, this macro also changes the # default for --with-system-foo from "yes" to "no" in that case. # +# further_checks is an optional argument: a snippet of Python code to be +# called as python3 -c $2; normal exit means OK, error means not OK. +# AC_DEFUN([SAGE_PYTHON_PACKAGE_CHECK], [ AC_MSG_CHECKING([if --enable-system-site-packages was used]) @@ -80,7 +83,15 @@ AC_DEFUN([SAGE_PYTHON_PACKAGE_CHECK], [ "import pkg_resources; dnl pkg_resources.require('${SAGE_PKG_VERSPEC}'.splitlines())" dnl 2>&AS_MESSAGE_LOG_FD], - [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(yes) + AS_IF([test x$2 != x], + [AC_MSG_CHECKING([whether further conditions are satisfied...]) + AS_IF( + [PYTHONUSERBASE="${PYTHONUSERBASE}" config.venv/bin/python3 -c $2 2>&AS_MESSAGE_LOG_FD], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no); sage_spkg_install_$1=yes]) + ]) + ], [AC_MSG_RESULT(no); sage_spkg_install_$1=yes] ) From b755e585e7f88e20d28095b71163f9bfb74833cd Mon Sep 17 00:00:00 2001 From: Dima Pasechnik Date: Sun, 10 Dec 2023 18:13:11 +0000 Subject: [PATCH 2/2] more ipython parts for Fedora --- build/pkgs/ipython/distros/fedora.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/build/pkgs/ipython/distros/fedora.txt b/build/pkgs/ipython/distros/fedora.txt index 49a7ffe2a95..0faac45c0ec 100644 --- a/build/pkgs/ipython/distros/fedora.txt +++ b/build/pkgs/ipython/distros/fedora.txt @@ -1 +1,2 @@ ipython +python-ipython-sphinx