-
Notifications
You must be signed in to change notification settings - Fork 772
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
How to run a library module? #6638
Comments
I believe that'd be simply uv run python -m mylibrary.module |
Thanks! That's what I have been using. It's a bit confusing because there is no parallel for |
We could consider adding |
I think we should document this. I'm not sure we should provide a shorthand yet... but it does seem kind of nice? |
One downside to the |
In that case, your module is defined in a script? |
Some are in scripts, others are in folders with a |
My package has several command line tools that are invoked via
I have 3 more under development. I was hoping that I could do Please consider adding |
|
Unless someone can think of another use for the cc @konstin |
Is the |
I don't think implicit behavior is great when executing things, for safety and security reasons. Why not expose script entry points for your modules? https://docs.astral.sh/uv/concepts/projects/#defining-entry-points |
I agree with the safety aspect in principle, but in this specific case the user already has explicitly said they are trying to run the provided parameters. Adding more hoops to jump through will just be annoying. The problem with |
Fair, but note this isn't the case unless you install the project globally or activate the virtual environment — both of which are not necessary with |
My project is installed globally on a large number of Linux/BSD distros. I'm left with two choices:
|
I don't have a preference on the solution implementation, as long as the interface is as friendly as |
Okay thanks for your feedback. @j178 do you see a problem with just doing |
Seems working 😆 #7754 |
What is the recommended way for running a library module like I would do in vanilla python with the
-m
flag.E.g.
The text was updated successfully, but these errors were encountered: