From e7dd55c1b31207914d638b751420d5c7e5a1e0c9 Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Mon, 4 Oct 2021 15:43:20 -0400
Subject: [PATCH] Use the python-challenge-bypass-ristretto wheel from pypi

(with Tom)
---
 new.nix               | 37 +++----------------------------------
 requirements/base.txt |  2 +-
 2 files changed, 4 insertions(+), 35 deletions(-)

diff --git a/new.nix b/new.nix
index 6e77490..7223f96 100644
--- a/new.nix
+++ b/new.nix
@@ -6,44 +6,14 @@ in
 , mach-nix ? import sources.mach-nix { inherit pkgs pypiData; python = "python27"; }
 ,
 }:
-  let
-    python-challenge-bypass-ristretto =
-      (
-        mach-nix.buildPythonPackage rec {
-          nativeBuildInputs = [
-            pkgs.git
-            pkgs.rustPlatform.rust.rustc
-            pkgs.rustPlatform.rust.cargo
-          ];
-          buildInputs = [
-            pkgs.rustPlatform.cargoSetupHook
-            pkgs.python2.pkgs.milksnake
-            pkgs.python2.pkgs.setuptools-scm
-          ];
-          cargoRoot = "challenge-bypass-ristretto-ffi";
-          cargoDeps = pkgs.rustPlatform.fetchCargoTarball {
-            inherit src;
-            sourceRoot = "source/${cargoRoot}";
-            sha256 = "sha256-ewqfNMaOZyNSs8epaviER63iUzljr4fbOeWd3WXYDO4=";
-          };
-          format = "setuptools";
-          src = pkgs.fetchFromGitHub {
-            owner = "LeastAuthority";
-            repo = "python-challenge-bypass-ristretto";
-            rev = "02482f4afe72521377d5bbe2dc1402fecd4c6a9a";
-            sha256 = "sha256-PtyC1fk/WAOZvsCc2vK3XNDt/V21DT5Txdo09LmO8bc=";
-            fetchSubmodules = true;
-            leaveDotGit = true;
-          };
-          version = "2021.07.12";
-        }
-      );
-  in
     mach-nix.buildPythonApplication rec {
       name = "zero-knowledge-access-pass-authorizer";
       src = ./.;
       providers = {
         _default = "sdist,nixpkgs,wheel";
+        # not packaged in nixpkgs at all, we can use the binary wheel from
+        # pypi though.
+        python-challenge-bypass-ristretto = "wheel";
         # Pure python packages that don't build correctly from sdists
         # - patches in nixpkgs that don't apply
         # - missing build dependencies
@@ -64,7 +34,6 @@ in
         )
       ];
       format = "setuptools";
-      overridesPre = [ (self: super: { inherit python-challenge-bypass-ristretto; }) ];
       requirements = builtins.readFile ./requirements/base.txt;
       # Record some settings here, so downstream nix files can consume them.
       #meta.mach-nix = { inherit python providers; };
diff --git a/requirements/base.txt b/requirements/base.txt
index 9a97c82..928728b 100644
--- a/requirements/base.txt
+++ b/requirements/base.txt
@@ -111,7 +111,7 @@ pyopenssl==21.0.0
     #   twisted
 pyrsistent==0.16.1
     # via eliot
-python-challenge-bypass-ristretto==2021.7.12
+python-challenge-bypass-ristretto
     # via -r requirements/base.in
 pyutil==3.3.0
     # via -r requirements/base.in
-- 
GitLab