summaryrefslogtreecommitdiffstats
path: root/pkgs/development/julia-modules/tests/top-julia-packages.nix
blob: 3a3a9f13a2f4b694b0b1acd38e41da10eb793a88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
with import ../../../../. { };

let
  package-requests = stdenv.mkDerivation {
    name = "julia-package-requests.csv";

    __impure = true;

    buildInputs = [
      cacert
      gzip
      wget
    ];

    buildCommand = ''
      wget https://julialang-logs.s3.amazonaws.com/public_outputs/current/package_requests.csv.gz
      gunzip package_requests.csv.gz
      cp package_requests.csv $out
    '';
  };

  registry = callPackage ../registry.nix { };

in

runCommand "top-julia-packages.yaml"
  {
    __impure = true;
    nativeBuildInputs = [
      (python3.withPackages (
        ps: with ps; [
          pyyaml
          toml
        ]
      ))
    ];
  }
  ''
    python ${./process_top_n.py} ${package-requests} ${registry} > $out
  ''