Skip to content

Add typing block for inspection#659

Merged
cvanelteren merged 3 commits intomainfrom
fix-typing-import
Mar 29, 2026
Merged

Add typing block for inspection#659
cvanelteren merged 3 commits intomainfrom
fix-typing-import

Conversation

@cvanelteren
Copy link
Copy Markdown
Collaborator

@cvanelteren cvanelteren commented Mar 25, 2026

This is a bit uncharted territory for me, but I believe the typing block can be used to ensure that we still have quick load time but type hinting can look at the definition of our module and functions.

New public api would need to be explicitly added here to ensure that it does not break inspection.

Closes #655

@cvanelteren
Copy link
Copy Markdown
Collaborator Author

@anirudhkrishnan2718 this should work I think.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 95.23810% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ultraplot/tests/test_imports.py 95.12% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@anirudhkrishnan2718
Copy link
Copy Markdown

Once these changes are merged, can I install the current version of the repository or do I need to wait for an official release?
I am guessing there is some way to install a 'nightly' version of ultraplot that does not require a new version to be released onto conda-forge.

@cvanelteren
Copy link
Copy Markdown
Collaborator Author

You can pip install directly any branch from git from pip -- or clone it and do a pip install -e

pyproject.toml Outdated

[tool.basedpyright]
exclude = ["**/*.ipynb"]
stubPath = ""
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Don't think this is necessary: first tried generating stubs with pyright but that did not work.

@cvanelteren cvanelteren requested review from beckermr and gepcel March 25, 2026 04:41
Copy link
Copy Markdown
Collaborator

@gepcel gepcel left a comment

Choose a reason for hiding this comment

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

I don't know much about the mechanisms of Pyright and Mypy, but this seems like a very smart and clever way to handle it.

@cvanelteren
Copy link
Copy Markdown
Collaborator Author

Me neither. This is what I gathered from stackoverflow. Normally these packages would just import things or provide a .pyi file but we can't do that as it is hidden behind when code is actually used and imported.

@cvanelteren cvanelteren enabled auto-merge (squash) March 29, 2026 08:32
@cvanelteren cvanelteren merged commit 7ee8d4e into main Mar 29, 2026
19 checks passed
@cvanelteren cvanelteren deleted the fix-typing-import branch March 29, 2026 08:38
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