Commit Graph

169 Commits

Author SHA1 Message Date
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Wolfgang Walther
38002286d7 python3Packages.setuptoolsCheckHook: move to aliases
This had already been removed and should be an alias now.
2025-07-20 12:04:57 +02:00
Anton Mosich
facae77bf5 python3Packages.sphinxHook: move to preFixupPhases
If sphinxHook runs before the fixup phase, possibly generated manpages
will get compressed in the fixup phase.
2025-06-14 21:23:01 +02:00
Yueh-Shun Li
842f12f8ff python3Packages.pytestCheckHook: format with shfmt 2025-05-04 01:36:44 +08:00
Yueh-Shun Li
63dea02c93 python3Packages.pytestCheckHook: fix Bash heredoc EOF outside subshell
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-05-04 01:31:46 +08:00
Yueh-Shun Li
e1e072bf03 python3Packages.pytestCheckHook: support enabledTestMarks and disabledTestMarks 2025-03-23 23:51:16 +08:00
Yueh-Shun Li
f7aeb5a9b7 python3Packages.pytestCheckHook: support enabledTests 2025-03-23 23:51:16 +08:00
Yueh-Shun Li
f51e1c6766 python3Packages.pytestCheckHook: Make disabledTests support sub-expressions
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-23 23:10:09 +08:00
Yueh-Shun Li
4174f6ed5c python3Packages.pytestCheckHook: support enabledTestPaths 2025-03-23 23:10:04 +08:00
Yueh-Shun Li
16f8b50742 python3Packages.pytestCheckHook: support deselecting tests via disabledTestPaths
Pass disabledTestPaths elements containing double colons (::)
to --deselect instead of --ignore-glob.
2025-03-09 22:20:16 +08:00
Yueh-Shun Li
6bdb735bbe python3Packages.pytestCheckHook: append disableTests flags after disabledTestPaths flags 2025-03-09 22:20:16 +08:00
Yueh-Shun Li
9346e6aa5f python3Packages.pytestCheckHook: add tests 2025-03-07 07:14:56 +08:00
Yueh-Shun Li
2e512e7cf7 python3Packages.pytestCheckHook: fix disabledTestPaths glob matching assertion
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-03-07 07:14:56 +08:00
Yueh-Shun Li
9b07602c8e unittestCheckHook: lint with ShellCheck 2025-01-09 18:36:39 +08:00
Yueh-Shun Li
1e8f39148a unittestCheckHook: handle unittestFlagsArray __structuredAttrs-agnostically
Take unittestFlags as the new and conforming interface.

Keep unittestFlagsArray as is.
2025-01-09 18:36:39 +08:00
Yueh-Shun Li
76f6a3b292 setuptoolsBuildHook: lint with ShellCheck 2025-01-09 18:36:38 +08:00
Yueh-Shun Li
d8c36cb252 setuptoolsBuildHook: support __structuredAttrs
Handle flags with appendToVar and concatTo.

Stop Bash-expanding elements of
setupPyGlobalFlags and setupPyBuildFlags.
2025-01-09 18:36:38 +08:00
Yueh-Shun Li
ec6f585f05 pytestCheckHook: lint with ShellCheck 2025-01-09 18:36:37 +08:00
Yueh-Shun Li
26f09762a8 pytestCheckHook: support __structuredAttrs
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.
2025-01-09 18:36:37 +08:00
Silvan Mosberger
667d42c00d treewide: format all inactive Nix files
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 a08b3a4d19.tar.gz \
      --argstr baseRev 57b193d8dd
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:27:17 +01:00
Wolfgang Walther
56b09628e3 stdenv: support multi-char separators in concatStringsSep
One prominent use-case for this is pytestCheckHook. This will help
making it work with structuredAttrs in the future.
2024-11-30 16:38:02 +01:00
Wolfgang Walther
d86588d230 treewide: improve prepending and appending derivation arguments in bash code
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-25 09:09:23 +01:00
Emily
1634419f4f Merge staging-next into staging 2024-11-19 14:15:02 +00:00
OTABI Tomoya
55f94d9fda python3Packages: Fix and document the removal of the local .overrideAttrs attribute (#350127) 2024-11-19 17:45:32 +09:00
Martin Weinelt
40f89c6e0d python3.pkgs.pythonRuntimeDepsCheckHook: don't validate wheel metadata
Metadata can have issues that the packaging library will complain about,
but that should not prevent us from building any package.
2024-11-18 18:36:51 +01:00
Martin Weinelt
d6c1a5e4e2 python3.pkgs.pythonRuntimeDepsCheckHook: allow prereleases
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-18 18:36:46 +01:00
Yueh-Shun Li
6597b74fea pypaBuildHook.tests: modernize 2024-11-05 10:47:23 +08:00
Yueh-Shun Li
e32457af0c setuptoolsRustHook: lint with ShellCheck 2024-11-05 10:47:23 +08:00
Yueh-Shun Li
65293f4247 pythonRemoveTestDirHook: lint with ShellCheck 2024-11-05 10:47:23 +08:00
Yueh-Shun Li
29c08adae1 pythonRelaxDepsHook: lint with ShellCheck
Ignore SC2164 at this moment, as it will be gone when adding `set -e`.
2024-11-05 10:47:22 +08:00
Yueh-Shun Li
3a79bc3aee pythonRelaxDepsHook: handle attributes __structuredAttrs-agnostically
Make the interation across pythonRelaxDeps and pythonRemoveDeps work
regardless of __structuredAttrs.
2024-11-05 10:47:22 +08:00
Yueh-Shun Li
e4f2f9dd22 pythonOutputDistHook: lint with ShellCheck 2024-11-05 10:47:22 +08:00
Yueh-Shun Li
ccb418b699 pythonNamespacesHook: lint with ShellCheck 2024-11-05 10:47:02 +08:00
Yueh-Shun Li
bab7ef307c pythonImportsCheckHook: lint with ShellCheck 2024-11-05 10:41:17 +08:00
Yueh-Shun Li
967e5b43ed pythonImportsCheckHook: support __structuredAttrs = true 2024-10-28 22:22:42 +08:00
Yueh-Shun Li
69f4871514 pypaBuildHook: lint with ShellCheck 2024-10-28 22:22:42 +08:00
Yueh-Shun Li
1f39bb6586 pypaBuildHook: handle pypaBuildFlags __structuredAttrs-agnostically 2024-10-28 22:22:41 +08:00
Yueh-Shun Li
3a0f6fabff pipInstallHook: handle pipInstallFlags __structuredAttrs-agnostically 2024-10-28 21:21:15 +08:00
Yueh-Shun Li
c4bc1a8bb6 pipBuildHook: handle pipBuildFlags __structuredAttrs-agnostically 2024-10-28 21:20:07 +08:00
Yueh-Shun Li
1f8bb94bca pythonOutputDistHook: append *Phases with appendToVar 2024-10-28 21:19:51 +08:00
Yueh-Shun Li
3e8d53b9e8 python3Packages.pythonCatchConflictsHook: fix tests with lib.overrideDerivation
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 58bfe74123 ("buildPython*:
Deprecate and remove (buildPython* { ... }).override")
2024-10-22 12:51:11 +08:00
Yueh-Shun Li
57c2e5683d buildPython hooks: format with shfmt 2024-10-08 07:42:21 +08:00
Yueh-Shun Li
758056dac7 treewide: handle postPhases __structuredAttrs-agnostically
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-03 05:56:17 +08:00
Yueh-Shun Li
054c5f0e10 treewide: handle preDistPhases __structuredAttrs-agnostically
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-03 05:33:59 +08:00
Yueh-Shun Li
385d523a8e treewide: handle preInstallPhases __structuredAttrs-agnostically
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-09-03 05:33:59 +08:00
Martin Weinelt
0b0dd33e0a python312Packages.setuptoolsCheckHook: remove
The hook relied on the `test` command passed to `setup.py`, which has
long been deprecated and finally removed in setuptools 72.0.
2024-08-06 18:18:40 +02:00
Martin Weinelt
ad9505ddce python3Packages.pythonRelaxDepsHook: update example 2024-07-07 22:36:56 +02:00
Martin Weinelt
b6ef66ed3d Merge pull request #304741 from edgelesssys/python/fix-imports-check-py-output
[staging] python/hooks/python-imports-check-hook: use $python output if existing
2024-06-19 03:35:44 +02:00
Moritz Sanft
d163f12f2c python/hooks/python-imports-check-hook: use $python output if existing 2024-06-04 16:48:57 +02:00
Ben Wolsieffer
21833407b4 pythonCatchConflictsHook: add test for multiple dependency chains
Add a test where a conflicting package can be found at the end of
multiple dependency chains. This is far too simple an example to
demonstrate the ill effects of exponential time complexity, but does
serve to demonstrate how the error output changes when each path is only
visited once.
2024-04-26 21:05:41 -04:00