Skip to content
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

Fix #2, modernize and support plain import #3

Merged
merged 4 commits into from
Dec 10, 2023
Merged

Fix #2, modernize and support plain import #3

merged 4 commits into from
Dec 10, 2023

Conversation

Pike
Copy link
Owner

@Pike Pike commented Nov 28, 2023

Quite a bit of stuff from back then changed.

Also add support for regular import foo.bar, and, well, tests.

@Pike Pike self-assigned this Nov 28, 2023
@Pike Pike closed this Nov 28, 2023
@Pike Pike reopened this Nov 28, 2023
@Pike
Copy link
Owner Author

Pike commented Nov 28, 2023

@altendky , do you feel like taking a look at this?

Copy link

@altendky altendky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unlikely to get to a detailed review here, but did scan through it quickly and left a couple minor comments.

class IdentVisitor(ast.NodeVisitor):
def __init__(self, path, ident, callback):
class IdentVisitor:
def __init__(self, ident: str):
super(IdentVisitor, self).__init__()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In so much as you want to keep this around, this fits into a 2->3 conversion pattern. I think technically everything should super init, but we usually don't bother...

Suggested change
super(IdentVisitor, self).__init__()
super().__init__()

yield (path, *t)


def main():

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to make pygrep 'more runnable', you may want a pygrep/__main__.py. That's what would be run for python -m pygrep, for example. It could consist of nothing more than import pygrep; pygrep.main().

@Pike Pike merged commit 8bffd7f into main Dec 10, 2023
4 checks passed
@Pike Pike deleted the renovate branch December 10, 2023 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

i seemingly have to check asyncio.create_task and create_task.asyncio to catch more of them
2 participants