🔧 Remove command script fastapi
, let it be provided by the fastapi
package
#197
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🔧 Remove command script (entrypoint) fastapi, let it be provided by the fastapi package
Currently both
fastapi-cli
andfastapi
provide a commandfastapi
.The one in
fastapi
checks iffastapi-cli
(this package) is installed and uses it. And if there's nofastapi-cli
it tells the user that to use that command they need to installfastapi-cli
. This is to improve the developer experience, if a user installs onlyfastapi
and try to use thefastapi
command, they would see an error from their shell of "command not found" or similar, not giving them any clue that they need to also installfastapi-cli
, or better, install"fastapi[standard]"
.But then, the functionality is really provided by
fastapi-cli
, so it also declared the same commandfastapi
.This means that both the
fastapi
andfastapi-cli
declare the same command, and one would override the other. Here, that override it wouldn't be a problem as in the end it's the same functionality fromfastapi-cli
the one that would be accessed.And that behavior is, although weird, accepted in Python, mainly because
pip
(and other tools) can just override one command with the other.Nevertheless, it's problematic for Linux distributions and others that re-pack the packages to be installed as part of distro packages, and those don't support overwriting commands as here.
...plus, it's still weird and strange that two packages declare the same command and would overwrite each other, not even in a deterministic way, it's not even obvious the command of which package would be the one that ends up installed. 😅
Having in mind the developer experience, I'm leaving the command declared in
fastapi
, and removing it fromfastapi-cli
.It's also not very probable that someone would install only
fastapi-cli
, there's no reason to do it, so this should be a better default.