From d5b5aeb9b29cebe548b7750ccc1007d884a3a780 Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Fri, 7 Feb 2025 16:00:21 -0600 Subject: [PATCH 1/6] Add caching of optional requirements --- .circleci/config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 06c63b39eb..a373f390d7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,6 +34,8 @@ commands: type: string steps: - checkout + - restore_cache: # **restores saved dependency cache if the Branch key template or requirements.txt files have not changed since the previous run** + key: &deps1-cache deps1-{{ .Branch }}-{{ checksum "test_requirements/requirements-optional.txt" }} - browser-tools/install-chrome - browser-tools/install-chromedriver - run: @@ -80,6 +82,10 @@ commands: command: | . venv/bin/activate python -m pytest -x test_init/test_lazy_imports.py + - save_cache: # ** special step to save dependency cache ** + key: *deps1-cache + paths: + - "venv" jobs: check-code-formatting: From f07f2ca9fd1cdaeb42bed4dc54aaaacad20e1fce Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Tue, 11 Feb 2025 15:24:36 -0600 Subject: [PATCH 2/6] Fix filepath of requirements file --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a373f390d7..07aec57b5c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,7 +35,7 @@ commands: steps: - checkout - restore_cache: # **restores saved dependency cache if the Branch key template or requirements.txt files have not changed since the previous run** - key: &deps1-cache deps1-{{ .Branch }}-{{ checksum "test_requirements/requirements-optional.txt" }} + key: &deps1-cache deps1-{{ .Branch }}-{{ checksum "test_requirements/requirements_optional.txt" }} - browser-tools/install-chrome - browser-tools/install-chromedriver - run: From 84767ac64107d80f794fe53142cb823e13b06d8b Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Mon, 10 Feb 2025 16:55:12 -0600 Subject: [PATCH 3/6] Try to fix caching --- .circleci/config.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 07aec57b5c..19599f805d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,8 +34,8 @@ commands: type: string steps: - checkout - - restore_cache: # **restores saved dependency cache if the Branch key template or requirements.txt files have not changed since the previous run** - key: &deps1-cache deps1-{{ .Branch }}-{{ checksum "test_requirements/requirements_optional.txt" }} + - restore_cache: + key: optional-dependencies-{{ checksum "test_requirements/requirements_optional.txt" }}-{{ checksum ".circleci/config.yml" }} - browser-tools/install-chrome - browser-tools/install-chromedriver - run: @@ -48,6 +48,12 @@ commands: cd js npm ci npm run build + + - save_cache: + paths: + - ./venv + key: optional-dependencies-{{ checksum "test_requirements/requirements_optional.txt" }}-{{ checksum ".circleci/config.yml" }} + - run: name: Test core command: | @@ -73,7 +79,7 @@ commands: pytest tests/test_io no_output_timeout: 20m - run: - name: Test dependencdies not imported + name: Test dependencies not imported command: | . venv/bin/activate python -m pytest -x test_init/test_dependencies_not_imported.py @@ -82,10 +88,6 @@ commands: command: | . venv/bin/activate python -m pytest -x test_init/test_lazy_imports.py - - save_cache: # ** special step to save dependency cache ** - key: *deps1-cache - paths: - - "venv" jobs: check-code-formatting: From 6087e3c6fd137619d096a13961cc2df6038b31e0 Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Mon, 10 Feb 2025 17:15:59 -0600 Subject: [PATCH 4/6] Debug --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 19599f805d..e33198ebf1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -42,6 +42,7 @@ commands: name: Install dependencies command: | python -m venv venv + ls -R venv . venv/bin/activate pip install -e . pip install -r ./test_requirements/requirements_optional.txt From 06b05d08d6c40d47c559970be59bc9c16b14098d Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Mon, 10 Feb 2025 17:27:43 -0600 Subject: [PATCH 5/6] Debug --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e33198ebf1..3d3838a6ef 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,8 +41,8 @@ commands: - run: name: Install dependencies command: | - python -m venv venv ls -R venv + python -m venv venv . venv/bin/activate pip install -e . pip install -r ./test_requirements/requirements_optional.txt From 40c4547e8072f94f812d47be6060d732d81bd7ad Mon Sep 17 00:00:00 2001 From: Martha Cryan Date: Tue, 11 Feb 2025 12:29:48 -0600 Subject: [PATCH 6/6] Set cache key to be specific to python version --- .circleci/config.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3d3838a6ef..3fa2825885 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,13 +35,12 @@ commands: steps: - checkout - restore_cache: - key: optional-dependencies-{{ checksum "test_requirements/requirements_optional.txt" }}-{{ checksum ".circleci/config.yml" }} + key: optional-dependencies-{{ checksum "test_requirements/requirements_optional.txt" }}-{{ checksum parameters.py }} - browser-tools/install-chrome - browser-tools/install-chromedriver - run: name: Install dependencies command: | - ls -R venv python -m venv venv . venv/bin/activate pip install -e . @@ -52,8 +51,8 @@ commands: - save_cache: paths: - - ./venv - key: optional-dependencies-{{ checksum "test_requirements/requirements_optional.txt" }}-{{ checksum ".circleci/config.yml" }} + - venv + key: optional-dependencies-{{ checksum "test_requirements/requirements_optional.txt" }}-{{ checksum parameters.py }} - run: name: Test core