Need help with a package requirement

Hello.

I’m trying to create a derivation for the Pyrebase package.

My problem is that one of the package requirements is gcloud, which has been updated to google-cloud-sdk.

Nix has the google-cloud-sdk package, but when building Pyrebase it shows a error message that the gcloud requirement was not satisfied.

I tried assigning the gcloud variable to the google-cloud-sdk, even though I knew it wouldn’t work.

gcloud ? pkgs.google-cloud-sdk

Any suggestions what I can do?

Is there a reason to package this orphaned project? There seem to be successors. THIS REPO UNMAINTAINED - 3 new successor repos here · Issue #435 · thisbejim/Pyrebase · GitHub

Hi,

  1. With Pyrebase4 I had the same problem:

No matching distribution found for gcloud>=0.18.3

  1. About firebase-rest-api, the error was different:

FileNotFoundError: [Errno 2] No such file or directory: ‘setup.py’.

This happens because firebase-rest-api has a pyproject.toml instead of a setup.py After adding format=“pyproject” in my derivation I got a exception error, with a list of fails related to:

ModuleNotFoundError: No module named ‘flit_core’

UPDATE: I think I solved this error by adding flit-core to my derivation’s buildInputs. Now I have a version error related to pyjwt. The version available on nixpkgs is 2.5.0 and the firebase-rest-api requirements ask for 3.3.2.

No matching distribution found for python_jwt>=3.3.2

Adding this to the derivation didn’t work either:

prePatch = ‘’
substituteInPlace requirements.txt pyproject.toml
–replace “python_jwt>=3.3.2” “python_jwt>=2.5.0”
‘’;

  1. I managed to create the firebase-admin package, but it doesn’t fit my need.

Try GitHub - josewails/Pirebase: A simple python wrapper for the Firebase API. instead of Pyrebase4, but remove 'gcloud>=0.18.3', from setup.py. Pirebase uses google-cloud-storage which is the one of the successors of the successor of gcloud.

Returned this:

ERROR: Could not find a version that satisfies the requirement python-jwt>=2.0.1 (from pirebase) (from versions: none)
ERROR: No matching distribution found for python-jwt>=2.0.1

You need to package python-jwt and add it to the buildInputs for pirebase.

Same result. My derivation:

{ pkgs ? import <nixpkgs> {} 
, lib ? pkgs.python310Packages.lib
, buildPythonPackage ? pkgs.python310Packages.buildPythonPackage
, fetchPypi ?  pkgs.python310Packages.fetchPypi
, requests ? pkgs.python310Packages.requests
, google-auth ? pkgs.python310Packages.google-auth
, requests-toolbelt ? pkgs.python310Packages.requests-toolbelt
, python-jwt ? pkgs.python310Packages.pyjwt
, pycryptodome ? pkgs.python310Packages.pycryptodome
, google-cloud-storage ? pkgs.python310Packages.google-cloud-storage
, sseclient ? pkgs.python310Packages.sseclient
}:

buildPythonPackage rec {
  pname = "pirebase";
  version = "3.1.29";

  src = fetchPypi {
    pname = "Pirebase";
    inherit version;
    sha256 = "17a6dd740f7edf2a07d79a9836763d67a69a862040f0f0b4f9b8e2639bf1b0f8";
  };

  propagatedBuildInputs = [
    requests
    google-auth
    requests-toolbelt
    python-jwt
    pycryptodome
    google-cloud-storage
    sseclient
  ];

  postPatch = ''
    substituteInPlace setup.py \
      --replace "gcloud>=0.18.3" " "
  '';

  meta = with lib; {
    description = "A simple python wrapper for the Firebase API";
    homepage = https://github.com/josewails/Pirebase;
    license = licenses.mit;
  };
}

pkgs.python310Packages.pyjwt is not python-jwt. python-jwt is not packaged in nixpkgs.

So is it not possible to build this derivation?

You can package what’s missing.