DavHau / pypi-deps-db

Dependency DB for python packages on pypi
MIT License
66 stars 40 forks source link

404 when downloading `pypi-deps-db` tarball #20

Closed instantepiphany closed 1 year ago

instantepiphany commented 1 year ago

I have a default.nix that contains:

let
  mach-nix = import (builtins.fetchGit {
    url = "https://github.com/DavHau/mach-nix/";
    # place version number with the latest one from the github releases page
    ref = "refs/tags/3.5.0";
  }) {
    pypiDataRev = "45774a0649b7ccaf9563d9f44d293a62aa23f0f5";
    pypiDataSha256 = "sha256:05mpbqrl3kavsyjf3jain3ksp561j86c058rnmjm5khd5b2lc8qw";
  };
in
mach-nix.mkPython {
  # contents of a requirements.txt (use builtins.readFile ./requirements.txt alternatively)
  requirements = builtins.readFile ./requirements.txt;
  packagesExtra = [
  ];
}

And when running nix-shell I get:

error:
       … while calling the 'derivationStrict' builtin

         at //builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'python3-3.9.9-env'
         whose name attribute is located at /nix/store/5n402azp0s9vza4rziv4z5y88v2cv1mq-nixpkgs/pkgs/stdenv/generic/make-derivation.nix:205:7

       … while evaluating attribute 'passAsFile' of derivation 'python3-3.9.9-env'

         at /nix/store/5n402azp0s9vza4rziv4z5y88v2cv1mq-nixpkgs/pkgs/build-support/trivial-builders.nix:75:7:

           74|       inherit buildCommand;
           75|       passAsFile = [ "buildCommand" ]
             |       ^
           76|         ++ (derivationArgs.passAsFile or []);

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: unable to download 'https://github.com/DavHau/nix-pypi-fetcher/tarball/db3593377fcb56c3808383c8aaa1165c143dacc9': HTTP error 404

       response body:

       404: Not Found

I'm on MacOS, but that hasn't caused problems previously.

instantepiphany commented 1 year ago

I thought perhaps the older tarball was removed, but updating the revision and hash with the below:

    pypiDataRev = "347188196403dbdd4facc68163381f3997f6ea89";
    pypiDataSha256 = "sha256:03p1h369a60zbg3da5qyh65gp181hv7ahp59c185mi50gxwbspj6";

Produced the same error, just with a different hash for the tarball:

error:
       … while calling the 'derivationStrict' builtin

         at //builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'python3-3.9.9-env'
         whose name attribute is located at /nix/store/5n402azp0s9vza4rziv4z5y88v2cv1mq-nixpkgs/pkgs/stdenv/generic/make-derivation.nix:205:7

       … while evaluating attribute 'passAsFile' of derivation 'python3-3.9.9-env'

         at /nix/store/5n402azp0s9vza4rziv4z5y88v2cv1mq-nixpkgs/pkgs/build-support/trivial-builders.nix:75:7:

           74|       inherit buildCommand;
           75|       passAsFile = [ "buildCommand" ]
             |       ^
           76|         ++ (derivationArgs.passAsFile or []);

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: unable to download 'https://github.com/DavHau/nix-pypi-fetcher/tarball/ad2286d2d5ca6336affe3600728be0bb9954dfaf': HTTP error 404

       response body:

       404: Not Found

I also tried the GH documented URL format: https://github.com/DavHau/nix-pypi-fetcher/archive/ad2286d2d5ca6336affe3600728be0bb9954dfaf.tar.gz Which also fails (in a browser).

GH status page doesn't indicate any issues. @DavHau any thoughts? I'm guessing this will be broken for any new users or people who clean their nix cache etc.

DavHau commented 1 year ago

There pypi-deps-db npw references revisions frkm the new nix-pypi-fetcher2 repo. Probably you just need to update mach-nix to master

instantepiphany commented 1 year ago

Thanks. Updating to master mach-nix via:

let
  mach-nix = import (builtins.fetchGit {
    url = "https://github.com/DavHau/mach-nix/";
    # place version number with the latest one from the github releases page
    rev = "ea9605fdcdd7ebc52b01c66dd54db8ac9148741a";
  }) {
#    pypiDataRev = "347188196403dbdd4facc68163381f3997f6ea89";
#    pypiDataSha256 = "sha256:03p1h369a60zbg3da5qyh65gp181hv7ahp59c185mi50gxwbspj6";
  };
in
mach-nix.mkPython {
  # contents of a requirements.txt (use builtins.readFile ./requirements.txt alternatively)
  requirements = builtins.readFile ./requirements.txt;
  packagesExtra = [
  ];
}

Worked great, thank you!

If 3.5.0 is no longer supported, perhaps the examples with that version in the README of mach-nix should be updated.