Skip to content

fix(util): replace string parsing with AST in inspect_without_import - #472

Draft
MoralCode wants to merge 4 commits into
mainfrom
guptapratykshh/fix/issue-3504-ast-parsing
Draft

MoralCode wants to merge 4 commits into
mainfrom
guptapratykshh/fix/issue-3504-ast-parsing

Conversation

@MoralCode

@MoralCode MoralCode commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Note

This PR was ported from augurlabs/augur#3514 filed by @guptapratykshh because the contribution was deemed to still be useful.

Description

  • Replaced the string parsing logic in augur/util/inspect_without_import.py with the ast module to robustly extract phase function names from start_tasks.py.
  • Added a new test suite in tests/test_util/test_inspect_without_import.py to verify the fix and ensure it handles various edge cases (indentation, decorators, multi-line definitions).
  • Updated comments and docstrings to be more human-readable and concise.

This PR fixes #161

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

guptapratykshh and others added 4 commits September 14, 2026 14:42
…#3504

Signed-off-by: Pratyksh Gupta <pratykshgupta9999@gmail.com>
Signed-off-by: guptapratykshh <pratykshgupta9999@gmail.com>
Signed-off-by: guptapratykshh <pratykshgupta9999@gmail.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
…rsion of the code

Signed-off-by: Adrian Edwards <adredwar@redhat.com>
import ast
import os
import tempfile
import pytest

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
W0611: Unused import pytest (unused-import)

@MoralCode MoralCode changed the title Guptapratykshh/fix/issue 3504 ast parsing fix(util): replace string parsing with AST in inspect_without_import Sep 14, 2026
@MoralCode

Copy link
Copy Markdown
Contributor Author
  • needs check for any legacy variable/project names

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.

Consider replacing string parsing with ast

2 participants