emmett-framework / granian

A Rust HTTP server for Python applications
BSD 3-Clause "New" or "Revised" License
2.67k stars 79 forks source link

Make the watchfiles dependency optional #202

Closed bluetech closed 7 months ago

bluetech commented 7 months ago

Granian depends on the watchfiles Python package for the --reload (reload on file changes) feature. This feature is helpful for local development, but is not needed on production (at least that I know of!).

The watchfiles package brings in the following extra packages to the granian dependency closure:

To reduce the dependencies in production, I propose making watchfiles optional:

I can implement this if it sounds good.

gi0baro commented 7 months ago

Sounds reasonable to me, I'll be happy to accept a PR for this. The only thing I would change in your plan is to name the extra reload instead of watch just to be more consistent.