KEMBAR78
Fix stubgen breakage by msullivan · Pull Request #5673 · python/mypy · GitHub
Skip to content

Conversation

@msullivan
Copy link
Collaborator

Add '' back to sys.path when running stubgen

When run as a script, stubgen's sys.path won't contain the current
directory, but stubgen needs to be able to run on modules in the
current directory.

Fixes #4571.

When run as a script, stubgen's sys.path won't contain the current
directory, but stubgen needs to be able to run on modules in the
current directory.

Fixes #4571.
@emmatyping
Copy link
Member

Hm, I'm not sure this fixes the problem. IIRC if you run stubgen recursively it will not pick up the children packages. Have you tested this with the --recursive flag?

@msullivan
Copy link
Collaborator Author

--recursive appears to work.

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

Is it worth also checking for ‘.’ and getcwd()? Probably not, it’s no big sin to have the same directory twice on sys.path.

@msullivan
Copy link
Collaborator Author

Yeah, that's my theory. No reason to add complication that won't change behavior in an important way.

@msullivan msullivan merged commit b622111 into master Sep 26, 2018
@msullivan msullivan deleted the stubgen-script-fix branch September 26, 2018 01:06
@emmatyping
Copy link
Member

Great, glad this was fixed!

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