Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Disallow invalid identifiers from getting implicit bazel __init__.py - #11268

Merged
hauntsaninja merged 1 commit into
python:masterfrom
nipunn1313:testcmdlinepkgroot
Oct 4, 2021
Merged

Disallow invalid identifiers from getting implicit bazel __init__.py#11268
hauntsaninja merged 1 commit into
python:masterfrom
nipunn1313:testcmdlinepkgroot

Conversation

@nipunn1313

Copy link
Copy Markdown
Contributor

This helps unblock #9636. With namespace packages, the
code to crawl upward would not stop anywhere and would
run into temp directories with invalid module names. Normally
it would stop when it found a dir without an init.py,
but it was placing an implicit fake bazel init there.
Bazeled environments can't really have invalid module name
directories, so this should help fix.

Added tests for namespace-packages and no-namespace-packages

This helps unblock python#9636. With namespace packages, the
code to crawl upward would not stop anywhere and would
run into temp directories with invalid module names. Normally
it would stop when it found a dir without an __init__.py,
but it was placing an implicit fake bazel __init__ there.
Bazeled environments can't really have invalid module name
directories, so this should help fix.

Added tests for namespace-packages and no-namespace-packages

@hauntsaninja hauntsaninja left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, thank you!

(It looks like we only check .py files here, so we don't have to worry about xxx-stubs being an invalid identifier but valid package)

@hauntsaninja
hauntsaninja merged commit 82f767a into python:master Oct 4, 2021
@nipunn1313
nipunn1313 deleted the testcmdlinepkgroot branch October 12, 2021 23:02
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.

2 participants