-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Expose find_uv_bin and declare typing support #1728
Expose find_uv_bin and declare typing support #1728
Conversation
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
|
||
def detect_virtualenv() -> str: | ||
|
||
def _detect_virtualenv() -> str: |
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.
Marked this as private explicitly 👍 because by default in Python anything that's no prohibited (at least by convention in case of _
) is allowed.
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.
Do we have tests for these files? I don't see any Python test harness just yet 🤔
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.
Nope. We should probably pip install uv
and python -m uv
smoke test in CI when we build wheels for releases? We could track this separately.
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 could also probably install directly e.g. uv pip install -e ./python/uv
and then test in the "Smoke test" step?
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.
Yeah, agreed, though likely should be a separate PR 😊 Up to you if you want to wait for this until that lands.
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.
Feel free to put that up if you're interested! :) unless we get to it first
Thanks for contributing! This is a duplicate of #1685 but there were some problems there and this looks correct to me. |
|
||
|
||
if __name__ == "__main__": | ||
def _run() -> None: |
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.
By moving such logic into a private _run
method, we avoid exposing all global variables as publicly import-able by anyone.
Resolves #1677