-
Notifications
You must be signed in to change notification settings - Fork 10
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
Reducing dependencies #259
Comments
Note, this is the whole
|
Additional note, if Prez adds the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I notice Shapely is listed in the dependencies of Prez.
One big issue with having Shapely as a dependency is shapely subsequently depends on Numpy, which is a very large dependency and often needs to be compiled on installation (if the target platform does not use binary wheels).
After searching through the codebase, I see Shapely is only used in one location, that is to convert
cql
->Polygon
->wkt
String.I recently made a PR in the rdf2geojson repo to replace the use of Shapely with a vendorised copy of GeoMet.
Kurrawong/rdf2geojson#1
Note, it is vendorised so we can use it without the sub-dependency on "click", that we don't need. As well as applying some out-of-tree patches to fix multiple WKT serialization errors.
GeoMet is pure-python, is (relatively) small and is great at converting from GeoJSON to WKT and back again (and some other formats). It is compatible with the Python Geo Interface convention (
__geo_interface__
) so should work for our use case in Prez.Secondly,
uvicorn
is included as a non-optional requirement in the dependencies list. Again, the main issue is the sub-dependency onuvloop
that again is a rather large dependency that also often needs to be compiled on installation (if the target platform does not use binary wheels).Those who are familiar with the codebase will know that
uvicorn
is used in exactly one place in the codebase, that is at the bottom ofmain.py
, if you are runningprez
as a standalone application it will spawnuvicorn
to run the app.There are lots of other ways of running the FastAPI ASGI app other than uvicorn (eg, in a Azure Function App, a AWS Lambda app, Apache ASGI wrapper, another ASGI runner like hypercorn or daphne). So I believe
uvicorn
should be an optional dependency, because not everyone is going to want Prez to supply its own server.The motivation for these changes is to reduce the size of the
requirements.txt
file generated by poetry:This is used when generating the requirements for building the Azure Function App bundle, and I feel the total built bundle size could be smaller.
The text was updated successfully, but these errors were encountered: