-
Notifications
You must be signed in to change notification settings - Fork 861
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
Py.typed #1685
Py.typed #1685
Conversation
- Explicit `check=False` - Sort functions in their call order - Use Pathlib for paths
return sys.prefix | ||
|
||
return "" | ||
from pathlib import Path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are explicitly not using pathlib
because it's slower to import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you revert those changes?
strongly discouraged to import from our `uv` Python module, but you can do so at your | ||
own risk. | ||
""" | ||
from uv.__main__ import detect_virtualenv, find_uv_bin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not import then from __main__
, let's do it the other way around (define them here and import them there).
I think detect_virtualenv
should remain private as well.
The Python API of `uv` is not guaranteed to be stable and may chance at any time. It is | ||
strongly discouraged to import from our `uv` Python module, but you can do so at your | ||
own risk. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Python API of `uv` is not guaranteed to be stable and may chance at any time. It is | |
strongly discouraged to import from our `uv` Python module, but you can do so at your | |
own risk. | |
The Python API of `uv` is not guaranteed to be stable and may change at any time. |
Fixed a typo and this seems sufficient. I was only strongly discouraging people from importing from __main__
.
Superseded by #1728 |
Suggested implementation for #1677
Summary
Add
py.typed
+ cautionary docstring.Importing these functions is discouraged, but not prohibited: users can do so at their own risk.
Included some best practices in the Python part, we should set the right example !
Atomic commits, see commit message for details.
Test Plan