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

Should __main__.py really be considered a public module? #4489

Closed
CobaltCause opened this issue May 18, 2023 · 7 comments
Closed

Should __main__.py really be considered a public module? #4489

CobaltCause opened this issue May 18, 2023 · 7 comments
Labels
docstring Related to docstring linting or formatting

Comments

@CobaltCause
Copy link

Reading this, I wouldn't think so; it seems to imply that nothing should be defined in that file and then imported elsewhere. Yet, ruff will give me such errors as D100 Missing docstring in public module in __main__.py, which I found surprising. I'm not entirely certain which behavior is correct, though.

@JonathanPlasse
Copy link
Contributor

According to pydocstyle implementation, __main__.py is public.

@CobaltCause
Copy link
Author

Looking at git blame, that code hasn't been touched since 2020-09-05. Clicking through the version history on the page I linked in the issue description, __main__.py was added in Python 3.10 which was released on 2021-10-04. So I think pydocstyle simply doesn't account for this, since that code was written before this feature existed. Maybe I should open an issue over there as well?

@charliermarsh
Copy link
Member

I think it's worth asking over there, even just to get an opinion (regardless of whether it's changed in pydocstyle).

@charliermarsh charliermarsh added question Asking for support or clarification docstring Related to docstring linting or formatting labels May 18, 2023
@CobaltCause
Copy link
Author

I've opened PyCQA/pydocstyle#644

@charliermarsh
Copy link
Member

Thanks :)

@charliermarsh charliermarsh removed the question Asking for support or clarification label Jul 10, 2023
@charliermarsh
Copy link
Member

I'm gonna close for now to keep the issue tracker actionable.

@charliermarsh charliermarsh closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2023
@CobaltCause
Copy link
Author

Looks like pydocstyle was deprecated in favor of ruff somewhat recently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docstring Related to docstring linting or formatting
Projects
None yet
Development

No branches or pull requests

3 participants