From aea9266760913572ada793392979e103e2e18139 Mon Sep 17 00:00:00 2001 From: Shashank Date: Thu, 25 Dec 2025 16:19:58 +0530 Subject: [PATCH 1/4] Fix seed script crash in non-interactive environments --- scripts/seed.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/seed.py b/scripts/seed.py index 244a949696..bb6b72ed16 100644 --- a/scripts/seed.py +++ b/scripts/seed.py @@ -53,11 +53,19 @@ def check_database(): - if len(EmailAddress.objects.all()) > 0: + if EmailAddress.objects.exists(): print( "Are you sure you want to wipe the existing development database and reseed it? (Y/N)" ) - if settings.TEST or input().lower() == "y": + try: + user_input = input().lower() + except EOFError: + print( + "Non-interactive environment detected. Skipping database reseeding." + ) + return False + + if settings.TEST or user_input == "y": destroy_database() return True else: From 164461b2d7cde90812bf6a11871322e96923e683 Mon Sep 17 00:00:00 2001 From: Shashank Date: Thu, 25 Dec 2025 17:07:16 +0530 Subject: [PATCH 2/4] Fix CI: pin PyYAML <6 to satisfy docker-compose dependency --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 4ccad346db..25a320705e 100755 --- a/.travis.yml +++ b/.travis.yml @@ -29,8 +29,10 @@ before_install: - ulimit -n 4096 # Increase open file limit install: + - pip install "PyYAML<6" - pip install awscli==1.18.66 + jobs: fast_finish: true include: From 66ae8b7a5b8c3db297113fcc177c3145beb9084c Mon Sep 17 00:00:00 2001 From: Shashank Date: Thu, 25 Dec 2025 17:29:49 +0530 Subject: [PATCH 3/4] Fix CI: pin cfn-lint to avoid PyYAML 6 conflict --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 25a320705e..55bcc579b6 100755 --- a/.travis.yml +++ b/.travis.yml @@ -29,9 +29,9 @@ before_install: - ulimit -n 4096 # Increase open file limit install: - - pip install "PyYAML<6" + - pip install "PyYAML==5.3.1" - pip install awscli==1.18.66 - + - pip install "cfn-lint<0.79" jobs: fast_finish: true From bc4091378a624b216d08cb7a539b85bd2f46608c Mon Sep 17 00:00:00 2001 From: Shashank Date: Thu, 25 Dec 2025 18:35:51 +0530 Subject: [PATCH 4/4] Fix CI: enforce PyYAML<6 via constraints to prevent docker-compose failure --- constraints.txt | 3 +++ docker/dev/django/Dockerfile | 6 ++++-- docker/dev/worker_py3_7/Dockerfile | 6 ++++-- docker/dev/worker_py3_8/Dockerfile | 6 +++--- docker/dev/worker_py3_9/Dockerfile | 5 +++-- requirements/common.txt | 2 +- requirements/worker_py3_9.txt | 3 ++- 7 files changed, 20 insertions(+), 11 deletions(-) create mode 100644 constraints.txt diff --git a/constraints.txt b/constraints.txt new file mode 100644 index 0000000000..2597a34f56 --- /dev/null +++ b/constraints.txt @@ -0,0 +1,3 @@ +# Global dependency constraints for CI & Docker +PyYAML<6 +cfn-lint<0.79 \ No newline at end of file diff --git a/docker/dev/django/Dockerfile b/docker/dev/django/Dockerfile index 2035d94986..44f6b6d30c 100644 --- a/docker/dev/django/Dockerfile +++ b/docker/dev/django/Dockerfile @@ -6,9 +6,11 @@ ENV PIP_DISABLE_PIP_VERSION_CHECK=on RUN mkdir /code WORKDIR /code - +ADD constraints.txt /code/ ADD requirements/* /code/ -RUN pip install --no-cache-dir --no-compile --progress-bar off -r dev.txt +RUN pip install --no-cache-dir --no-compile --progress-bar off \ + -c constraints.txt \ + -r dev.txt ADD . /code/ diff --git a/docker/dev/worker_py3_7/Dockerfile b/docker/dev/worker_py3_7/Dockerfile index 69e3a4c3af..01f6c5e400 100644 --- a/docker/dev/worker_py3_7/Dockerfile +++ b/docker/dev/worker_py3_7/Dockerfile @@ -10,10 +10,12 @@ RUN mkdir /code WORKDIR /code ADD requirements/* /code/ +ADD constraints.txt /code/ RUN pip install -U cffi service_identity cython==0.29 setuptools==57.5.0 -RUN pip install -r dev.txt -RUN pip install -r worker_py3_7.txt +RUN pip install -c constraints.txt -r dev.txt +RUN pip install -c constraints.txt -r worker_py3_7.txt + ADD . /code diff --git a/docker/dev/worker_py3_8/Dockerfile b/docker/dev/worker_py3_8/Dockerfile index cf22c29697..db3c5defaf 100644 --- a/docker/dev/worker_py3_8/Dockerfile +++ b/docker/dev/worker_py3_8/Dockerfile @@ -4,10 +4,10 @@ ENV PYTHONUNBUFFERED 1 RUN mkdir /code WORKDIR /code +ADD constraints.txt /code/ ADD requirements/* /code/ -RUN pip install -r dev.txt - +RUN pip install -c constraints.txt -r dev.txt RUN apt-get update && \ apt-get --no-install-recommends install -q -y default-jre default-jdk \ git cmake libeigen3-dev libboost-python-dev libopencv-dev python3-opencv \ @@ -15,7 +15,7 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* RUN pip install -U cffi service_identity cython==0.29 setuptools==57.5.0 -RUN pip install -r worker_py3_8.txt +RUN pip install -c constraints.txt -r worker_py3_8.txt ADD . /code diff --git a/docker/dev/worker_py3_9/Dockerfile b/docker/dev/worker_py3_9/Dockerfile index 70cef16cf9..185c8c3855 100644 --- a/docker/dev/worker_py3_9/Dockerfile +++ b/docker/dev/worker_py3_9/Dockerfile @@ -16,11 +16,12 @@ RUN apt-get update && \ RUN mkdir /code WORKDIR /code +ADD constraints.txt /code/ ADD requirements/* /code/ -RUN pip install -r dev.txt -RUN pip install -r worker_py3_9.txt +RUN pip install -c constraints.txt -r dev.txt +RUN pip install -c constraints.txt -r worker_py3_9.txt ADD . /code diff --git a/requirements/common.txt b/requirements/common.txt index ffafed0a70..0938bf09b4 100644 --- a/requirements/common.txt +++ b/requirements/common.txt @@ -29,7 +29,7 @@ proc==1.0 psycopg2==2.8.4 pycurl==7.43.0.6 PyJWT==2.1.0 -PyYaml==5.1 +PyYAML>=3.10,<6 rstr==2.2.6 sendgrid==6.4.8 vine==1.3.0 diff --git a/requirements/worker_py3_9.txt b/requirements/worker_py3_9.txt index b927781206..28a1507031 100644 --- a/requirements/worker_py3_9.txt +++ b/requirements/worker_py3_9.txt @@ -1,5 +1,6 @@ matplotlib==3.8.4 -cfn-lint==0.79.5 +cfn-lint==0.48.3 +PyYAML>=3.10,<6 networkx==3.2.1 numpy==1.26.4 pandas==2.2.3