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 doc8 RuntimeWarning #437

Merged
merged 1 commit into from
Jan 27, 2024

Conversation

ITProKyle
Copy link
Contributor

@ITProKyle ITProKyle commented Dec 15, 2023

resolves RuntimeWarning: 'doc8.main' found in sys.modules after import of package 'doc8', but prior to execution of 'doc8.main'; this may result in unpredictable behaviour by changing doc8 execution from "doc8.main" to "doc8".

image

The above screenshot shows this warning being reported in PROBLEMS.

The warning is caused by doc8.__init__ importing doc8.main resulting in python -m doc8.main causing the import to happen twice. python -m doc8 resolves this as doc8.__main__ implements the execution of doc8.main when called this way.


Note I was unable to get yarn run pretest && yarn run test to run locally so relying on GitHub actions to perform tests and show me what else needs to be updated.

resolves "RuntimeWarning: 'doc8.main' found in sys.modules after import of package 'doc8', but prior to execution of 'doc8.main'; this may result in unpredictable behaviour" by changing doc8 execution from "doc8.main" to "doc8"
@CLAassistant
Copy link

CLAassistant commented Dec 15, 2023

CLA assistant check
All committers have signed the CLA.

@ITProKyle ITProKyle marked this pull request as ready for review December 15, 2023 17:37
@lextm
Copy link
Member

lextm commented Dec 20, 2023

This warning only occurs after a certain doc8 version upgrade. So this pull request should add version check before being merged.

@ITProKyle
Copy link
Contributor Author

Looks like doc8.__main__ was added in 0.8.1 4 years ago. Unfortunately my knowledge of this project and ts/js in generally is insufficient to do much more than a simple edit like this.

@lextm
Copy link
Member

lextm commented Dec 21, 2023

@ITProKyle That's already tremendous help. Thanks.

@lextm lextm merged commit 44c04ea into vscode-restructuredtext:master Jan 27, 2024
7 checks passed
@lextm
Copy link
Member

lextm commented Jan 27, 2024

This has been merged and shipped in latest preview 190.1.19.

@ITProKyle ITProKyle deleted the fix/doc8-warning branch February 12, 2024 14:05
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.

None yet

3 participants