From 8ec98cd3cc2be7675149589d237e98eacb8ed390 Mon Sep 17 00:00:00 2001 From: Rachel Mackintosh <148898879+rachel-mack@users.noreply.github.com> Date: Mon, 16 Jun 2025 15:10:33 -0400 Subject: [PATCH 1/5] Update app.py --- app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index eb34a38..67fbfa2 100644 --- a/app.py +++ b/app.py @@ -9,7 +9,8 @@ from typing_extensions import Annotated from bson import ObjectId -import motor.motor_asyncio +import asyncio +from pymongo import AsyncMongoClient from pymongo import ReturnDocument @@ -17,7 +18,7 @@ title="Student Course API", summary="A sample application showing how to use FastAPI to add a ReST API to a MongoDB collection.", ) -client = motor.motor_asyncio.AsyncIOMotorClient(os.environ["MONGODB_URL"]) +client = AsyncMongoClient(os.environ["MONGODB_URL"]) db = client.college student_collection = db.get_collection("students") From 1afad932f6beee5953c7fa605c0e4c7fae67343e Mon Sep 17 00:00:00 2001 From: Rachel Mackintosh <148898879+rachel-mack@users.noreply.github.com> Date: Mon, 16 Jun 2025 15:11:58 -0400 Subject: [PATCH 2/5] Update requirements.txt --- requirements.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 9bf9d19..2507499 100644 --- a/requirements.txt +++ b/requirements.txt @@ -24,8 +24,6 @@ idna==3.4 # via # anyio # email-validator -motor==3.3.1 - # via -r requirements.in pydantic==2.6.3 # via # -r requirements.in From 97ab4faf0fe7b3706709ea430e34dc63c3fa6735 Mon Sep 17 00:00:00 2001 From: Rachel Mackintosh <148898879+rachel-mack@users.noreply.github.com> Date: Mon, 16 Jun 2025 15:12:15 -0400 Subject: [PATCH 3/5] Update requirements.in --- requirements.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.in b/requirements.in index 113d9d3..72d2551 100644 --- a/requirements.in +++ b/requirements.in @@ -1,4 +1,4 @@ fastapi ~=0.110 -motor ~=3.3 +pymongo ~=4.13 uvicorn ~=0.28 -pydantic[email] \ No newline at end of file +pydantic[email] From ad2600e01b2487f84024d1c5fdee3e31cf75d996 Mon Sep 17 00:00:00 2001 From: Rachel Mackintosh <148898879+rachel-mack@users.noreply.github.com> Date: Mon, 16 Jun 2025 15:13:43 -0400 Subject: [PATCH 4/5] remove dev-req files --- dev-requirements.in | 3 --- dev-requirements.txt | 42 ------------------------------------------ 2 files changed, 45 deletions(-) delete mode 100644 dev-requirements.in delete mode 100644 dev-requirements.txt diff --git a/dev-requirements.in b/dev-requirements.in deleted file mode 100644 index b16298f..0000000 --- a/dev-requirements.in +++ /dev/null @@ -1,3 +0,0 @@ -requests -pytest -pip-tools \ No newline at end of file diff --git a/dev-requirements.txt b/dev-requirements.txt deleted file mode 100644 index 8b77d72..0000000 --- a/dev-requirements.txt +++ /dev/null @@ -1,42 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# pip-compile --strip-extras dev-requirements.in -# -build==1.1.1 - # via pip-tools -certifi==2023.7.22 - # via requests -charset-normalizer==3.3.1 - # via requests -click==8.1.7 - # via pip-tools -idna==3.4 - # via requests -iniconfig==2.0.0 - # via pytest -packaging==23.2 - # via - # build - # pytest -pip-tools==7.4.1 - # via -r dev-requirements.in -pluggy==1.3.0 - # via pytest -pyproject-hooks==1.0.0 - # via - # build - # pip-tools -pytest==7.4.3 - # via -r dev-requirements.in -requests==2.31.0 - # via -r dev-requirements.in -urllib3==2.0.7 - # via requests -wheel==0.42.0 - # via pip-tools - -# The following packages are considered to be unsafe in a requirements file: -# pip -# setuptools From c1abbd29f23b221c5840a5ce5b0b6a70c7da3722 Mon Sep 17 00:00:00 2001 From: Rachel Mackintosh <148898879+rachel-mack@users.noreply.github.com> Date: Mon, 16 Jun 2025 16:35:04 -0400 Subject: [PATCH 5/5] update pymongo version --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2507499..56e7967 100644 --- a/requirements.txt +++ b/requirements.txt @@ -30,7 +30,7 @@ pydantic==2.6.3 # fastapi pydantic-core==2.16.3 # via pydantic -pymongo==4.5.0 +pymongo==4.13.1 # via motor sniffio==1.3.0 # via anyio