ollama / ollama-python

Ollama Python library
https://ollama.com
MIT License
2.71k stars 223 forks source link

Loosen httpx constraint #97

Closed balloob closed 3 months ago

balloob commented 3 months ago

This loosens the httpx constraint to allow any version <1. I have pinned httpx as a dev dependency to the latest version of httpx (0.27.0) so tests don't just start breaking one day.

Pinning dependencies in a library forces downstream consumers to follow the requirements of the library. In the case of Home Assistant, this is not compatible as Home Assistant aggressively follows the latest version of httpx.

Unblocks https://github.com/home-assistant/core/pull/113962

Replaces #42

balloob commented 3 months ago

@mxyng sorry for the ping. We're preparing a new Home Assistant release this Wednesday and would like to include an Ollama integration (https://github.com/home-assistant/core/pull/113962), but it depends on this PR. Would you have time today or tomorrow to take a look? Thanks!

mxyng commented 3 months ago

Setting this kind of constraint on a project pre-1.0 is risky since semantic versions are undefined at that stage. It's entirely possible (though unlikely) httpx==0.28.0 includes a breaking change. It would be better to keep httpx (and any other runtime dependencies) up to date than to have such a broad version requirement

balloob commented 3 months ago

The risk can be avoided by the user to pin httpx to the version that they want and/or need for their application. This shouldn't be determined by one of their dependencies. What if another dependency had another opinion!

For anyone interested in this feature, we are maintaining a fork with the loosened httpx constraint.