Upgrade runtime dependencies and harden Google Lens response parsing - #6
Merged
Merged
Conversation
Copilot created this pull request from a session on behalf of
krishna2206
July 22, 2026 04:36
View session
krishna2206
marked this pull request as ready for review
July 22, 2026 04:36
There was a problem hiding this comment.
Pull request overview
This PR updates runtime dependency minimums and makes the Google Lens prerender parsing + request flow more resilient by adding safer traversal, explicit parse failures, context-managed file IO, and request timeouts.
Changes:
- Bumped dependency minimums in both
requirements.txtandsetup.py(requests>=2.34.2,beautifulsoup4>=4.15.0). - Reworked prerender extraction/parsing to avoid fragile chained indexing by introducing a safe nested accessor and clearer parse errors.
- Improved request/file handling by ensuring uploaded files are closed and adding timeouts to HTTP calls.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Updates install requirements to minimum pinned versions. |
| requirements.txt | Aligns runtime dependency minimums with setup.py. |
| googlelens/googlelens.py | Hardens prerender parsing, adds safe accessors, and adds timeouts + context-managed file IO. |
| google_lens_python.egg-info/top_level.txt | Adds generated setuptools artifact. |
| google_lens_python.egg-info/SOURCES.txt | Adds generated setuptools artifact listing package sources. |
| google_lens_python.egg-info/requires.txt | Adds generated setuptools artifact for dependencies. |
| google_lens_python.egg-info/PKG-INFO | Adds generated setuptools metadata artifact. |
| google_lens_python.egg-info/dependency_links.txt | Adds generated setuptools artifact. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return prerender_script['data'][1] | ||
|
|
||
| @staticmethod | ||
| def __safe_get(value: Any, path: list[int]) -> Any: |
Comment on lines
+167
to
+170
| multipart = { | ||
| 'encoded_image': (file_path, image_file), | ||
| 'image_content': '' | ||
| } |
Comment on lines
+1
to
+5
| README.md | ||
| setup.py | ||
| google_lens_python.egg-info/PKG-INFO | ||
| google_lens_python.egg-info/SOURCES.txt | ||
| google_lens_python.egg-info/dependency_links.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This updates the project’s dependency baseline and improves resilience in the Google Lens parsing path. The API surface remains unchanged while reducing failure modes from malformed/shifted upstream response structures.
Dependency baseline
requests>=2.34.2beautifulsoup4>=4.15.0requirements.txtandsetup.pyso install paths resolve the same dependency set.Parser hardening
match,similar) while making extraction tolerant to partial/missing fields.Request/file handling quality