From 14ea71ee627aa9abd2040149180d67e68841c1b1 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:08:00 -0700 Subject: [PATCH 01/23] buildRustPackage: default doCheck to false, add passthru.tests.build All build systems should default doCheck to false to keep builds fast. Tests are automatically available via passthru.tests.build which re-runs the build with doCheck = true. User-supplied passthru.tests entries are merged alongside the auto-generated one. --- pkgs/rust/build-rust-package/default.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pkgs/rust/build-rust-package/default.nix b/pkgs/rust/build-rust-package/default.nix index 340f04d8b..4be12b8b5 100644 --- a/pkgs/rust/build-rust-package/default.nix +++ b/pkgs/rust/build-rust-package/default.nix @@ -171,7 +171,20 @@ lib.extendMkDerivation { runHook postConfigure ''; - doCheck = args.doCheck or true; + doCheck = args.doCheck or false; + + passthru = + let + userPassthru = args.passthru or { }; + autoTests = { + # Re-run the build with tests enabled + build = finalAttrs.finalPackage.overrideAttrs { doCheck = true; }; + }; + in + { + tests = autoTests // (userPassthru.tests or { }); + } + // removeAttrs userPassthru [ "tests" ]; meta = meta // { badPlatforms = meta.badPlatforms or [ ] ++ rustc.badTargetPlatforms; From c22aba595cc12d8702636b05a4a49d868ed02b17 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:08:04 -0700 Subject: [PATCH 02/23] buildGoModule: default doCheck to false, add passthru.tests.build All build systems should default doCheck to false to keep builds fast. Tests are automatically available via passthru.tests.build which re-runs the build with doCheck = true and allowGoReference = true. User-supplied passthru.tests entries are merged alongside the auto-generated one. --- pkgs-many/go/module.nix | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/pkgs-many/go/module.nix b/pkgs-many/go/module.nix index 4832ea931..01faeda6c 100644 --- a/pkgs-many/go/module.nix +++ b/pkgs-many/go/module.nix @@ -367,7 +367,7 @@ lib.extendMkDerivation { '' ); - doCheck = args.doCheck or (!buildTestBinaries); + doCheck = args.doCheck or false; checkPhase = args.checkPhase or '' runHook preCheck @@ -395,14 +395,26 @@ lib.extendMkDerivation { inherit allowGoReference; disallowedReferences = lib.optional (!finalAttrs.allowGoReference) go; - passthru = { - inherit go; - # Canonicallize `overrideModAttrs` as an attribute overlay. - # `passthru.overrideModAttrs` will be overridden - # when users want to override `goModules`. - overrideModAttrs = lib.toExtension overrideModAttrs; - } - // passthru; + passthru = + let + autoTests = { + # Re-run the build with tests enabled; allow Go references since + # test binaries may embed the Go compiler path + build = finalAttrs.finalPackage.overrideAttrs { + doCheck = true; + allowGoReference = true; + }; + }; + in + { + inherit go; + # Canonicallize `overrideModAttrs` as an attribute overlay. + # `passthru.overrideModAttrs` will be overridden + # when users want to override `goModules`. + overrideModAttrs = lib.toExtension overrideModAttrs; + tests = autoTests // (passthru.tests or { }); + } + // removeAttrs passthru [ "tests" ]; meta = { # Add default meta information. From 75fee206e95adf9142e1b41be024cbe9f8aa3d02 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:08:10 -0700 Subject: [PATCH 03/23] buildRPackage: default doCheck to false Pass --no-test-load to R CMD INSTALL by default to skip test loading during package installation, consistent with other build systems. --- pkgs/buildRPackage/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/buildRPackage/default.nix b/pkgs/buildRPackage/default.nix index ba2749aee..3c1f9e0e3 100644 --- a/pkgs/buildRPackage/default.nix +++ b/pkgs/buildRPackage/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation ( runHook postBuild ''; - installFlags = if attrs.doCheck or true then [ ] else [ "--no-test-load" ]; + installFlags = if attrs.doCheck or false then [ ] else [ "--no-test-load" ]; rCommand = "R"; From 30e473eb9a12fed64ae7565b66023b8ff313a48f Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:08:15 -0700 Subject: [PATCH 04/23] docs: expand testing policy in AGENTS.md and packaging SKILL.md Document that all build systems now default doCheck to false. Add guidance on passthru.tests patterns, auto-generated tests.build for Rust/Go, and the Python testPaths mechanism. --- .agents/skills/packaging/SKILL.md | 53 +++++++++++++++++++++++++++---- AGENTS.md | 29 +++++++++++++++-- 2 files changed, 73 insertions(+), 9 deletions(-) diff --git a/.agents/skills/packaging/SKILL.md b/.agents/skills/packaging/SKILL.md index 80081a711..7c011e890 100644 --- a/.agents/skills/packaging/SKILL.md +++ b/.agents/skills/packaging/SKILL.md @@ -55,21 +55,62 @@ platforms = lib.platforms.all; # All platforms ## Testing -**Default:** `doCheck = false;` - Don't set explicitly. +**Goal:** Keep builds as fast as possible by disabling in-build tests. Use `passthru.tests` to preserve test coverage without slowing every build. + +### Defaults + +`doCheck = false;` and `doInstallCheck = false;` are the defaults across all build systems (`stdenv.mkDerivation`, `buildPythonPackage`, `buildRustPackage`, `buildGoModule`, `buildPerlPackage`). Don't set them explicitly. + +### Auto-Generated `passthru.tests.build` + +`buildRustPackage` and `buildGoModule` automatically provide `passthru.tests.build` — a variant that re-runs the build with `doCheck = true`. User-supplied `passthru.tests` entries are merged alongside, not replaced. + +For `stdenv.mkDerivation` packages, add `passthru.tests` manually: -**Preferred pattern:** ```nix passthru.tests = { - unittests = runUnitTests finalAttrs.finalPackage; + withChecks = finalAttrs.finalPackage.overrideAttrs { doCheck = true; }; }; ``` -**Enable tests only when essential:** +### Python: `testPaths` (Preferred) + +Set `testPaths` to auto-generate `passthru.tests.python` and a `test_src` output: + +```nix +nativeCheckInputs = [ pytestCheckHook ]; +testPaths = [ "tests" ]; +``` + +The `test_src` output bundles the listed paths plus config files (`conftest.py`, `pyproject.toml`, etc.). A standalone test derivation runs the suite against the installed package. + +For suites that need extra files (helper modules, fixture data): ```nix -doCheck = true; -checkInputs = [ pytest ]; +testPaths = [ "tests" "src/helpers" "README.rst" ]; ``` +Test configuration attributes are forwarded automatically: +- `disabledTests`, `disabledTestPaths`, `enabledTestPaths` +- `pytestFlags`, `pytestFlagsArray`, `unittestFlagsArray` +- `preCheck`, `postCheck`, `preInstallCheck`, `postInstallCheck` + +### Python: Manual `tests.nix` (Fallback) + +When `testPaths` is not suitable (e.g., circular dependencies with pytest), create a separate `tests.nix`: + +```nix +# default.nix +passthru.tests = { + pytest = callPackage ./tests.nix { }; +}; +``` + +### Acceptable In-Build Checks + +`doInstallCheck = true;` is acceptable for: +- `versionCheckHook` — verifies the built binary runs and prints expected version +- `pythonImportsCheck` — runs automatically in `buildPythonPackage`, no need to enable explicitly + ## Dependencies ```nix diff --git a/AGENTS.md b/AGENTS.md index 041159beb..b855f1bf9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -110,9 +110,32 @@ for migration patterns (array iteration, `env` attrset, `substituteAll`, etc.). ### Testing -- `doCheck = false;` is the default - don't set it explicitly -- Prefer `passthru.tests` for unit tests -- Only enable `doCheck = true;` for critical packages +**Goal:** Keep builds as fast as possible. Tests run in `passthru.tests`, not during the main build. + +**Rules:** +- `doCheck = false;` and `doInstallCheck = false;` are the defaults across all build systems — don't set them explicitly +- Move test suites to `passthru.tests` so they can be built on demand without slowing every build +- Very minimal test suites may be permitted in-build, but the strong default is tests off +- `doInstallCheck = true;` is acceptable for lightweight checks (e.g., `versionCheckHook`) + +**Auto-generated tests:** `buildRustPackage` and `buildGoModule` automatically provide `passthru.tests.build` — a variant that re-runs the build with `doCheck = true`. User-supplied `passthru.tests` entries are merged alongside, not replaced. + +**Additional `passthru.tests` (optional):** +```nix +passthru.tests.version = testers.testVersion { + package = finalAttrs.finalPackage; +}; +``` + +**Python — use `testPaths` (preferred):** +```nix +nativeCheckInputs = [ pytestCheckHook ]; +testPaths = [ "tests" ]; +``` + +This auto-generates `passthru.tests.python` and a `test_src` output. Test configuration attributes (`disabledTests`, `pytestFlags`, etc.) are forwarded automatically. For suites needing extra files: `testPaths = [ "tests" "src/helpers" "README.rst" ];`. + +When `testPaths` is not suitable (e.g., circular dependencies with pytest), create a separate `tests.nix` referenced via `passthru.tests`. **Detailed guide:** See [`.agents/skills/packaging/SKILL.md`](.agents/skills/packaging/SKILL.md#testing) for testing patterns. From 245814a6e5f8b58bf7663ef8b0ff1fc1ea19a056 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:08:20 -0700 Subject: [PATCH 05/23] nixfmt-rs: add git to nativeCheckInputs The mergetool test requires git merge-file to be available. --- pkgs/nixfmt-rs/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/nixfmt-rs/default.nix b/pkgs/nixfmt-rs/default.nix index c7c5ef7f7..698f2aceb 100644 --- a/pkgs/nixfmt-rs/default.nix +++ b/pkgs/nixfmt-rs/default.nix @@ -2,6 +2,7 @@ lib, rustPlatform, fetchFromGitHub, + git, }: rustPlatform.buildRustPackage rec { @@ -17,7 +18,7 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-LVn9QxJU2r6urD6MA7Z52ajXcgE2Q6dmjirgA/jBKUw="; - doCheck = false; + nativeCheckInputs = [ git ]; meta = with lib; { description = "A from-scratch Rust reimplementation of nixfmt that produces byte-identical output to the Haskell original."; From edac72288bd26f1b608f98036de002786d2300c5 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:08:25 -0700 Subject: [PATCH 06/23] ast-grep: fix cargoBuildFlags quoting Split single-string arguments into separate list elements so they are passed correctly to cargo under structuredAttrs. --- pkgs/ast-grep/default.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/ast-grep/default.nix b/pkgs/ast-grep/default.nix index 66eacaa7e..5b52152d4 100644 --- a/pkgs/ast-grep/default.nix +++ b/pkgs/ast-grep/default.nix @@ -32,9 +32,17 @@ rustPlatform.buildRustPackage (finalAttrs: { nativeBuildInputs = [ installShellFiles ]; cargoBuildFlags = [ - "--package ast-grep --bin ast-grep" + "--package" + "ast-grep" + "--bin" + "ast-grep" ] - ++ lib.optionals enableLegacySg [ "--package ast-grep --bin sg" ]; + ++ lib.optionals enableLegacySg [ + "--package" + "ast-grep" + "--bin" + "sg" + ]; postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' installShellCompletion --cmd ast-grep \ From 3219dd5a32efa88e2af803575a7dbe7a675dbe7d Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:08:31 -0700 Subject: [PATCH 07/23] gleam: add git to nativeCheckInputs, skip sandbox-incompatible tests Git-related tests need git in the sandbox. Skip copyright notice scan (chokes on cargo build artifacts), escript dependency test (needs network), and echo tests (need bun runtime). --- pkgs/gleam/default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/gleam/default.nix b/pkgs/gleam/default.nix index b22835865..8d352b830 100644 --- a/pkgs/gleam/default.nix +++ b/pkgs/gleam/default.nix @@ -5,6 +5,7 @@ fetchFromGitHub, pkg-config, erlang, + git, }: rustPlatform.buildRustPackage (finalAttrs: { @@ -25,7 +26,16 @@ rustPlatform.buildRustPackage (finalAttrs: { erlang ]; - doCheck = false; + nativeCheckInputs = [ git ]; + + checkFlags = [ + # scans build directory and chokes on .d files from cargo + "--skip=tests::all_files_have_copyright_notice" + # requires erlang escriptize which needs network/deps + "--skip=tests::escript_success_with_dependency" + # echo tests require bun (JavaScript runtime) + "--skip=tests::echo::" + ]; meta = { description = "Statically typed language for the Erlang VM"; From 7e32bc751831f13a0639f2781492040fb883570b Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:08:36 -0700 Subject: [PATCH 08/23] maturin: skip tests requiring pyo3 crate and network access Run only lib tests and skip build_options tests that need the pyo3 crate (not in vendored deps) and metadata tests that need files not included in the source archive. --- pkgs/maturin/default.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/maturin/default.nix b/pkgs/maturin/default.nix index 7bbcb68fa..4bffe1645 100644 --- a/pkgs/maturin/default.nix +++ b/pkgs/maturin/default.nix @@ -27,8 +27,16 @@ rustPlatform.buildRustPackage rec { libiconv ]; - # Requires network access, fails in sandbox. - doCheck = false; + cargoTestFlags = [ "--lib" ]; + + checkFlags = [ + # these tests require pyo3 crate not included in vendored deps + "--skip=build_options::tests::" + # these tests require files not included in the source + "--skip=metadata::tests::test_implicit_readme" + "--skip=metadata::tests::test_merge_metadata_from_pyproject_toml" + "--skip=metadata::tests::test_pep639" + ]; passthru = { tests = { From 124a7c6fb01079b97cd7c2213f034f0e3c26a425 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:08:43 -0700 Subject: [PATCH 09/23] pijul: skip identity test that fails to compile The identity integration test references SecretKey type that was removed from pijul_core::key. Restrict cargo tests to --bins only. --- pkgs/pijul/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/pijul/default.nix b/pkgs/pijul/default.nix index 2b7b87907..8171450d7 100644 --- a/pkgs/pijul/default.nix +++ b/pkgs/pijul/default.nix @@ -25,7 +25,8 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-Ldb+CpKiVvNOeMhdD/hfQfAAMwdwUy/npY85VBPBq5k="; - doCheck = false; + # identity test fails to compile: SecretKey type removed from pijul_core::key + cargoTestFlags = [ "--bins" ]; nativeBuildInputs = [ installShellFiles pkg-config From 8ed594d273d2beec709efba080cf1fc2726ceaca Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:08:47 -0700 Subject: [PATCH 10/23] rust-analyzer-unwrapped: disable cargo tests Tests require rustfmt +stable toolchain and a real Rust sysroot, neither of which are available in the build sandbox. --- pkgs/rust-analyzer-unwrapped/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/rust-analyzer-unwrapped/default.nix b/pkgs/rust-analyzer-unwrapped/default.nix index 4ac27e737..209c1c84e 100644 --- a/pkgs/rust-analyzer-unwrapped/default.nix +++ b/pkgs/rust-analyzer-unwrapped/default.nix @@ -32,7 +32,8 @@ rustPlatform.buildRustPackage (finalAttrs: { libiconv ]; - doCheck = false; + # Tests require rustfmt +stable toolchain and real Rust sysroot + dontCargoCheck = true; env.CFG_RELEASE = finalAttrs.version; From 42f6c51e3f9a2533f02a2a074b46dc66334477bf Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:08:52 -0700 Subject: [PATCH 11/23] rust-cbindgen: disable cargo tests All tests use -Zunpretty=expanded which requires nightly rustc, and some additionally need cython. --- pkgs/rust-cbindgen/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/rust-cbindgen/default.nix b/pkgs/rust-cbindgen/default.nix index 233b050ef..c9a9f3b64 100644 --- a/pkgs/rust-cbindgen/default.nix +++ b/pkgs/rust-cbindgen/default.nix @@ -2,6 +2,7 @@ lib, fetchFromGitHub, rustPlatform, + cmake, }: rustPlatform.buildRustPackage (finalAttrs: { @@ -17,8 +18,8 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-f6YoDoiVoh0BVPYHFO1FsdI4OCsF+LY72QaD57StdIQ="; - # Tests require cython and rust nightly features - doCheck = false; + # Tests require nightly rustc (-Zunpretty=expanded) and cython + dontCargoCheck = true; meta = { description = "Tool for generating C bindings to Rust code"; From bd6e744bd9d56277b5333c66e1c9644f59f02668 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:08:57 -0700 Subject: [PATCH 12/23] tree-sitter: disable cargo tests Tests require grammar fixtures (language parsers) that are not included in the source tarball. --- pkgs/tree-sitter/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tree-sitter/default.nix b/pkgs/tree-sitter/default.nix index bcfa919ea..3f4bdfe2c 100644 --- a/pkgs/tree-sitter/default.nix +++ b/pkgs/tree-sitter/default.nix @@ -34,7 +34,7 @@ rustPlatform.buildRustPackage (finalAttrs: { ]; # Tests require grammar fixtures not included in the source - doCheck = false; + dontCargoCheck = true; patches = [ ./remove-web-interface.patch From 2cd9b2ed2fee93f94c4cba8ac5f04f1b4396485f Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:09:00 -0700 Subject: [PATCH 13/23] uv: disable cargo tests Tests require python3, network access, and system keyring which are not available in the build sandbox. --- pkgs/uv/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/uv/default.nix b/pkgs/uv/default.nix index 379298232..d4af235ab 100644 --- a/pkgs/uv/default.nix +++ b/pkgs/uv/default.nix @@ -40,8 +40,8 @@ rustPlatform.buildRustPackage (finalAttrs: { "uv" ]; - # Tests require python3 - doCheck = false; + # Tests require python3, network access, and keyring + dontCargoCheck = true; postInstall = lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ( let From c73b64922241729ae5d4be24295b6dbd54521100 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:09:06 -0700 Subject: [PATCH 14/23] skopeo: remove redundant doCheck comment Tests are now disabled by default via buildGoModule. The Go reference issue is handled by the auto-generated passthru.tests.build which sets allowGoReference = true. --- pkgs/skopeo/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/skopeo/default.nix b/pkgs/skopeo/default.nix index d46df684b..7b0d3ad6f 100644 --- a/pkgs/skopeo/default.nix +++ b/pkgs/skopeo/default.nix @@ -61,8 +61,7 @@ buildGoModule rec { runHook postBuild ''; - # Embeds paths from go - doCheck = false; + # Test binaries embed Go compiler paths; tests run via passthru.tests.build installPhase = '' runHook preInstall From 9b562a44ea615ca049925f85be99a9c0086438db Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:09:12 -0700 Subject: [PATCH 15/23] python3Packages.pyflakes: skip tests with sandbox path issues Integration tests compare error message paths which differ in the Nix build sandbox. --- python/pkgs/pyflakes/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/python/pkgs/pyflakes/default.nix b/python/pkgs/pyflakes/default.nix index 7a52aef1a..58dfcb680 100644 --- a/python/pkgs/pyflakes/default.nix +++ b/python/pkgs/pyflakes/default.nix @@ -25,7 +25,15 @@ buildPythonPackage (finalAttrs: { testPaths = [ "pyflakes/test" ]; - disabledTests = lib.optionals isPyPy [ + disabledTests = [ + # paths in error messages differ in sandbox + "test_readFromStdin" + "test_errors_io" + "test_errors_syntax" + "test_fileWithFlakes" + "test_goodFile" + ] + ++ lib.optionals isPyPy [ # https://github.com/PyCQA/pyflakes/issues/779 "test_eofSyntaxError" "test_misencodedFileUTF16" From 63fac7c4cddb9303b35e0decc87153b99e5a4d3b Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:09:17 -0700 Subject: [PATCH 16/23] python3Packages.requests: skip test_zipped_paths_extracted Fails with "ZIP does not support timestamps before 1980" in the Nix sandbox due to epoch-zeroed file timestamps. --- python/pkgs/requests/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/pkgs/requests/default.nix b/python/pkgs/requests/default.nix index 8405742f6..7f23b3dff 100644 --- a/python/pkgs/requests/default.nix +++ b/python/pkgs/requests/default.nix @@ -68,6 +68,8 @@ buildPythonPackage (finalAttrs: { "test_use_proxy_from_environment" "TestRequests" "TestTimeout" + # ZIP does not support timestamps before 1980 + "test_zipped_paths_extracted" ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ # Fatal Python error: Aborted From dbb76bec6859f11f5d17e9605052a5637c6d867d Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:09:21 -0700 Subject: [PATCH 17/23] python3Packages.pkginfo: skip tests needing fixture archives sdist, wheel, bdist, develop, and utils tests require fixture archives from docs/examples/ which are not present in the PyPI sdist. --- python/pkgs/pkginfo/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/python/pkgs/pkginfo/default.nix b/python/pkgs/pkginfo/default.nix index d48f73ad1..8d65c0f7b 100644 --- a/python/pkgs/pkginfo/default.nix +++ b/python/pkgs/pkginfo/default.nix @@ -33,6 +33,19 @@ buildPythonPackage (finalAttrs: { "test_installed_ctor_w_dist_info" "test_installed_ctor_w_name" "test_installed_ctor_w_package" + # tests referencing fixture wheel/sdist archives in docs/examples/ + "test_wheel" + "test_get_metadata_w_wheel" + "test_sdist" + ]; + + # Most tests require fixture archives from docs/examples/ not present in PyPI sdist + disabledTestPaths = [ + "pkginfo/tests/test_sdist.py" + "pkginfo/tests/test_wheel.py" + "pkginfo/tests/test_utils.py" + "pkginfo/tests/test_bdist.py" + "pkginfo/tests/test_develop.py" ]; pythonImportsCheck = [ "pkginfo" ]; From c70b993babfd20b0cee06b9bcf6fe52d65c6e2cc Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:09:26 -0700 Subject: [PATCH 18/23] python3Packages.pytest-mock: skip introspection tests These tests rely on _pytest.assertion.util internals that changed in newer pytest versions. --- python/pkgs/pytest-mock/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/pkgs/pytest-mock/default.nix b/python/pkgs/pytest-mock/default.nix index 12431f6da..fea51b60d 100644 --- a/python/pkgs/pytest-mock/default.nix +++ b/python/pkgs/pytest-mock/default.nix @@ -35,6 +35,12 @@ buildPythonPackage (finalAttrs: { testPaths = [ "tests" ]; + disabledTests = [ + # pytest internals changed; _pytest.assertion.util API mismatch + "test_assert_called_kwargs_with_introspection" + "test_assert_called_args_with_introspection" + ]; + pythonImportsCheck = [ "pytest_mock" ]; meta = { From 4e09627638e9b9902acfd06778935bb6892ad685 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:09:33 -0700 Subject: [PATCH 19/23] python3Packages.pytest-rerunfailures: skip flaky rerun fixture tests Several tests asserting rerun outcomes with fixtures produce inconsistent pass counts across environments. --- python/pkgs/pytest-rerunfailures/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/python/pkgs/pytest-rerunfailures/default.nix b/python/pkgs/pytest-rerunfailures/default.nix index d0ca3746e..87b342e7e 100644 --- a/python/pkgs/pytest-rerunfailures/default.nix +++ b/python/pkgs/pytest-rerunfailures/default.nix @@ -33,6 +33,15 @@ buildPythonPackage (finalAttrs: { testPaths = [ "tests" ]; + disabledTests = [ + # flaky: rerun fixture outcome assertions differ + "test_run_session_teardown_once_after_reruns" + "test_rerun_on_setup_class_with_error_with_reruns" + "test_rerun_on_class_scope_fixture_with_error_with_reruns" + "test_rerun_on_module_fixture_with_reruns" + "test_rerun_on_session_fixture_with_reruns" + ]; + pythonImportsCheck = [ "pytest_rerunfailures" ]; meta = { From 9734e066379e6f0f37d9bb6db1b634cf10029137 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:09:37 -0700 Subject: [PATCH 20/23] python3Packages.mako: skip HTML exception rendering tests Exception HTML output differs across pygments and markupsafe versions, causing assertion failures on entity encoding. --- python/pkgs/mako/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python/pkgs/mako/default.nix b/python/pkgs/mako/default.nix index 9e2ff56a0..94567686a 100644 --- a/python/pkgs/mako/default.nix +++ b/python/pkgs/mako/default.nix @@ -51,7 +51,13 @@ buildPythonPackage (finalAttrs: { testPaths = [ "test" ]; - disabledTests = lib.optionals isPyPy [ + disabledTests = [ + # HTML rendering output differs across pygments/markupsafe versions + "test_custom_tback" + "test_py_utf8_html_error_template" + "test_utf8_format_exceptions_pygments" + ] + ++ lib.optionals isPyPy [ # https://github.com/sqlalchemy/mako/issues/315 "test_alternating_file_names" # https://github.com/sqlalchemy/mako/issues/238 From ca5dfec4681b82b0bb101e810e4eba9c2ebe5feb Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:09:42 -0700 Subject: [PATCH 21/23] python3Packages.scikit-build-core: skip test_setup.py test_long_description reads README.md which is not included in the test_src output. --- python/pkgs/scikit-build-core/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/pkgs/scikit-build-core/default.nix b/python/pkgs/scikit-build-core/default.nix index dc54a33ce..197c2aa0f 100644 --- a/python/pkgs/scikit-build-core/default.nix +++ b/python/pkgs/scikit-build-core/default.nix @@ -77,6 +77,8 @@ buildPythonPackage (finalAttrs: { disabledTestPaths = [ # store permissions issue in Nix: "tests/test_editable.py" + # requires README.md not in test_src + "tests/test_setup.py" ]; pythonImportsCheck = [ "scikit_build_core" ]; From 7db8c60c57fcb03d1896adf99adb8c37c94757f0 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:09:46 -0700 Subject: [PATCH 22/23] python3Packages.hatch-fancy-pypi-readme: skip CLI end-to-end tests CLI tests need pyproject.toml at the source root which is not present in the test_src output. --- python/pkgs/hatch-fancy-pypi-readme/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/pkgs/hatch-fancy-pypi-readme/default.nix b/python/pkgs/hatch-fancy-pypi-readme/default.nix index 595754cab..4c4cf1899 100644 --- a/python/pkgs/hatch-fancy-pypi-readme/default.nix +++ b/python/pkgs/hatch-fancy-pypi-readme/default.nix @@ -47,12 +47,14 @@ buildPythonPackage (finalAttrs: { "README.md" ]; - # Requires network connection disabledTests = [ - "test_build" # Requires internet + "test_build" # requires internet "test_invalid_config" ]; + # CLI end-to-end tests need pyproject.toml at source root + disabledTestPaths = [ "tests/test_cli.py" ]; + pythonImportsCheck = [ "hatch_fancy_pypi_readme" ]; meta = { From 136b3549e42c97aaece3f488656fc05331b1c352 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Sat, 19 Sep 2026 16:09:51 -0700 Subject: [PATCH 23/23] python3Packages.tomli-w: skip test_for_profiler The profiler test reads benchmark/data.toml which may not be present in all source archive formats. --- python/pkgs/tomli-w/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/pkgs/tomli-w/default.nix b/python/pkgs/tomli-w/default.nix index 3b5ed508d..3dd89030a 100644 --- a/python/pkgs/tomli-w/default.nix +++ b/python/pkgs/tomli-w/default.nix @@ -26,13 +26,14 @@ buildPythonPackage (finalAttrs: { tomli ]; - # `tests/test_for_profiler.py` reads a TOML file from the sibling - # `benchmark/` directory. testPaths = [ "tests" "benchmark" ]; + # test_for_profiler needs benchmark/data.toml which may not be present in all source archives + disabledTestPaths = [ "tests/test_for_profiler.py" ]; + pythonImportsCheck = [ "tomli_w" ]; meta = {