Skip to content

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

Merged
csmarchbanks merged 3 commits into
prometheus:masterfrom
angusholder:fix-go-to-declaration
Jan 18, 2022
Merged

csmarchbanks merged 3 commits into
prometheus:masterfrom
angusholder:fix-go-to-declaration

Conversation

@angusholder

@angusholder angusholder commented Jan 13, 2022 •

Copy link
Copy Markdown
Contributor

@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>
@angusholder
angusholder force-pushed the fix-go-to-declaration branch from 1c17c8c to b6209f3 Compare January 13, 2022 22:45

@csmarchbanks csmarchbanks left a comment

Copy link
Copy Markdown
Member

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.

Comment thread prometheus_client/__init__.py Resolved

@csmarchbanks csmarchbanks left a comment

Copy link
Copy Markdown
Member

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.

2 participants