Skip to content

Replace rewrite_imports with map_imports - #98

Merged
anuraaga merged 1 commit into
bufbuild:mainfrom
anuraaga:map-imports
Sep 15, 2026
Merged

anuraaga merged 1 commit into
bufbuild:mainfrom
anuraaga:map-imports

Conversation

@anuraaga

Copy link
Copy Markdown
Collaborator

Basically bufbuild/protobuf-es#1528 for Python.

Since we didn't have rewrite_imports here for a while I think it's ok to replace it sooner than later.

return None


def _glob_to_regex(pattern: str) -> re.Pattern[str]:

@jonbodner-buf jonbodner-buf Sep 14, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Wish we could! But glob.translate is from Python 3.13, several versions above our floor, and fnmatch is only single-level * support, not recursive **

@jonbodner-buf jonbodner-buf left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

One question

@anuraaga
anuraaga merged commit d4d85ec into bufbuild:main Sep 15, 2026
43 checks passed
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.

3 participants