-
Notifications
You must be signed in to change notification settings - Fork 13
packages updated #215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
packages updated #215
Conversation
This reverts commit a68ad72.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR updates package dependencies to their latest versions using uv pip compile, with a major update to Beanie (from 1.30.0 to 2.0.1) requiring API adaptations.
Key changes:
- Updated Beanie from 1.30.0 to 2.0.1, requiring migration from Motor-specific API to PyMongo API
- Removed deprecated
fetch_linksparameter and implemented manual link fetching for API key lookups - Updated multiple core dependencies including FastAPI (0.116.1 → 0.124.0), Pydantic (2.11.7 → 2.12.5), and numerous other packages
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/nsls2api/tests/conftest.py | Updated test cleanup to use get_pymongo_collection() instead of deprecated get_motor_collection() for Beanie 2.0 compatibility |
| src/nsls2api/infrastructure/security.py | Removed fetch_links parameter from find_one() call and added manual link fetching logic to resolve user relationships |
| requirements.txt | Comprehensive package updates including major version bumps for Beanie, FastAPI, Pydantic, and 40+ other dependencies |
| requirements-dev.txt | Development dependency updates including testing, linting, and development tools across 60+ packages |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
padraic-shafer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't understood why changes to get_..._collection() and fetch_links are needed.
Could you please include the rationale in the PR description?
I have removed |
|
Looks fine, but it would be good to know what |
|
padraic-shafer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updates to the collection methods are consistent with beanie 2.0 documentation.
Changes to the API key method appears to be working around a symptom of a larger issue. Namely, that motor is no longer supported in beanie 2.0, and should be replaced by pymongo.
See, e.g., #216.
I'll put this PR into draft for now, and we'll revisit it later in the Shutdown.
Commands to update the packages
Key Changes
Dependency Updates
Beanie 2.x Migration Summary
get_motor_collection()with the newget_pymongo_collection()API.fetch_links=True, as Beanie 2.x no longer supports automatic link loading.fetch_links=Truewould automatically load the linked user object for an API key.Since this is no longer available, we now manually fetch the user object using the reference ID.