-
Notifications
You must be signed in to change notification settings - Fork 91
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
feat/python guess inside ifstat #240
feat/python guess inside ifstat #240
Conversation
Before this gets merged, we should probably ensure that upm acknowledges poetry dependency groups. I don't know if it's worth attempting to guess alternative names for I don't think |
i think as long as we support other dependency groups with poetry it should be fine. i think the majority of repls use poetry |
internal/backends/python/grab.go
Outdated
] | ||
) | ||
(import_from_statement | ||
module_name: (dotted_name) @import) |
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.
module_name: (dotted_name) @import) | |
module_name: (dotted_name) @import) |
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.
please reformat with standard lisp formatting - this formatting is usually easier for the author to read but harder for others to read 😅
pkgs.python311Full | ||
pkgs.python311Packages.pip |
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.
sanity check: the if cond: import thing
syntax works with all 3.x right?
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.
Since before 2.7 afaik
Open to any suggestion as to how to make maintaining query formatting easier. Are there standard formatters you recommend for folk that don't know what "standard lisp formatting" looks like? |
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.
lgtm!
Why
It's reasonably common for Python libraries to include gate imports behind
if
,def
, andtry
statements. Let's try addingif
/elif
/else
and see whether this is even a direction we want to proceed with.What changed
Altered query to reflect the
if_statement
structure. Extended test to cover this new case.Test plan
See whether imports gated behind
if
statements are caught byupm guess