From f80b805356aa37107237be9e9c943070ebc9e95d Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 4 Jun 2024 18:55:05 -0700 Subject: [PATCH 1/4] src/sage/plot/animate.py: Use FFmpeg.absolute_filename --- src/sage/plot/animate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sage/plot/animate.py b/src/sage/plot/animate.py index 84eb72157de..12bf1397af9 100644 --- a/src/sage/plot/animate.py +++ b/src/sage/plot/animate.py @@ -1024,8 +1024,9 @@ def ffmpeg(self, savefile=None, show_path=False, output_format=None, # afterwards. Hence 'early_options' and 'ffmpeg_options' # The `-nostdin` is needed to avoid the command to hang, see # https://stackoverflow.com/questions/16523746/ffmpeg-hangs-when-run-in-background - cmd = 'cd {}; ffmpeg -nostdin -y -f image2 {} -i {} {} {}'.format( - shlex.quote(pngdir), early_options, shlex.quote(pngs), ffmpeg_options, shlex.quote(savefile)) + cmd = 'cd {}; {} -nostdin -y -f image2 {} -i {} {} {}'.format( + shlex.quote(pngdir), shlex.quote(FFmpeg().absolute_filename()), + early_options, shlex.quote(pngs), ffmpeg_options, shlex.quote(savefile)) from subprocess import check_call, CalledProcessError, PIPE try: if sage.misc.verbose.get_verbose() > 0: From 9516e45a88dd6062f7d79ce9dd6ac31d1af39074 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 8 Jun 2024 09:50:04 -0700 Subject: [PATCH 2/4] src/sage/features/__init__.py: Remove method absolute_path deprecated in #31292 (2022) --- src/sage/features/__init__.py | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/src/sage/features/__init__.py b/src/sage/features/__init__.py index 5c242b413aa..4594b806ae5 100644 --- a/src/sage/features/__init__.py +++ b/src/sage/features/__init__.py @@ -653,32 +653,6 @@ def absolute_filename(self) -> str: # the distribution sagemath-environment. raise NotImplementedError - def absolute_path(self): - r""" - Deprecated alias for :meth:`absolute_filename`. - - Deprecated to make way for a method of this name returning a ``Path``. - - EXAMPLES:: - - sage: from sage.features import Executable - sage: Executable(name="sh", executable="sh").absolute_path() - doctest:warning... - DeprecationWarning: method absolute_path has been replaced by absolute_filename - See https://github.com/sagemath/sage/issues/31292 for details. - '/...bin/sh' - """ - try: - from sage.misc.superseded import deprecation - except ImportError: - # The import can fail because sage.misc.superseded is provided by - # the distribution sagemath-objects, which is not an - # install-requires of the distribution sagemath-environment. - pass - else: - deprecation(31292, 'method absolute_path has been replaced by absolute_filename') - return self.absolute_filename() - class Executable(FileFeature): r""" From f7b106569ccf7a578d89da90e78f6fe64b7ec05e Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 8 Jun 2024 09:52:25 -0700 Subject: [PATCH 3/4] src/sage/features/join_feature.py: Remove method JoinFeature.is_functional deprecated in #33114 (2022) --- src/sage/features/join_feature.py | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/sage/features/join_feature.py b/src/sage/features/join_feature.py index 81a5b7fb6e9..f76612ba45f 100644 --- a/src/sage/features/join_feature.py +++ b/src/sage/features/join_feature.py @@ -97,36 +97,6 @@ def _is_present(self): return test return FeatureTestResult(self, True) - def is_functional(self): - r""" - Test whether the join feature is functional. - - This method is deprecated. Use :meth:`Feature.is_present` instead. - - EXAMPLES:: - - sage: from sage.features.latte import Latte - sage: Latte().is_functional() # optional - latte_int - doctest:warning... - DeprecationWarning: method JoinFeature.is_functional; use is_present instead - See https://github.com/sagemath/sage/issues/33114 for details. - FeatureTestResult('latte_int', True) - """ - try: - from sage.misc.superseded import deprecation - except ImportError: - # The import can fail because sage.misc.superseded is provided by - # the distribution sagemath-objects, which is not an - # install-requires of the distribution sagemath-environment. - pass - else: - deprecation(33114, 'method JoinFeature.is_functional; use is_present instead') - for f in self._features: - test = f.is_functional() - if not test: - return test - return FeatureTestResult(self, True) - def hide(self): r""" Hide this feature and all its joined features. From 6b7cf258a8dddcf54baebac7c1655a70b732a588 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sat, 8 Jun 2024 10:44:06 -0700 Subject: [PATCH 4/4] src/sage/features/__init__.py: Replace uses of absolute_path in doctests --- src/sage/features/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/features/__init__.py b/src/sage/features/__init__.py index 4594b806ae5..5c145adf21c 100644 --- a/src/sage/features/__init__.py +++ b/src/sage/features/__init__.py @@ -605,7 +605,7 @@ class FileFeature(Feature): To work with the file described by the feature, use the method :meth:`absolute_filename`. A :class:`FeatureNotPresentError` is raised if the file cannot be found:: - sage: Executable(name="does-not-exist", executable="does-not-exist-xxxxyxyyxyy").absolute_path() + sage: Executable(name="does-not-exist", executable="does-not-exist-xxxxyxyyxyy").absolute_filename() Traceback (most recent call last): ... sage.features.FeatureNotPresentError: does-not-exist is not available. @@ -737,7 +737,7 @@ def absolute_filename(self) -> str: A :class:`FeatureNotPresentError` is raised if the file cannot be found:: - sage: Executable(name="does-not-exist", executable="does-not-exist-xxxxyxyyxyy").absolute_path() + sage: Executable(name="does-not-exist", executable="does-not-exist-xxxxyxyyxyy").absolute_filename() Traceback (most recent call last): ... sage.features.FeatureNotPresentError: does-not-exist is not available.