summaryrefslogtreecommitdiff
path: root/pkgs/development/interpreters/python/python-packages-base.nix
AgeCommit message (Collapse)Author
5 daysbuildPython*: extend overrideStdenvCompat to fixed-point argumentsYueh-Shun Li
with `passthru.__stdenvPythonCompat` Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
5 daysbuildPython*: overrideStdenvCompat: lower warnings down to the stdenv ↵Yueh-Shun Li
override value If Nix supports lazy attribute names in the future, this change will make `<python package>.override` warning-free and make such warning (or future throw) remediateable via another override.
5 daysbuildPython*: overrideStdenvCompat: abstract warningYueh-Shun Li
Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
2026-01-04buildPython*: support fixed-point arguments (#271387)Martin Weinelt
2026-01-04buildPython*: include package name in stdenv warningMatt Sturgeon
Co-authored-by: Leona Maroni <dev@leona.is>
2025-12-18makeOverridablePythonPackage: allow buildPython* to take fixed-point argumentsYueh-Shun Li
2025-12-11buildPython*: preserve overrideStdenvCompat on subsequent overridesMatt Sturgeon
This is needed to support the deprecated method of overriding `stdenv` via `overridePythonAttrs`.
2025-12-11buildPython*: remove stdenv arg in overrideStdenvCompatMatt Sturgeon
Avoid passing `stdenv` to the underlying function when it is already handled in overrideStdenvCompat.
2025-12-11buildPython*: switch overrideStdenvCompat to mirrorFunctionArgsMatt Sturgeon
The underlying `mk-python-derivation.nix` functions do not have `stdenv` in their functionArgs, so it was redundant to explicitly remove it.
2025-12-11buildPython*: rename override param in makeOverridablePythonPackageMatt Sturgeon
`fdrv` → `newArgs`; the parameter is not a derivation, so fdrv is confusing.
2025-12-10makeOverridablePythonPackage: take care of overrideAttrsYueh-Shun Li
Make it possible to mix overridePythonAttrs and overrideAttrs, i.e. ((<pkg>.overrideAttrs (_: { foo = "a"; })).overridePythonAttrs (_: { })).foo now works Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
2025-12-10makeOverridablePythonPackage: simplify implementationYueh-Shun Li
Attach overridePythonAttrs by attribute set update instead of `stdenv.mkDerivation`'s `passthru`. Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
2025-10-25buildPython*: unconditionally add .overridesternenseemann
To be able to splice, we can't fail to eval before returning an attribute set. By checking for f ? override, we need to force f which isn't always possible, whereas mirrorFunctionArgs serves as an indirection which wraps the inner thunks in an attribute set that can always be returned. Fortunately, there should be no case when f evaluates successfully and does not have the override attribute, so we can just remove the condition. This fixes evaluation of buildPython* based packages in certain splicing situations by being lazier. An example of this is pkgsCross.ghcjs.buildPackages.nixpkgs-openjdk-updater on staging right now (ff5098e).
2025-10-23buildPython*: warn about deprecated argument stdenvYueh-Shun Li
On Nixpkgs >= 26.05 (or precisely, oldest supported release >= 25.11), warn about the use of buildPython*'s deprecated argument `stdenv`. Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
2025-10-23buildPython*: allow stdenv customization through <function>.overrideYueh-Shun Li
2025-10-22buildPython*: bring back buildPython*.override (#366593)Yueh-Shun Li
2025-10-23buildPython*: bring back buildPython*.overrideYueh-Shun Li
Fix `makeOverridablePythonPackage` in python-package-base.nix and unshadow `buildPython*.override`. This makes it possible to override the dependencies of buildPython*. E.g., `buildPythonPackage.override { unzip = unzip-custom; }` returns a derived version of `buildPythonPackage` with the `unzip` package overridden with `unzip-custom`.
2025-07-23top-level/release-attrpaths-superset: remove __attrsFailEvaluationWolfgang Walther
This doesn't seem to be necessary anymore. I confirmed by: - Adding a lib.warn into the __attrsFailsEvaluation branch - never got any. - Removing it everywhere and running full Eval on it - no errors, no rebuilds.
2025-02-04cpython: add isPy313, isPy314 helpersMartin Weinelt
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-10-08buildPython*: Deprecate and remove (buildPython* { ... }).overrideYueh-Shun Li
Deprecate (buildPythonPackage { ... }).override for Python packages in favour of overridePythonAttrs. This change does not affect the override interface of most Python packages, as the override interface is provided by callPackage and shadows the locally defined override attribute.
2024-09-08python3Packages.mkPythonEditablePackage: initadisbladis
2024-08-30python3Packages.mkPythonMetaPackage: initadisbladis
This function exists create a meta package containing [metadata files](https://packaging.python.org/en/latest/specifications/recording-installed-packages/) to satisfy a dependency on a package, without it actually having been installed into the environment.
2024-08-13pythonPackages: add missing isPy312Ryan Horiguchi
2024-07-04pythonPackages: move __attrsFailEvaluation to allow deeper inspectionPhilip Taron
2024-05-06python: add error message for debugging infinite recursionYang, Bo
2024-01-25python311Packages.recursive-pth-loader: rename from recursivePthLoaderFelix Buehler
2023-12-12python3.pkgs.buildsetupcfg: Remove function from python-packages-base.nixadisbladis
This function is not, and never have been, used anywhere inside nixpkgs, outside of bootstrapping setupcfg2nix itself. It was added in https://github.com/NixOS/nixpkgs/pull/38778 by @shlevy. It has no out-of-tree users on Github either. External breakage is not expected.
2023-11-07makeOverridablePythonPackage: preserve function argumentsYueh-Shun Li
2023-08-20python2.{buildPythonPackage,buildPythonApplication}: extract into its own fileTheodore Ni
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-05-31python3.pkgs.fetchPypi: deprecate in favor of top-level fetchPypifigsoda
2023-02-15Merge staging-next into staginggithub-actions[bot]
2023-02-14treewide: use lib.optionalsFelix Buehler
2023-02-03Merge pull request #211685 from Artturin/splicingstuff1-splitArtturi
2023-01-21fetchPypi: move to top levelfigsoda
fetchPypi doesn't use python under the hood and doesn't need to be tied to a specific version of python. Moving it to top level makes it more consistent with other fetchers and makes code generation easier.
2023-01-20python-packages-base: use extends instead of //Artturin
// shouldn't be used when overrideAttrs is available here we can use extends instead of overrideAttrs for performance
2022-12-17treewide: fix typosfigsoda
2022-11-29cpython: drop leftover 3.5/3.6 logic and patchesMartin Weinelt
2022-10-27pythonPackages: ensure all derivations provide python modulesFrederik Rietdijk
This adds a test to ensure no new uses of `buildPythonApplication` can be added to `python-packages.nix`. Python packages can be grouped into two groups: 1) applications and 2) packages providing importable modules. In `python-packages.nix` we only want to have 2). 1) should be in the top-level package set. To achieve this, all setup hooks need to be marked as being a setup hook. For the setup hooks in the Python packages set this is done by creating a new builder, `makePythonHook`. Because there were issues with splicing, the file importing all the hooks is converted to an extension. All non-packages were moved out of `python-packages.nix` into `python-packages-base.nix`. The `keep` argument to `makeScopeWithSplicing was cleaned up as well; there is no need to keep this one manually in sync reducing the risk of breaking cross-compilation.