-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Simpler CLI targets #2700
Simpler CLI targets #2700
Conversation
I have a feeling that this is too ambiguous. Many things could be either module or path, e.g.
Maybe with stronger heuristics for the corner cases, combined with Path(...).exists(). For improving usability, it might also be useful to check by default for |
Yes, it already does these things.
This would assume people use |
FTR, passing a file will not work. Only a directory. |
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #2700 +/- ##
=============================================
- Coverage 88.912% 88.673% -0.240%
=============================================
Files 92 87 -5
Lines 7017 6860 -157
Branches 1196 1180 -16
=============================================
- Hits 6239 6083 -156
- Misses 533 536 +3
+ Partials 245 241 -4
... and 13 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Doing a full review later. The logic is quite complicated and needs some more thought to see that it handles all use cases correctly. |
This simplifies the CLI experience, but should continue to work as it currently does.
Currently, to serve a directory:
And, a factory:
Without the
--simple
or--factory
flags it would fail. This PR will look at the targets passed. If it is a directory, then launch simple server. If it is a function, try calling it.These are now all possible:
The main motivation behind this is the ongoing discussion to encourage the CLI usage more and more.