Dependencies of HF spaces can be specified in requirements.txt.
When running the build (e.g., here), the docker image has a line:
RUN --mount=target=requirements.txt,source=requirements.txt pip install --no-cache-dir -r requirements.txt
that takes care of that. However, afterwards there is another line:
RUN pip install --no-cache-dir gradio[oauth]==3.9.1 spaces==0.14.0
Which essentially implies that all versions specified in requirements.txt for the packages gradio, spaces and their dependencies are useless because they are overwritten here.
In this example, gradio is set to 3.9.1 because of the YAML config in README.md but there is no way to specify the spaces version. In practice this means that I have no control over the version of spaces and its dependencies (e.g., httpcore) and all my spaces are now failing with:
File "/home/user/.local/lib/python3.8/site-packages/httpcore/_sync/http11.py", line 161, in HTTP11Connection
self, event: h11.Event, timeout: Optional[float] = None
AttributeError: module 'h11' has no attribute 'Event'
Which could normally easily be fixed by pinning httpcore==0.15. I checked past builds and spaces was also being installed there, however, the critical line was
RUN pip install --no-cache-dir gradio[oauth]==3.9.1 spaces==0.12.0
which resulted in versions that were not conflicting.
Question: How do I properly pin the version of the spaces package?