buildPythonPackage: add support for conda
This commit is contained in:
committed by
Frederik Rietdijk
parent
ae3d04bf55
commit
6c0b85cf3a
@@ -121,4 +121,37 @@ let
|
||||
# in assert myPackages.foobar == myPackages.numpy; myPackages.python.withPackages(ps: with ps; [ foobar ]);
|
||||
};
|
||||
|
||||
in lib.optionalAttrs (stdenv.hostPlatform == stdenv.buildPlatform ) (environmentTests // integrationTests // overrideTests)
|
||||
condaTests = let
|
||||
requests = callPackage ({
|
||||
autoPatchelfHook,
|
||||
fetchurl,
|
||||
pythonCondaPackages,
|
||||
}:
|
||||
python.pkgs.buildPythonPackage {
|
||||
pname = "requests";
|
||||
version = "2.24.0";
|
||||
format = "other";
|
||||
src = fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/noarch/requests-2.24.0-py_0.tar.bz2";
|
||||
sha256 = "02qzaf6gwsqbcs69pix1fnjxzgnngwzvrsy65h1d521g750mjvvp";
|
||||
};
|
||||
nativeBuildInputs = [ autoPatchelfHook ] ++ (with python.pkgs; [
|
||||
condaUnpackHook condaInstallHook
|
||||
]);
|
||||
buildInputs = [
|
||||
pythonCondaPackages.condaPatchelfLibs
|
||||
];
|
||||
propagatedBuildInputs = with python.pkgs; [
|
||||
chardet idna urllib3 certifi
|
||||
];
|
||||
}
|
||||
) {};
|
||||
pythonWithRequests = requests.pythonModule.withPackages (ps: [ requests ]);
|
||||
in
|
||||
{
|
||||
condaExamplePackage = runCommand "import-requests" {} ''
|
||||
${pythonWithRequests.interpreter} -c "import requests" > $out
|
||||
'';
|
||||
};
|
||||
|
||||
in lib.optionalAttrs (stdenv.hostPlatform == stdenv.buildPlatform ) (environmentTests // integrationTests // overrideTests // condaTests)
|
||||
|
||||
Reference in New Issue
Block a user