summary refs log tree commit diff
path: root/pkgs/development/python-modules/fastapi/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/fastapi/default.nix')
-rw-r--r--pkgs/development/python-modules/fastapi/default.nix38
1 files changed, 29 insertions, 9 deletions
diff --git a/pkgs/development/python-modules/fastapi/default.nix b/pkgs/development/python-modules/fastapi/default.nix
index c90b64dca81..75edf5dc424 100644
--- a/pkgs/development/python-modules/fastapi/default.nix
+++ b/pkgs/development/python-modules/fastapi/default.nix
@@ -1,22 +1,28 @@
 { lib
 , buildPythonPackage
-, fetchPypi
+, fetchFromGitHub
 , uvicorn
 , starlette
 , pydantic
-, python
 , isPy3k
-, which
+, pytest
+, pytestcov
+, pyjwt
+, passlib
+, aiosqlite
 }:
 
 buildPythonPackage rec {
   pname = "fastapi";
-  version = "0.42.0";
+  version = "0.45.0";
+  format = "flit";
   disabled = !isPy3k;
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "48cb522c1c993e238bfe272fbb18049cbd4bf5b9d6c0d4a4fa113cc790e8196c";
+  src = fetchFromGitHub {
+    owner = "tiangolo";
+    repo = "fastapi";
+    rev = version;
+    sha256 = "1qwh382ny6qa3zi64micdq4j7dc64zv4rfd8g91j0digd4rhs6i1";
   };
 
   propagatedBuildInputs = [
@@ -25,10 +31,24 @@ buildPythonPackage rec {
     pydantic
   ];
 
-  patches = [ ./setup.py.patch ];
+  checkInputs = [
+    pytest
+    pytestcov
+    pyjwt
+    passlib
+    aiosqlite
+  ];
+
+  # starlette pinning kept in place due to 0.12.9 being a hard
+  # dependency luckily fastapi is currently the only dependent on
+  # starlette. Please remove pinning when possible
+  postPatch = ''
+    substituteInPlace pyproject.toml \
+      --replace "pydantic >=0.32.2,<=0.32.2" "pydantic"
+  '';
 
   checkPhase = ''
-    ${python.interpreter} -c "from fastapi import FastAPI; app = FastAPI()"
+    pytest --ignore=tests/test_default_response_class.py
   '';
 
   meta = with lib; {