From f3bdb36ca8ceb1374cab43b884704adf10203fb7 Mon Sep 17 00:00:00 2001 From: bronsen Date: Thu, 21 Nov 2024 19:46:09 +0100 Subject: [PATCH] [requirements] have manage.py ensure requirements are up to date --- src/manage.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/manage.py b/src/manage.py index 22d839f..46d6fb9 100755 --- a/src/manage.py +++ b/src/manage.py @@ -3,6 +3,7 @@ import os import sys +from pathlib import Path def main(): @@ -11,6 +12,19 @@ def main(): from configurations.management import execute_from_command_line + try: + import pip_lock + except ModuleNotFoundError: + raise ModuleNotFoundError( + "Couldn't import pip-lock. Are you on the right virtualenv and up to date?" + ) + + requirements_path = str(Path(__file__).parent.parent / "requirements/base.txt") + pip_lock.check_requirements( + requirements_path, + post_text="\nRun the following:\n\npython -m pip install -r requirements/base.txt\n", + ) + execute_from_command_line(sys.argv)