From 01ad9f01f05dd8ae85fbabd8e27f46958f7872c1 Mon Sep 17 00:00:00 2001 From: Iwan Date: Sun, 16 Mar 2025 20:28:12 +0100 Subject: [PATCH] typeguard: avoid writing bytecode during tests to make reproducible #384704 --- pkgs/development/python-modules/typeguard/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/python-modules/typeguard/default.nix b/pkgs/development/python-modules/typeguard/default.nix index 4873e61061da..4f74f088f82d 100644 --- a/pkgs/development/python-modules/typeguard/default.nix +++ b/pkgs/development/python-modules/typeguard/default.nix @@ -53,6 +53,10 @@ buildPythonPackage rec { pytestCheckHook ]; + # To prevent test from writing out non-reproducible .pyc files + # https://github.com/agronholm/typeguard/blob/ca512c28132999da514f31b5e93ed2f294ca8f77/tests/test_typechecked.py#L641 + preCheck = "export PYTHONDONTWRITEBYTECODE=1"; + pythonImportsCheck = [ "typeguard" ]; meta = {