1 # Fetch from PyPi legacy API as documented in https://warehouse.pypa.io/api-reference/legacy.html
20 impureEnvVars = fetchers.proxyImpureEnvVars ++ optional inPureEvalMode "NETRC";
28 # Multiple package indices to consider
30 # filename including extension
34 # allow overriding the derivation name
36 # allow overriding cacert using src.override { cacert = cacert.override { extraCertificateFiles = [ ./path/to/cert.pem ]; }; }
40 urls' = urls ++ optional (url != null) url;
42 pathParts = filter ({ prefix, path }: "NETRC" == prefix) builtins.nixPath;
43 netrc_file = if (pathParts != [ ]) then (head pathParts).path else "";
46 # Assert that we have at least one URL
55 inherit impureEnvVars;
56 outputHashMode = "flat";
57 # if hash is empty select a default algo to let nix propose the actual hash.
58 outputHashAlgo = if hash == "" then "sha256" else null;
61 // optionalAttrs (name != null) { inherit name; }
62 // optionalAttrs (!inPureEvalMode) { env.NETRC = netrc_file; }
65 python ${./fetch-legacy.py} ${
66 concatStringsSep " " (map (url: "--url ${escapeShellArg url}") urls')
67 } --pname ${pname} --filename ${file}