summaryrefslogtreecommitdiff
path: root/pkgs/development/interpreters/python/hooks
AgeCommit message (Collapse)Author
2025-12-11python3Packages.setuptools-rust: fix cross build for all `setuptools-rust` ↵dotlambda
based packages (#467817)
2025-12-09python3Packages.setuptools-rust: fix cross build for all `setuptools-rust` ↵DavHau
based packages Prior to this change all python packages using `setuptools-rust` were broken when cross compiled as they built binaries for the build platform instead of for the host platform. The setuptoolsRustBuildHook hook would have to be included as a native build input instead of the `setuptools-rust` package, but practically wasn't used anywhere. This change makes it so that `setuptoolsRustBuildHook` becomes unnecessary, and instead `setuptools-rust` propagates a setup-hook directly setting up the build environment, similar to how cmake does it when included via nativeBuildInputs. This change fixes cross on all packages using `setuptools-rust` as a build-system.
2025-11-18Fix shebang of installed python scriptsGuillaume Girol
Closes: https://github.com/NixOS/nixpkgs/pull/449340 Fixes: https://github.com/NixOS/nixpkgs/issues/449325
2025-07-24treewide: run nixfmt 1.0.0Wolfgang Walther
2025-07-20python3Packages.setuptoolsCheckHook: move to aliasesWolfgang Walther
This had already been removed and should be an alias now.
2025-06-14python3Packages.sphinxHook: move to preFixupPhasesAnton Mosich
If sphinxHook runs before the fixup phase, possibly generated manpages will get compressed in the fixup phase.
2025-05-04python3Packages.pytestCheckHook: format with shfmtYueh-Shun Li
2025-05-04python3Packages.pytestCheckHook: fix Bash heredoc EOF outside subshellYueh-Shun Li
Fix the unterminated here document of the pytest-check-hook.sh error mesage by moving the EOF of the here document between the parenthesis of the process substitution.
2025-03-23python3Packages.pytestCheckHook: support enabledTestMarks and disabledTestMarksYueh-Shun Li
2025-03-23python3Packages.pytestCheckHook: support enabledTestsYueh-Shun Li
2025-03-23python3Packages.pytestCheckHook: Make disabledTests support sub-expressionsYueh-Shun Li
Wrap each elements of disabledTests with parenthesis so that when __structuredAttrs = true, people could use sub-expressions an element. E.g. ```nix { disabledTests = [ "ClassFoo and test_foo" "test_bar" ]; }
2025-03-23python3Packages.pytestCheckHook: support enabledTestPathsYueh-Shun Li
2025-03-09python3Packages.pytestCheckHook: support deselecting tests via disabledTestPathsYueh-Shun Li
Pass disabledTestPaths elements containing double colons (::) to --deselect instead of --ignore-glob.
2025-03-09python3Packages.pytestCheckHook: append disableTests flags after ↵Yueh-Shun Li
disabledTestPaths flags
2025-03-07python3Packages.pytestCheckHook: add testsYueh-Shun Li
2025-03-07python3Packages.pytestCheckHook: fix disabledTestPaths glob matching assertionYueh-Shun Li
Errors in Bash's process substitution doesn't get propagated outside. Replace the process substitution with Python's `-` as /dev/stdin and Bash's heredoc stdin redirection.
2025-01-09unittestCheckHook: lint with ShellCheckYueh-Shun Li
2025-01-09unittestCheckHook: handle unittestFlagsArray `__structuredAttrs`-agnosticallyYueh-Shun Li
Take unittestFlags as the new and conforming interface. Keep unittestFlagsArray as is.
2025-01-09setuptoolsBuildHook: lint with ShellCheckYueh-Shun Li
2025-01-09setuptoolsBuildHook: support __structuredAttrsYueh-Shun Li
Handle flags with appendToVar and concatTo. Stop Bash-expanding elements of setupPyGlobalFlags and setupPyBuildFlags.
2025-01-09pytestCheckHook: lint with ShellCheckYueh-Shun Li
2025-01-09pytestCheckHook: support __structuredAttrsYueh-Shun Li
Add flag pytestFlags as the new, conforming interface replacing pytestFlagsArray. Stop Bash-expanding disabledTests and disabledTestPaths. Handle disabledTestPaths with `pytest --ignore-glob <path>` to keep globbing support. Check if each path glob matches at least one path using the `glob` module from the Python standard library. Also make buildPythonPackage and buildPythonApplication stop escaping the elements of disabledTests and disabledTestPaths.
2024-12-10treewide: format all inactive Nix filesSilvan Mosberger
After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-build https://github.com/infinisil/treewide-nixpkgs-reformat-script/archive/a08b3a4d199c6124ac5b36a889d9099b4383463f.tar.gz \ --argstr baseRev 57b193d8ddeaf4f5219d2bae1d23b081e4906e57 result/bin/apply-formatting $NIXPKGS_PATH
2024-11-30stdenv: support multi-char separators in concatStringsSepWolfgang Walther
One prominent use-case for this is pytestCheckHook. This will help making it work with structuredAttrs in the future.
2024-11-25treewide: improve prepending and appending derivation arguments in bash codeWolfgang Walther
Those would be problematic with __structuredAttrs turned on, because they'd turn those nice bash arrays back into strings - and potentially lose some of the values on the way.
2024-11-19Merge staging-next into stagingEmily
2024-11-19python3Packages: Fix and document the removal of the local `.overrideAttrs` ↵OTABI Tomoya
attribute (#350127)
2024-11-18python3.pkgs.pythonRuntimeDepsCheckHook: don't validate wheel metadataMartin Weinelt
Metadata can have issues that the packaging library will complain about, but that should not prevent us from building any package.
2024-11-18python3.pkgs.pythonRuntimeDepsCheckHook: allow prereleasesMartin Weinelt
Updating to prereleases should be possible, but making this an option is difficult, given that for packages with many consumers you would have to set it in each consumer. We thoroughly test the package set, so allowing prereleases unconditionally shouldn't be too bad. Closes: #301698
2024-11-05pypaBuildHook.tests: modernizeYueh-Shun Li
2024-11-05setuptoolsRustHook: lint with ShellCheckYueh-Shun Li
2024-11-05pythonRemoveTestDirHook: lint with ShellCheckYueh-Shun Li
2024-11-05pythonRelaxDepsHook: lint with ShellCheckYueh-Shun Li
Ignore SC2164 at this moment, as it will be gone when adding `set -e`.
2024-11-05pythonRelaxDepsHook: handle attributes `__structuredAttrs`-agnosticallyYueh-Shun Li
Make the interation across pythonRelaxDeps and pythonRemoveDeps work regardless of __structuredAttrs.
2024-11-05pythonOutputDistHook: lint with ShellCheckYueh-Shun Li
2024-11-05pythonNamespacesHook: lint with ShellCheckYueh-Shun Li
2024-11-05pythonImportsCheckHook: lint with ShellCheckYueh-Shun Li
2024-10-28pythonImportsCheckHook: support __structuredAttrs = trueYueh-Shun Li
2024-10-28pypaBuildHook: lint with ShellCheckYueh-Shun Li
2024-10-28pypaBuildHook: handle pypaBuildFlags `__structuredAttrs`-agnosticallyYueh-Shun Li
2024-10-28pipInstallHook: handle pipInstallFlags `__structuredAttrs`-agnosticallyYueh-Shun Li
2024-10-28pipBuildHook: handle pipBuildFlags `__structuredAttrs`-agnosticallyYueh-Shun Li
2024-10-28pythonOutputDistHook: append *Phases with appendToVarYueh-Shun Li
2024-10-22python3Packages.pythonCatchConflictsHook: fix tests with lib.overrideDerivationYueh-Shun Li
Use lib.overrideDerivation instead of <pkg>.overrideDerivation to fix the evaluation of python3Packages.pythonCatchConflictsHook.tests.catches-conflict-multiple-chains, as buildPythonPackage and buildPythonApplication no longer provide <pkg>.overrideDerivation Clean up the leftover of commit 58bfe7412308 ("buildPython*: Deprecate and remove (buildPython* { ... }).override")
2024-10-08buildPython hooks: format with shfmtYueh-Shun Li
2024-09-03treewide: handle postPhases __structuredAttrs-agnosticallyYueh-Shun Li
Always specify the postPhases attribute as a list instead of a string. Append elements to the postPhases Bash variable using appendToVar instead of string or Bash array concatenation.
2024-09-03treewide: handle preDistPhases __structuredAttrs-agnosticallyYueh-Shun Li
Always specify the preDistPhases attribute as a list instead of a string. Append elements to the preDistPhases Bash variable using appendToVar instead of string or Bash array concatenation. Handle element insertion before a specific element using string substitution as before, but handle both structured and unstructured attributes.
2024-09-03treewide: handle preInstallPhases __structuredAttrs-agnosticallyYueh-Shun Li
Always specify the preInstallPhases attribute as a list instead of a string. Append elements to the preInstallPhases Bash variable using appendToVar instead of string or Bash array concatenation.
2024-08-06python312Packages.setuptoolsCheckHook: removeMartin Weinelt
The hook relied on the `test` command passed to `setup.py`, which has long been deprecated and finally removed in setuptools 72.0.
2024-07-07python3Packages.pythonRelaxDepsHook: update exampleMartin Weinelt