175 Commits

Author SHA1 Message Date
Yueh-Shun Li
b02dda8ea8 python3Packages.buildPythonPackage: make passthru.pyproject overridable 2025-09-29 01:55:04 +08:00
Yueh-Shun Li
0aebd262f1 python3Packages.buildPythonPackage: add internal helper getFinalPassthru
Add getFinalPassthru, an internal helper function that
produces informative error message
when an atttribute is not found in `finalAttrs.passthru`.
2025-09-29 01:55:02 +08:00
Ross Smyth
4241178a62 python: Allow users to set nativeInstallCheckInputs and installCheckInputs
to make consistent with the rest of nixpkgs
2025-09-02 14:00:28 -04:00
Martin Weinelt
048507355c buildPythonPackage: use nix-update as the default update script
Much more robust and supports various fetchers like cargo, npm or yarn.
2025-08-22 02:37:00 +02:00
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Martin Weinelt
d2e9be2b07 buildPython*: throw on empty format
This is the ratchet that disallows introducing new python packages that
do not define a package format.
2025-07-02 10:18:35 +02:00
nixpkgs-ci[bot]
92da411185 Merge staging-next into staging 2025-05-24 00:17:23 +00:00
Martin Weinelt
a64a02f6d6 buildPythonPackage: preserve the disabled effect after <pkg>.overrideAttrs (#376419) 2025-05-23 22:39:11 +02:00
Yueh-Shun Li
67564e09a5 buildPython*: pass check-related args whenever specified
Pass
- disabledTestMarks
- disabledTestPaths
- disabledTests
- enabledTestMarks
- enabledTestPaths
- enabledTests
- pytestFlags
- pytestFlagsArray
- unittestFlags
- unittestFlagsArray

whenever they are specified,
no matter if doCheck is true or if they are empty lists.

Simplify the buildPython* argument handling
and bring us closer to the deprecation of overridePythonAttrs
and the adoption of fixed-point arguments.
2025-04-30 06:25:38 +08:00
Yueh-Shun Li
bb3a41f312 buildPython*: fix the disabled functionality for overrideAttrs- 2025-04-11 16:34:14 +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
4174f6ed5c python3Packages.pytestCheckHook: support enabledTestPaths 2025-03-23 23:10:04 +08:00
Yueh-Shun Li
55d08bb886 buildPythonPackage: simplify check-related attribute inheritance 2025-03-07 16:48:04 +08:00
Yueh-Shun Li
ad8dfff2dd buildPythonPackage: add and use lib inheritance 2025-03-02 21:54:05 +08:00
Yueh-Shun Li
f2cbc7da9e buildPythonPackage: sort lib inheritance 2025-03-02 21:51:24 +08:00
Yueh-Shun Li
2aa22b5edc buildPythonPackage: remove obsolete lib inheritance 2025-03-02 21:49:02 +08:00
Yueh-Shun Li
70322e2fa2 buildPythonPackage: format expression 2025-03-02 21:44:43 +08:00
Martin Weinelt
d15ca73b55 buildPython*: make name-related attributes overridable via overrideAttrs (#376714) 2025-02-08 18:07:59 +01:00
Yueh-Shun Li
4134fdc75c buildPython*: always specify attributes catchConflicts and dontWrapPythonPrograms
Always specify catchConflicts and dontWrapPythonPrograms.

Make them overrideAttrs-overridable.
2025-02-04 06:36:24 +08:00
Yueh-Shun Li
c540331279 buildPython*: make name-relaed attributes overridable via overrideAttrs
Make name, pname and version overridable via overrideAttrs
for Python packgaes constructed with buildPython*.
2025-02-04 02:11:22 +08:00
K900
51575400a3 buildPython*: fix mismerge 2025-02-03 19:11:59 +03:00
K900
5c3fd0ab9f Merge remote-tracking branch 'origin/master' into staging-next 2025-02-03 09:17:01 +03:00
K900
c15f4ee007 Merge remote-tracking branch 'origin/master' into staging-next 2025-02-02 09:47:44 +03:00
Yueh-Shun Li
3678c2ea8d buildPython*: format expression after restructuring 2025-02-02 14:26:22 +08:00
Yueh-Shun Li
6d2625c64b buildPython*: remove redundant parenthesis
This commit is intentionally unformatted
for smoother merging and rebasing experience.
2025-02-02 14:26:22 +08:00
Yueh-Shun Li
2b6cde5354 buildPython*: move argument-dependent let-in variables down below finalAttrs
This commit is intentionally unformatted
for smoother merging and rebasing experience.
2025-02-02 14:26:22 +08:00
Yueh-Shun Li
04c39df325 buildPython*: abstract out transformDrv 2025-02-02 14:26:22 +08:00
Yueh-Shun Li
cbd527c8ad buildPython*: use finalAttrs.finalPackage for passthru attribute values 2025-01-24 21:04:31 +08:00
Yueh-Shun Li
617bc74413 buildPython*: move the format'-related assertion down to its value 2025-01-24 21:04:31 +08:00
Yueh-Shun Li
d6a757bb01 buildPython*: prioritize user-specified passthru attrs 2025-01-24 21:04:31 +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
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
Peder Bergebakken Sundt
8fd082ed7f mk-python-derivation: passthru disabled
Enables outside testing of whether a package is supported for the current interpreter
2025-01-09 00:37:17 +01:00
Silvan Mosberger
4f0dadbf38 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 b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
OTABI Tomoya
0a77110029 mkPythonPackage, mkPythonApplication: handle passthru with stdenv.mkDerivation instead of lib.extendDerivation (#347130) 2024-10-14 17:46:49 +09:00
Yueh-Shun Li
21a1cf9686 mkPythonPackage, mkPythonApplication: handle passthru with mkDerivation 2024-10-08 00:21:42 +08:00
Artturin
f0e657f3b1 Merge branch 'master' into staging-next 2024-09-25 06:05:01 +03:00
Artturin
e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00
OTABI Tomoya
fff13abe46 mk-python-derivation: don't expose check args when doCheck = false (#327264) 2024-09-15 17:09:15 +09: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
natsukium
2e2f18813c mk-python-derivation: don't expose check args when doCheck = false
This change prevents rebuilds if we change check flags when
doCheck = false. It's useful, for example, when tests are separated in
`passthru.tests`.
2024-07-27 11:26:55 +09:00
Vladimír Čunát
c76085b3a9 Merge branch 'master' into staging-next 2024-07-03 19:07:35 +02:00
Yueh-Shun Li
455314a3f0 buildPython*: make doCheck default less confusing
Modify the set pattern to hint developers that the doInstallCheck
attribute of Python packages, specified by the doCheck argument of
buildPythonPackage and buildPythonApplication, defaults to true instead
of false.
2024-07-03 02:42:59 +08:00
Martin Weinelt
3bfb20e638 mk-python-derivation: add pythonRelaxDepsHook
Configuring `pythonRelaxDeps` or `pythonRemoveDeps` does not require
adding `pythonRelaxDepsHook` into `nativeBuildInputs` anymore.

Co-Authored-By: superherointj <5861043+superherointj@users.noreply.github.com>
2024-06-14 14:51:23 +02:00
adisbladis
de402796a7 mk-python-derivation: Break out attribute set cleaning into a separate function
With precomputed static lists.
2024-03-06 14:22:43 +13:00
adisbladis
1656fe1bf6 mk-python-derivation: Precompute static lists 2024-03-06 14:22:09 +13:00
adisbladis
d77190aeaa mk-python-derivation: Refactor internal function validatePythonMatches
We can avoid recreating the same closure for every call by moving arguments around a little.
2024-03-04 16:04:50 +13:00
adisbladis
fb757e30fa mk-python-derivation: Refactor lib usage 2024-03-04 16:04:50 +13:00
adisbladis
4d0cca4654 mk-python-derivation: Add build-system argument
Much like the previous commit that adds dependencies &
optional-dependencies this aligns PEP-517 build systems with how they
are defined in PEP-518/PEP-621.

The naming `build-system` (singular) is aligned with upstream Python standards.
2024-02-18 17:40:42 +13:00