Merge staging-next into staging

This commit is contained in:
github-actions[bot]
2022-08-06 12:01:56 +00:00
committed by GitHub
26 changed files with 238 additions and 66 deletions
@@ -68,7 +68,7 @@ let
executable = libPrefix;
pythonVersion = with sourceVersion; "${major}.${minor}";
sitePackages = "lib/${libPrefix}/site-packages";
inherit hasDistutilsCxxPatch;
inherit hasDistutilsCxxPatch pythonAttr;
pythonOnBuildForBuild = pkgsBuildBuild.${pythonAttr};
pythonOnBuildForHost = pkgsBuildHost.${pythonAttr};
pythonOnBuildForTarget = pkgsBuildTarget.${pythonAttr};
@@ -91,7 +91,7 @@ let
executable = libPrefix;
pythonVersion = with sourceVersion; "${major}.${minor}";
sitePackages = "lib/${libPrefix}/site-packages";
inherit hasDistutilsCxxPatch;
inherit hasDistutilsCxxPatch pythonAttr;
pythonOnBuildForBuild = override pkgsBuildBuild.${pythonAttr};
pythonOnBuildForHost = override pkgsBuildHost.${pythonAttr};
pythonOnBuildForTarget = override pkgsBuildTarget.${pythonAttr};
@@ -19,9 +19,14 @@ with pkgs;
, pythonOnBuildForTarget
, pythonOnHostForHost
, pythonOnTargetForTarget
, pythonAttr ? null
, self # is pythonOnHostForTarget
}: let
pythonPackages = callPackage
# Function that when called
# - imports python-packages.nix
# - adds spliced package sets to the package set
# - applies overrides from `packageOverrides` and `pythonPackagesOverlays`.
({ pkgs, stdenv, python, overrides }: let
pythonPackagesFun = import ../../../top-level/python-packages.nix {
inherit stdenv pkgs lib;
@@ -74,7 +79,7 @@ with pkgs;
extra = _: {};
optionalExtensions = cond: as: if cond then as else [];
python2Extension = import ../../../top-level/python2-packages.nix;
extensions = lib.composeManyExtensions ((optionalExtensions (!self.isPy3k) [python2Extension]) ++ [ overrides ]);
extensions = lib.composeManyExtensions ((optionalExtensions (!self.isPy3k) [python2Extension]) ++ pkgs.pythonPackagesExtensions ++ [ overrides ]);
aliases = self: super: lib.optionalAttrs config.allowAliases (import ../../../top-level/python-aliases.nix lib self super);
in lib.makeScopeWithSplicing
pkgs.splicePackages
@@ -117,6 +122,8 @@ with pkgs;
tests = callPackage ./tests.nix {
python = self;
};
inherit pythonAttr;
};
sources = {
@@ -30,6 +30,7 @@ let
executable = "pypy${if isPy3k then "3" else ""}";
sitePackages = "site-packages";
hasDistutilsCxxPatch = false;
inherit pythonAttr;
pythonOnBuildForBuild = pkgsBuildBuild.${pythonAttr};
pythonOnBuildForHost = pkgsBuildHost.${pythonAttr};
@@ -11,6 +11,7 @@
, substituteAll
, lib
, callPackage
, pkgs
}:
let
@@ -133,6 +134,17 @@ let
# test-overrideScope = let
# myPackages = python.pkgs.overrideScope extension;
# in assert myPackages.foobar == myPackages.numpy; myPackages.python.withPackages(ps: with ps; [ foobar ]);
} // lib.optionalAttrs (python ? pythonAttr) {
# Test applying overrides using pythonPackagesOverlays.
test-pythonPackagesExtensions = let
pkgs_ = pkgs.extend(final: prev: {
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
(python-final: python-prev: {
foo = python-prev.setuptools;
})
];
});
in pkgs_.${python.pythonAttr}.pkgs.foo;
};
condaTests = let