← Back to TIL

Using `uv` to exclude dependencies newer than a specified date

This can be done either:

in the pyproject.toml

https://docs.astral.sh/uv/reference/settings/#exclude-newer

[tool.uv]
exclude-newer = "2006-12-02"
# /// script
# dependencies = [
#   "requests",
# ]
# [tool.uv]
# exclude-newer = "2023-10-16T00:00:00Z"
# ///

import requests

print(requests.__version__)