Commit Graph

20 Commits

Author SHA1 Message Date
Yueh-Shun Li
c2b21fb07e python2Packages.buildPythonPackage: format expression after lib.extendMkDerivation restructuring
(cherry picked from commit 397f1ecdb0)
2026-05-02 02:26:46 +01:00
Yueh-Shun Li
79580f83ee python2Packages.buildPytonPackage: restructure with lib.extendMkDerivation
Port to python2/mk-python-derivation.nix commit 0969c66247
(buildPython*: support fixed-point arguments via lib.extendMkDerivation")

Postpone formatting to minimize diff.

(cherry picked from commit ea28d03e33)
2026-05-02 02:22:26 +01:00
Yueh-Shun Li
96986958c7 python2Packages.buildPythonPackage: remove ineffective outputs cleanAttrs
Port to python2/mk-python-derivation.nix commit bc122a602a
("python3Packages.buildPythonPackage:
remove ineffective outputs cleanAttrs").

(cherry picked from commit 66e4524989)
2026-05-02 02:22:25 +01:00
Yueh-Shun Li
30a2aa18dd python2Packages.buildPythonPackage: preserve disabled after <pkg>.overrideAttrs
Port to python2/mk-python-derivation.nix commit bb3a41f312
("buildPython*: fix the disabled functionality for overrideAttrs-")

(cherry picked from commit e05bc0af96)
2026-05-02 02:22:25 +01:00
Yueh-Shun Li
93b2914ce9 python2Packages.buildPythonPackage: passthru disabled
Port to python2/mk-python-derivation.nix commit 8fd082ed7f
("mk-python-derivation: passthru disabled").

Co-authored-by: Peder Bergebakken Sundt <pbsds@hotmail.com>
(cherry picked from commit bd2285a8a5)
2026-05-02 02:22:25 +01:00
Yueh-Shun Li
ffc3127237 python2Packages.buildPythonPackage: port respect user-specified passthru attrs
Port to python2/mk-python-derivation.nix commit d6a757bb01
("buildPython*: prioritize user-specified passthru attrs").

(cherry picked from commit f2efb32a79)
2026-05-02 02:22:25 +01:00
Yueh-Shun Li
6cd4114682 python2Packages.buildPythonPackage: handle passthru with mkDerivation
Port to python2/mk-python-derivation.nix commit 21a1cf9686
("mkPythonPackage, mkPythonApplication:
handle passthru with mkDerivation").

(cherry picked from commit 57c0190caf)
2026-05-02 02:22:24 +01:00
Yueh-Shun Li
c4e3b67afb buildPython*: allow stdenv customization through <function>.override 2025-10-23 14:51:18 +08:00
Wolfgang Walther
91a8fee3aa treewide: remove redundant parentheses
Auto-fixed by nixf-diagnose.
2025-10-05 10:52:03 +02:00
NAHO
c8d4dabc43 pkgs: remove optional builtins prefixes from prelude functions
Remove optional builtins prefixes from prelude functions by running:

    builtins=(
      abort
      baseNameOf
      break
      derivation
      derivationStrict
      dirOf
      false
      fetchGit
      fetchMercurial
      fetchTarball
      fetchTree
      fromTOML
      import
      isNull
      map
      null
      placeholder
      removeAttrs
      scopedImport
      throw
      toString
      true
    )

    fd \
      --type file \
      . \
      pkgs \
      --exec-batch sed --in-place --regexp-extended "
        s/\<builtins\.($(
          printf '%s\n' "${builtins[@]}" |
            paste --delimiter '|' --serial -
        ))\>/\1/g
      "

    nix fmt
2025-10-04 19:02:37 +02:00
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02: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
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
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
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
d9327a53de Revert "python2/mk-python-derivation: disable catchConflictsHook"
This reverts commit 397a8fd06b.

The hook now uses the old implementation based on the deprecated
pkg_resources library provided by setuptools again.
2023-11-18 12:58:15 +01:00
K900
397a8fd06b python2/mk-python-derivation: disable catchConflictsHook
It's broken on Py2. Hopefully people still using 2 know what they're doing?
2023-11-17 07:48:13 +03:00
Adam Joseph
bc2d598878 treewide: change pythonForBuild to pythonOnBuildForHost 2023-11-05 17:42:12 -08:00
Peder Bergebakken Sundt
bdda7b0a53 python3Packages.flitBuildHook: remove 2023-09-22 21:11:24 +02:00
Theodore Ni
e8cca499a8 python2.{buildPythonPackage,buildPythonApplication}: extract into its own file
As we continue iterating on Python infrastructure for Python 3, some
code is starting to diverge for Python 2. If we copy the current state
of mk-python-derivation.nix and freeze it for Python 2, we can iterate
on it for Python 3 with more freedom.
2023-08-20 10:59:46 +02:00