Skip to content

Commit bac3f83

Browse files
authored
Merge pull request #4780 from alphagov/add-refreeze-command
Add a `refreeze-requirements` command
2 parents 5685b9c + cd49bb8 commit bac3f83

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ GIT_COMMIT ?= $(shell git rev-parse HEAD)
1010
VIRTUALENV_ROOT := $(shell [ -z $$VIRTUAL_ENV ] && echo $$(pwd)/venv || echo $$VIRTUAL_ENV)
1111
PYTHON_EXECUTABLE_PREFIX := $(shell test -d "$${VIRTUALENV_ROOT}" && echo "$${VIRTUALENV_ROOT}/bin/" || echo "")
1212

13+
EXCLUDE_REQUIREMENTS_NEWER_THAN_DAYS ?= 30
14+
1315

1416
## DEVELOPMENT
1517

@@ -99,12 +101,16 @@ lint: ## Run static type checks
99101
ruff format --check .
100102
mypy
101103

104+
.PHONY: refreeze-requirements
105+
refreeze-requirements: ## Upgrade unpinned requirements
106+
EXTRA_UV_PIP_COMPILE_FLAGS="--upgrade --exclude-newer $(EXCLUDE_REQUIREMENTS_NEWER_THAN_DAYS)d" make freeze-requirements
107+
102108
.PHONY: freeze-requirements
103109
freeze-requirements: ## Pin all requirements including sub dependencies into requirements.txt
104-
uv pip compile requirements.in -o requirements.txt
110+
uv pip compile requirements.in -o requirements.txt $(EXTRA_UV_PIP_COMPILE_FLAGS)
105111
uv pip sync requirements.txt
106112
python -c "from notifications_utils.version_tools import copy_config; copy_config()"
107-
uv pip compile requirements_for_test.in -o requirements_for_test.txt
113+
uv pip compile requirements_for_test.in -o requirements_for_test.txt $(EXTRA_UV_PIP_COMPILE_FLAGS)
108114
uv pip sync requirements_for_test.txt
109115

110116
.PHONY: bump-utils

0 commit comments

Comments
 (0)