-
Notifications
You must be signed in to change notification settings - Fork 3
Handle the case where the is no resolver #305
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?
Conversation
We might need to add few tests to keep the coverage high, but looks good to me |
3e67ac5
to
0f9e1af
Compare
Done! Let me know if that needs any tweaks. |
0f9e1af
to
502e501
Compare
Addressed the line-too-long lint error |
Some python packages, e.g. pytz, are purely written in python and do not have any other dependencies. In those cases, a `resolver` is not set on the compiler, causing `AttributeError` exceptions in various places. This commit performs a `None` check on the `resolver` attribute before proceeding to access nested attributes. Fixes: hermetoproject#304 Signed-off-by: Luiz Carvalho <[email protected]>
502e501
to
c2d6ebe
Compare
WalkthroughThe changes update the dependency compilation script to add explicit checks for the presence of a resolver object before accessing its attributes or methods, preventing possible Changes
Sequence Diagram(s)sequenceDiagram
participant Tester as test_compile_package_without_dependencies
participant CLI as pybuild-deps CLI
participant Compiler as compile.py
participant Resolver as compiler.resolver
Tester->>CLI: Invoke compile command
CLI->>Compiler: Run compile logic
Compiler->>Compiler: Check if compiler.resolver is not None
alt resolver exists
Compiler->>Resolver: Access resolver attributes/methods
else resolver is None
Compiler->>Compiler: Skip resolver-dependent logic
end
Compiler->>CLI: Write output, exit
CLI->>Tester: Return exit code 0
Assessment against linked issues
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code Graph Analysis (1)src/pybuild_deps/scripts/compile.py (1)
🔇 Additional comments (4)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Some python packages, e.g. pytz, are purely written in python and do not have any other dependencies. In those cases, a
resolver
is not set on the compiler, causingAttributeError
exceptions in various places.This commit performs a
None
check on theresolver
attribute before proceeding to access nested attributes.Fixes: #304
Summary by CodeRabbit
Bug Fixes
Tests