Closed ZeroIntensity closed 6 months ago
As this API comes near to being on the master branch, it should be noted that preinstalling dependencies (i.e., putting view's dependencies in the pyproject.toml
) should be preferred over leveraging the conditional installation API at runtime.
This feature is meant generally to help with the batteries-detachable philosophy. For example, in #118, if something from ReactPy
were to be needed, it would be installed via this API, but some sort of parser library (in the context of view.py, ujson would be a good example) for use in parsing requests, would be listed as a dependency in pyproject.toml
and not something to be used via this API.
There is a chance that this will be deprecated in the future. It's not exactly View's place to start taking pip's job, so possibly just something like pip install view.py[react]
would be a better solution.
However, before this has any chance of being marked for removal, a better system for managing dependencies should be created in View. Possibly something like a view dep
command that messes with the pyproject.toml
?
See RFC 1 #122
Improvement Description
View has several dependencies that are only used for niche features. View could install these conditionally based on the configuration. For example, if the database (unfinished but see #10) is
postgres
, view.py will then leveragepip
and install the driver. If not, it remains uninstalled, as it seems silly to have dependencies that not all users need. Originally,attempt_import
addressed this issue but that proved to be buggy and a headache.This may also introduce a
dependencies
andauto_install
setting in the configuration.Improvement Request Example API
Anything else?
No response