From e969a2f69f3b433233155aaaf3f094a8bde205b5 Mon Sep 17 00:00:00 2001 From: Kevin Modzelewski Date: Wed, 4 May 2022 20:28:04 -0400 Subject: [PATCH] Force recompilation of all dependencies There is, in general, not a requirement that source packages compile to the same thing as available binary packages. It's rare, but this is one thing that can end up causing differences in benchmark results between two Python distributions, if one has binary packages and one does not. Forcing all dependencies to compile from source eliminates this potential difference. The only case I know of is mypy, which ships a more-optimized binary package than what their source package compiles to. --- pyperformance/_pip.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyperformance/_pip.py b/pyperformance/_pip.py index 7fc07874..befa7b7f 100644 --- a/pyperformance/_pip.py +++ b/pyperformance/_pip.py @@ -153,6 +153,11 @@ def install_requirements(reqs, *extra, if os.path.exists(reqs): args.append('-r') # --requirement args.append(reqs) + + if "USE_BINARY_PACKAGES" not in os.environ: + # Force recompilation: + args.extend(["--no-binary", ":all:"]) + return run_pip('install', *args, **kwargs)