Repository navigation
Handle dict dependency versions in Dart pubspec parsing - #5488
Open
sujalgiriiitp-source wants to merge 1 commit into
Open
sujalgiriiitp-source wants to merge 1 commit into
sujalgiriiitp-source wants to merge 1 commit into
Conversation
Fixes aboutcode-org#5482 Signed-off-by: Sujal Giri <sujalgiriiitp@gmail.com>
This branch has not been deployed
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.
Bug: Dart pubspec parsing aborted with
AttributeError: 'dict' object has no attribute 'replace'when apathdependency dict (e.g._json_serial_shared_test: {path: ../shared_test}) appeared indev_dependencies—build_dep()insrc/packagedcode/pubspec.pyassumedversionis always a string, so the whole parse returned 0 packages.Fix: dict versions are stringified generically (generalizing the existing
sdkcase — e.g.path: ../shared_test), and non-string scalar versions are coerced tostr.Verification: the real
json_serializable6.15.2 pubspec (from pub.dev) now parses to 1 package + 24 dependencies; a scan of the extracted tarball contents returns thejson_serializable6.15.2 package.tests/packagedcode/test_pubspec.py: 13 passed (12 existing + 1 new datadriven test from the added regression fixturedeps-versions-path-git-hosted-pubspec.yaml, coveringpath/git/hostedmappings). Note: a CLI scan of the.tar.gzfile itself still returns 0 packages in the test environment because that ScanCode build doesn't auto-extract archives during scan — pre-existing environment behavior, unrelated to the parser; directextractcodeextraction works.Fixes #5482
Signed-off-by: Sujal Giri sujalgiriiitp@gmail.com