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

Change to imports to fix go-to-declaration in editors #747

Merged
merged 3 commits into from Jan 18, 2022

Conversation

angusholder
Copy link
Contributor

@angusholder angusholder commented Jan 13, 2022

@csmarchbanks Just a small tweak to improve how prometheus_client behaves with IDEs/editors:

In PyCharm, when ctrl-clicking functions/classes of this library to go to their declaration, it takes me to prometheus_client/__init__.py instead of where the function/class was actually defined. This seems to happen because __init__.py uses assignments instead of imports to re-export members, so I've changed them all to imports.

Signed-off-by: Angus Holder <aholder97@gmail.com>
Signed-off-by: Angus Holder <aholder97@gmail.com>
… the entrypoint of the library!

Signed-off-by: Angus Holder <aholder97@gmail.com>
Copy link
Member

@csmarchbanks csmarchbanks left a comment

Choose a reason for hiding this comment

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

Thanks! Just one small comment.

prometheus_client/__init__.py Show resolved Hide resolved
Copy link
Member

@csmarchbanks csmarchbanks left a comment

Choose a reason for hiding this comment

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

Thanks!

@csmarchbanks csmarchbanks merged commit da15e4a into prometheus:master Jan 18, 2022
@angusholder angusholder deleted the fix-go-to-declaration branch January 19, 2022 19:15
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

2 participants