Refactor imports: organize and add noqa comments for clarity#6
Merged
Conversation
Fix 25 lint errors: import sorting (I001), multi-imports (E401), camelcase import aliases (N814), line-too-long (E501), and unused variable (F841). https://claude.ai/code/session_01TekPoY1vxh8UTY4TsSs1Fg
- Mock magic_pdf import in test_is_available_when_installed since magic_pdf is not installed in CI test environment - Relax processing_time_ms assertion from > 0 to >= 0 in Firecrawl test since mocked API calls can complete in under 1ms https://claude.ai/code/session_01TekPoY1vxh8UTY4TsSs1Fg
On Windows, NamedTemporaryFile keeps the file handle open inside the with block, preventing os.unlink from deleting it. Move the try/finally cleanup outside the with block so the file is closed before processing and deletion. https://claude.ai/code/session_01TekPoY1vxh8UTY4TsSs1Fg
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.
Summary
This PR refactors import statements across multiple engine files and test files to improve code organization and readability. The changes follow PEP 8 import ordering conventions and add noqa comments where appropriate to suppress linting warnings for intentional naming patterns.
Key Changes
Test files (
tests/engines/test_adapters.py):result = await e.process(...)→await e.process(...))Engine files:
nougat_engine.py: Reordered imports to group stdlib, third-party, and local imports separately with proper spacingmineru_engine.py: Added# noqa: N814comments to aliased imports using uppercase naming convention (e.g.,_SPM,_FBDW,_PDD) to suppress naming style warnings; reordered imports in_run_minerumethodmarker_local_engine.py: Renamed import alias from_PCto_PdfConverterfor clarity and added# noqa: N814commentsurya_engine.py: Alphabetically sorted imports from the same module (get_page_images, open_pdf)Notable Details
https://claude.ai/code/session_01TekPoY1vxh8UTY4TsSs1Fg