diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index fbe03d7f865cf..a6d5f9ae27512 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -22747,6 +22747,12 @@ githubId = 4294323; name = "Langston Barrett"; }; + siegema = { + email = "bee@sharpbeedevelopment.com"; + name = "Martin"; + github = "Siegema"; + githubId = 15473103; + }; sielicki = { name = "Nicholas Sielicki"; email = "nix@opensource.nslick.com"; diff --git a/pkgs/development/python-modules/gotrue/default.nix b/pkgs/development/python-modules/gotrue/default.nix new file mode 100644 index 0000000000000..8ef7436ecc043 --- /dev/null +++ b/pkgs/development/python-modules/gotrue/default.nix @@ -0,0 +1,44 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + poetry-core, + httpx, + h2, + pydantic, + pyjwt, + pytest-mock, +}: + +buildPythonPackage rec { + pname = "gotrue"; + version = "2.12.0"; + pyproject = true; + + src = fetchPypi { + inherit pname version; + hash = "sha256-ueoWTuUpZNg2TFUM3hbdDpV2JBpM/+qlLsozn2HR0Us="; + }; + + build-system = [ poetry-core ]; + + dependencies = [ + httpx + h2 + pydantic + pyjwt + pytest-mock + ]; + + pythonImportsCheck = [ "gotrue" ]; + + # test aren't in pypi package + doCheck = false; + + meta = { + homepage = "https://github.com/supabase/auth-py"; + license = lib.licenses.mit; + description = "Python Client Library for Supabase Auth"; + maintainers = with lib.maintainers; [ siegema ]; + }; +} diff --git a/pkgs/development/python-modules/realtime/default.nix b/pkgs/development/python-modules/realtime/default.nix new file mode 100644 index 0000000000000..cf41f0df81f86 --- /dev/null +++ b/pkgs/development/python-modules/realtime/default.nix @@ -0,0 +1,57 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + poetry-core, + python-dateutil, + typing-extensions, + websockets, + aiohttp, + pytestCheckHook, + python-dotenv, +}: + +buildPythonPackage rec { + pname = "realtime-py"; + version = "2.5.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "supabase"; + repo = "realtime-py"; + rev = "v${version}"; + hash = "sha256-NFxWcnt/zpgDehacqK7QlXhmjrh6JoA6xh+sFjD/tt0="; + }; + + dependencies = [ + python-dateutil + typing-extensions + websockets + aiohttp + ]; + + pythonRelaxDeps = [ + "websockets" + "aiohttp" + "typing-extensions" + ]; + + # Can't run all the tests due to infinite loop in pytest-asyncio + nativeBuildInputs = [ + pytestCheckHook + python-dotenv + ]; + + pythonImportsCheck = [ "realtime" ]; + + build-system = [ poetry-core ]; + + doCheck = false; + + meta = { + homepage = "https://github.com/supabase/realtime-py"; + license = lib.licenses.mit; + description = "Python Realtime Client for Supabase"; + maintainers = with lib.maintainers; [ siegema ]; + }; +} diff --git a/pkgs/development/python-modules/storage3/default.nix b/pkgs/development/python-modules/storage3/default.nix new file mode 100644 index 0000000000000..f022c39ccf804 --- /dev/null +++ b/pkgs/development/python-modules/storage3/default.nix @@ -0,0 +1,43 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + poetry-core, + python-dateutil, + httpx, + h2, + deprecation, +}: + +buildPythonPackage rec { + pname = "storage3"; + version = "0.12.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "supabase"; + repo = "storage-py"; + rev = "v${version}"; + hash = "sha256-3Z+j9n/seL1ZuB1djOVpA6Qci/Ygi9g8g2lLQGKRUHM="; + }; + + dependencies = [ + python-dateutil + httpx + h2 + deprecation + ]; + + build-system = [ poetry-core ]; + + pythonImportCheck = [ "storage3" ]; + + # tests fail due to mock server not starting + + meta = { + homepage = "https://github.com/supabase/storage-py"; + license = lib.licenses.mit; + description = "Supabase Storage client for Python."; + maintainers = with lib.maintainers; [ siegema ]; + }; +} diff --git a/pkgs/development/python-modules/supabase/default.nix b/pkgs/development/python-modules/supabase/default.nix new file mode 100644 index 0000000000000..ddfb3e461ca96 --- /dev/null +++ b/pkgs/development/python-modules/supabase/default.nix @@ -0,0 +1,58 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + poetry-core, + gotrue, + postgrest-py, + realtime, + storage3, + supafunc, + httpx, + pytestCheckHook, + python-dotenv, + pytest-asyncio, + pydantic, +}: + +buildPythonPackage rec { + pname = "supabase-py"; + version = "2.16.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "supabase"; + repo = "supabase-py"; + rev = "v${version}"; + hash = "sha256-n+LVC4R9m/BKID9wLEMw/y/2I589TUXTygSIPfTZwB8="; + }; + + build-system = [ poetry-core ]; + + propagatedBuildInputs = [ + postgrest-py + realtime + gotrue + httpx + storage3 + supafunc + pydantic + ]; + + nativeBuildInputs = [ + pytestCheckHook + python-dotenv + pytest-asyncio + ]; + + pythonImportsCheck = [ "supabase" ]; + + doCheck = true; + + meta = { + homepage = "https://github.com/supabase/supabase-py"; + license = lib.licenses.mit; + description = "Supabas client for Python"; + maintainers = with lib.maintainers; [ siegema ]; + }; +} diff --git a/pkgs/development/python-modules/supafunc/default.nix b/pkgs/development/python-modules/supafunc/default.nix new file mode 100644 index 0000000000000..8ecce5f944877 --- /dev/null +++ b/pkgs/development/python-modules/supafunc/default.nix @@ -0,0 +1,40 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + poetry-core, + strenum, + httpx, + h2, +}: + +buildPythonPackage rec { + pname = "supafunc"; + version = "0.10.1"; + pyproject = true; + + src = fetchPypi { + inherit pname version; + hash = "sha256-pbM8i67La1KX0l2imiUD4uxn7mmG89RME35lG4pZoX0="; + }; + + dependencies = [ + strenum + httpx + h2 + ]; + + build-system = [ poetry-core ]; + + pythonImportsCheck = [ "supafunc" ]; + + # tests are not in pypi package + doCheck = false; + + meta = { + homepage = "https://github.com/supabase/functions-py"; + license = lib.licenses.mit; + description = "Library for Supabase Functions"; + maintainers = with lib.maintainers; [ siegema ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3c5361b6589ce..951435ebdc04a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5931,6 +5931,8 @@ self: super: with self; { gotify = callPackage ../development/python-modules/gotify { }; + gotrue = callPackage ../development/python-modules/gotrue { }; + govee-ble = callPackage ../development/python-modules/govee-ble { }; govee-led-wez = callPackage ../development/python-modules/govee-led-wez { }; @@ -14947,6 +14949,8 @@ self: super: with self; { readthedocs-sphinx-ext = callPackage ../development/python-modules/readthedocs-sphinx-ext { }; + realtime = callPackage ../development/python-modules/realtime { }; + rebulk = callPackage ../development/python-modules/rebulk { }; recipe-scrapers = callPackage ../development/python-modules/recipe-scrapers { }; @@ -16778,6 +16782,8 @@ self: super: with self; { stopit = callPackage ../development/python-modules/stopit { }; + storage3 = callPackage ../development/python-modules/storage3 { }; + stp = toPythonModule (pkgs.stp.override { python3 = self.python; }); stransi = callPackage ../development/python-modules/stransi { }; @@ -16898,6 +16904,12 @@ self: super: with self; { sunweg = callPackage ../development/python-modules/sunweg { }; + supabase = callPackage ../development/python-modules/supabase { }; + + supabase-functions = self.supafunc; + + supafunc = callPackage ../development/python-modules/supafunc { }; + superqt = callPackage ../development/python-modules/superqt { }; supervise-api = callPackage ../development/python-modules/supervise-api { };