14
0
Files
python-line_profiler/no-python-in-path.patch
Steve Kowalik 83c7a1f81c - Update to 5.0.0:
* ENH: Add support for sys.monitoring (Python >= 3.12)
  * FIX: Fixed issue when calling kernprof with neither the -l nor -b flag
  * FIX: Fixed auto-profiling of async function definitions
  * ENH: Added CLI argument -m to kernprof for running a library module as
    a script
  * FIX: Fixed explicit profiling of class methods; added handling for
    profiling static, bound, and partial methods, functools.partial objects,
    (cached) properties, and async generator functions
  * FIX: Fixed namespace bug when running kernprof -m on certain modules.
  * FIX: Fixed @contextlib.contextmanager bug where the cleanup code (e.g.
    restoration of sys attributes) is not run if exceptions occurred inside
    the context
  * ENH: Added CLI arguments -c to kernprof for (auto-)profiling
    module/package/inline-script execution instead of that of script files;
    passing '-' as the script-file name now also reads from and profiles
    stdin
  * ENH: In Python >=3.11, profiled objects are reported using their
    qualified name.
  * ENH: Highlight final summary using rich if enabled
  * ENH: Made it possible to use multiple profiler instances simultaneously
  * ENH: various improvements related to auto-profiling:
  * FIX: Fixed line tracing for Cython code; superseded use of the legacy
    tracing system with sys.monitoring
  * FIX: Tracing-system-related fixes
  * ENH: Added capability to parse TOML config files for defaults
- Add patch no-python-in-path.patch:
  * Do not search the path for python.
- Add patch support-python314.patch:
  * Support Python 3.14 sys.monitoring changes.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-line_profiler?expand=0&rev=33
2025-11-05 03:33:41 +00:00

47 lines
2.2 KiB
Diff

Index: line_profiler-5.0.0/line_profiler/cli_utils.py
===================================================================
--- line_profiler-5.0.0.orig/line_profiler/cli_utils.py
+++ line_profiler-5.0.0/line_profiler/cli_utils.py
@@ -188,9 +188,7 @@ def get_python_executable():
Command or path thereto corresponding to
:py:data:`sys.executable`.
"""
- if os.path.samefile(shutil.which('python'), sys.executable):
- return 'python'
- elif os.path.samefile(shutil.which('python3'), sys.executable):
+ if os.path.samefile(shutil.which('python3'), sys.executable):
return 'python3'
else:
return short_string_path(sys.executable)
Index: line_profiler-5.0.0/tests/test_kernprof.py
===================================================================
--- line_profiler-5.0.0.orig/tests/test_kernprof.py
+++ line_profiler-5.0.0/tests/test_kernprof.py
@@ -184,7 +184,7 @@ def test_kernprof_sys_restoration(capsys
{'^Output to stdout': True,
r"^Wrote .* '.*script\.py\.lprof'": True,
r'^Inspect results with:''\n'
- r'python -m line_profiler .*script\.py\.lprof': True,
+ r'.*python.* -m line_profiler .*script\.py\.lprof': True,
r'line_profiler\.autoprofile\.autoprofile'
r'\.run\(\n(?:.+,\n)*.*\)': False,
r'^\[kernprof .*\]': False,
@@ -194,7 +194,7 @@ def test_kernprof_sys_restoration(capsys
{'^Output to stdout': True,
r"^Wrote .* '.*script\.py\.lprof'": True,
r'^Inspect results with:''\n'
- r'python -m line_profiler .*script\.py\.lprof': False,
+ r'.*python.* -m line_profiler .*script\.py\.lprof': False,
r'line_profiler\.autoprofile\.autoprofile'
r'\.run\(\n(?:.+,\n)*.*\)': False,
r'^\[kernprof .*\]': False,
@@ -204,7 +204,7 @@ def test_kernprof_sys_restoration(capsys
{'^Output to stdout': True,
r"^\[kernprof .*\] Wrote .* '.*script\.py\.lprof'": True,
r'Inspect results with:''\n'
- r'python -m line_profiler .*script\.py\.lprof': False,
+ r'.*python.* -m line_profiler .*script\.py\.lprof': False,
r'line_profiler\.autoprofile\.autoprofile'
r'\.run\(\n(?:.+,\n)*.*\)': True,
r'^Function: main': True},