diff --git a/asv/benchmark.py b/asv/benchmark.py index b0d8963a4..9ba1776ac 100644 --- a/asv/benchmark.py +++ b/asv/benchmark.py @@ -68,6 +68,25 @@ def main(): mode = sys.argv[1] args = sys.argv[2:] + env = os.environ.copy() + # --- Modify sys.path for the current interpreter --- + if 'ASV_PYTHONPATH' in env: + new_paths = env['ASV_PYTHONPATH'].split(os.pathsep) + for path in reversed(new_paths): # Add to the front to prioritize + if path not in sys.path: + sys.path.insert(0, path) + # Remove ASV_PYTHONPATH from env, as it's no longer needed after sys.path update + env.pop('ASV_PYTHONPATH') + else: + # Clean up sys.path if PYTHONPATH was set but ASV_PYTHONPATH is not + if 'PYTHONPATH' in env: + old_paths = env['PYTHONPATH'].split(os.pathsep) + for path in old_paths: + if path in sys.path: + sys.path.remove(path) + + env.pop('PYTHONPATH') + if mode in commands: commands[mode](args) sys.exit(0) diff --git a/asv/commands/compare.py b/asv/commands/compare.py index 14b3cd072..debc01f93 100644 --- a/asv/commands/compare.py +++ b/asv/commands/compare.py @@ -303,7 +303,7 @@ def results_default_iter(commit_hash): elif time_1 is None and time_2 is not None: # fixed a failure color = 'green' - mark = ' ' + mark = '*' improved = True elif time_1 is None and time_2 is None: # both failed @@ -334,7 +334,7 @@ def results_default_iter(commit_hash): _is_result_better(time_2, time_1, None, None, factor)): ratio = "~" + ratio.strip() - if only_changed and mark in (' ', 'x'): + if only_changed and mark in (' ', 'x', '*'): continue unit = units[benchmark] diff --git a/changelog.d/+f99f1374.misc.rst b/changelog.d/+f99f1374.misc.rst new file mode 100644 index 000000000..f655bf6c2 --- /dev/null +++ b/changelog.d/+f99f1374.misc.rst @@ -0,0 +1 @@ +Indicate when benchmarks start passing with * diff --git a/changelog.d/1463.bugfix.rst b/changelog.d/1463.bugfix.rst new file mode 100644 index 000000000..fd0715925 --- /dev/null +++ b/changelog.d/1463.bugfix.rst @@ -0,0 +1 @@ +ASV_PYTHONPATH is now applied for the discovery phase. diff --git a/docs/source/using.rst b/docs/source/using.rst index 2ee746632..ad52744fc 100644 --- a/docs/source/using.rst +++ b/docs/source/using.rst @@ -638,7 +638,7 @@ each of its symbolic states can be understood as: - Introduced a failure - Failed - Succeeded - * - + * - ``*`` - Green - Fixed failure - Succeeded