Skip to content

Commit

Permalink
sagemathgh-37959: configure: Fix "command not found" error after sa…
Browse files Browse the repository at this point in the history
…gemath#36776

    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

As reported in https://groups.google.com/g/sage-devel/c/8ZsBcHGmn6s
@culler

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#37959
Reported by: Matthias Köppe
Reviewer(s):
  • Loading branch information
Release Manager committed May 23, 2024
2 parents 8d871d3 + c243404 commit 1de533d
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 56 deletions.
41 changes: 22 additions & 19 deletions build/pkgs/importlib_metadata/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
SAGE_SPKG_CONFIGURE([importlib_metadata], [
SAGE_SPKG_CONFIGURE([importlib_metadata], [dnl
SAGE_PYTHON_PACKAGE_CHECK([importlib_metadata])
],[
# Three of our python packages are backport packages providing
# python-3.11 features (see coding_in_python.rst):
#
# * importlib_metadata
# * importlib_resources
# * typing_extensions
#
# These packages are therefore not needed with >=python-3.11. Here
# we test for a python minor version component greater than or equal
# to 11, and mark this package as "not required" if we succeed.
AC_MSG_CHECKING([for >=python-3.11])
# Keep in mind that False (~ zero) in python is success in the shell
AS_IF(["${PYTHON_FOR_VENV}" -c "import sys; sys.exit(sys.version_info.minor < 11)"],[
AC_MSG_RESULT([yes])
dnl Three of our python packages are backport packages providing
dnl python-3.11 features (see coding_in_python.rst):
dnl
dnl * importlib_metadata
dnl * importlib_resources
dnl * typing_extensions
dnl
dnl These packages are therefore not needed with >=python-3.11. Here
dnl we test for a python minor version component greater than or equal
dnl to 11, and mark this package as "not required" if we succeed.
AS_IF([test -z "${PYTHON_FOR_VENV}"], [dnl
dnl Python from our SPKG is new enough, no need for the backport package.
sage_require_importlib_metadata="no"
],[
AC_MSG_RESULT([no])
], [dnl
AC_MSG_CHECKING([for >=python-3.11])
dnl Keep in mind that False (~ zero) in python is success in the shell
AS_IF(["${PYTHON_FOR_VENV}" -c "import sys; sys.exit(sys.version_info.minor < 11)"], [dnl
AC_MSG_RESULT([yes])
sage_require_importlib_metadata="no"
],[dnl
AC_MSG_RESULT([no])
])
])
])

40 changes: 22 additions & 18 deletions build/pkgs/importlib_resources/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
SAGE_SPKG_CONFIGURE([importlib_resources], [
SAGE_SPKG_CONFIGURE([importlib_resources], [dnl
SAGE_PYTHON_PACKAGE_CHECK([importlib_resources])
],[
# Three of our python packages are backport packages providing
# python-3.11 features (see coding_in_python.rst):
#
# * importlib_metadata
# * importlib_resources
# * typing_extensions
#
# These packages are therefore not needed with >=python-3.11. Here
# we test for a python minor version component greater than or equal
# to 11, and mark this package as "not required" if we succeed.
AC_MSG_CHECKING([for >=python-3.11])
# Keep in mind that False (~ zero) in python is success in the shell
AS_IF(["${PYTHON_FOR_VENV}" -c "import sys; sys.exit(sys.version_info.minor < 11)"],[
AC_MSG_RESULT([yes])
dnl Three of our python packages are backport packages providing
dnl python-3.11 features (see coding_in_python.rst):
dnl
dnl * importlib_metadata
dnl * importlib_resources
dnl * typing_extensions
dnl
dnl These packages are therefore not needed with >=python-3.11. Here
dnl we test for a python minor version component greater than or equal
dnl to 11, and mark this package as "not required" if we succeed.
AS_IF([test -z "${PYTHON_FOR_VENV}"], [dnl
dnl Python from our SPKG is new enough, no need for the backport package.
sage_require_importlib_resources="no"
],[
AC_MSG_RESULT([no])
], [dnl
AC_MSG_CHECKING([for >=python-3.11])
dnl Keep in mind that False (~ zero) in python is success in the shell
AS_IF(["${PYTHON_FOR_VENV}" -c "import sys; sys.exit(sys.version_info.minor < 11)"], [dnl
AC_MSG_RESULT([yes])
sage_require_importlib_resources="no"
],[dnl
AC_MSG_RESULT([no])
])
])
])
41 changes: 22 additions & 19 deletions build/pkgs/typing_extensions/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
SAGE_SPKG_CONFIGURE([typing_extensions],[
SAGE_SPKG_CONFIGURE([typing_extensions], [dnl
SAGE_PYTHON_PACKAGE_CHECK([typing_extensions])
],[
# Three of our python packages are backport packages providing
# python-3.11 features (see coding_in_python.rst):
#
# * importlib_metadata
# * importlib_resources
# * typing_extensions
#
# These packages are therefore not needed with >=python-3.11. Here
# we test for a python minor version component greater than or equal
# to 11, and mark this package as "not required" if we succeed.
AC_MSG_CHECKING([for >=python-3.11])
# Keep in mind that False (~ zero) in python is success in the shell
AS_IF(["${PYTHON_FOR_VENV}" -c "import sys; sys.exit(sys.version_info.minor < 11)"],[
AC_MSG_RESULT([yes])
dnl Three of our python packages are backport packages providing
dnl python-3.11 features (see coding_in_python.rst):
dnl
dnl * importlib_metadata
dnl * importlib_resources
dnl * typing_extensions
dnl
dnl These packages are therefore not needed with >=python-3.11. Here
dnl we test for a python minor version component greater than or equal
dnl to 11, and mark this package as "not required" if we succeed.
AS_IF([test -z "${PYTHON_FOR_VENV}"], [dnl
dnl Python from our SPKG is new enough, no need for the backport package.
sage_require_typing_extensions="no"
],[
AC_MSG_RESULT([no])
], [dnl
AC_MSG_CHECKING([for >=python-3.11])
dnl Keep in mind that False (~ zero) in python is success in the shell
AS_IF(["${PYTHON_FOR_VENV}" -c "import sys; sys.exit(sys.version_info.minor < 11)"], [dnl
AC_MSG_RESULT([yes])
sage_require_typing_extensions="no"
],[dnl
AC_MSG_RESULT([no])
])
])
])

0 comments on commit 1de533d

Please sign in to comment.