From 5c037d8b03d50bb0831f17ae6c977eecef99c612 Mon Sep 17 00:00:00 2001 From: Dylan Reinhold Date: Tue, 19 Mar 2024 23:26:11 -0700 Subject: [PATCH 1/5] Update CI build version for python to 3.11 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 31dfff5..ac489e9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ jobs: docker: # specify the version you desire here # use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers` - - image: circleci/python:3.7 + - image: circleci/python:3.11 - image: postgres:11 environment: POSTGRES_USER: circleci From 6bbcfbbae57fe4a6c234fd2a914d5b61de895177 Mon Sep 17 00:00:00 2001 From: Dylan Reinhold Date: Tue, 19 Mar 2024 23:28:13 -0700 Subject: [PATCH 2/5] Update to python 3.12 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ac489e9..494a2de 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ jobs: docker: # specify the version you desire here # use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers` - - image: circleci/python:3.11 + - image: circleci/python:3.12 - image: postgres:11 environment: POSTGRES_USER: circleci From cedfc90d34eea490b9700de111c508fb6c16b7a7 Mon Sep 17 00:00:00 2001 From: Dylan Reinhold Date: Tue, 19 Mar 2024 23:29:36 -0700 Subject: [PATCH 3/5] Updated location --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 494a2de..6c0e6f5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ jobs: docker: # specify the version you desire here # use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers` - - image: circleci/python:3.12 + - image: cimg/python:3.12 - image: postgres:11 environment: POSTGRES_USER: circleci From e37d0ff83b10558c56a06b5fc91538635d92e242 Mon Sep 17 00:00:00 2001 From: Dylan Reinhold Date: Tue, 19 Mar 2024 23:32:15 -0700 Subject: [PATCH 4/5] Update github actions and drop circle ci --- .circleci/config.yml | 64 -------------------------------------- .circleci/deploy_prod.sh | 4 --- .github/workflows/main.yml | 4 +-- 3 files changed, 2 insertions(+), 70 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100755 .circleci/deploy_prod.sh diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 6c0e6f5..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,64 +0,0 @@ -# Python CircleCI 2.0 configuration file -# -# Check https://circleci.com/docs/2.0/language-python/ for more details -# -version: 2 -jobs: - build: - docker: - # specify the version you desire here - # use `-browsers` prefix for selenium tests, e.g. `3.6.1-browsers` - - image: cimg/python:3.12 - - image: postgres:11 - environment: - POSTGRES_USER: circleci - POSTGRES_DB: circle_test - POSTGRES_PASSWORD: circle_test_pwd9988 - - image: redis:3.2 - - # Specify service dependencies here if necessary - # CircleCI maintains a library of pre-built images - # documented at https://circleci.com/docs/2.0/circleci-images/ - # - image: circleci/postgres:9.4 - - working_directory: ~/repo - - steps: - - checkout - - # Download and cache dependencies - - restore_cache: - keys: - - v1-dependencies-{{ checksum "requirements.txt" }} - # fallback to using the latest cache if no exact match is found - - v1-dependencies- - - - run: - name: install dependencies - command: | - python3 -m venv venv - . venv/bin/activate - pip install -r requirements.txt - - - save_cache: - paths: - - ./venv - key: v1-dependencies-{{ checksum "requirements.txt" }} - - # run tests! - - run: - name: run tests - command: | - cp trunk_player/settings_local.py.circleci trunk_player/settings_local.py - . venv/bin/activate - python manage.py test - - - store_artifacts: - path: test-reports - destination: test-reports - - - deploy: - command: | - if [ "${CIRCLE_BRANCH}" == "scanoc" ]; then - .circleci/deploy_prod.sh - fi diff --git a/.circleci/deploy_prod.sh b/.circleci/deploy_prod.sh deleted file mode 100755 index a77ab37..0000000 --- a/.circleci/deploy_prod.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -echo "`date` Start circleci deploy" -ssh -o StrictHostKeyChecking=no $DEPLOY_USER@$DEPLOY_SERVER "$DEPLOY_SCRIPT" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8a7f1e7..6aef89a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,10 +26,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python 3.9 + - name: Set up Python 3.12 uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: 3.12 - name: Install dependencies run: | python -m pip install --upgrade pip From 3c88a8c92d519d4dc6d31a39fd7b8a9e596790e5 Mon Sep 17 00:00:00 2001 From: Dylan Reinhold Date: Tue, 19 Mar 2024 23:37:19 -0700 Subject: [PATCH 5/5] Fix test cases --- radio/tests/test_generic_pages.py | 2 +- radio/tests/test_talkgroup_access.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/radio/tests/test_generic_pages.py b/radio/tests/test_generic_pages.py index 03d03f6..b7f5408 100644 --- a/radio/tests/test_generic_pages.py +++ b/radio/tests/test_generic_pages.py @@ -18,4 +18,4 @@ def setUp(self): def test_page_exists(self): client = Client() response = client.get(reverse('pages', kwargs={'page_name': 'FirstPage'})) - self.assertEquals(response.status_code, 200) + self.assertEqual(response.status_code, 200) diff --git a/radio/tests/test_talkgroup_access.py b/radio/tests/test_talkgroup_access.py index a1f4f3b..45fcf66 100644 --- a/radio/tests/test_talkgroup_access.py +++ b/radio/tests/test_talkgroup_access.py @@ -36,7 +36,7 @@ def setUp(self): def test_talkgroup_exists(self): tg = TalkGroup.objects.get(alpha_tag = 'Test TG 1') - self.assertEquals(str(tg), 'Test TG 1') + self.assertEqual(str(tg), 'Test TG 1') @override_settings(ACCESS_TG_RESTRICT=False) def test_talkgroup_access_open(self): @@ -44,7 +44,7 @@ def test_talkgroup_access_open(self): response = self.client.get('/api_v1/tg/test-tg-1/') self.assertEqual(response.status_code, 200) data = json.loads(str(response.content, encoding='utf8')) - self.assertEquals(data['count'], 1) + self.assertEqual(data['count'], 1) @override_settings(ACCESS_TG_RESTRICT=True) def test_talkgroup_access_user1(self): @@ -54,7 +54,7 @@ def test_talkgroup_access_user1(self): response = TalkGroupFilterViewSet.as_view()(request, filter_val='test-tg-1').render() #print(response.content) data = json.loads(str(response.content, encoding='utf8')) - self.assertEquals(data['count'], 1) + self.assertEqual(data['count'], 1) @override_settings(ACCESS_TG_RESTRICT=True) def test_talkgroup_access_user2(self): @@ -64,5 +64,5 @@ def test_talkgroup_access_user2(self): response = TalkGroupFilterViewSet.as_view()(request, filter_val='test-tg-1').render() #print(response.content) data = json.loads(str(response.content, encoding='utf8')) - self.assertEquals(data['count'], 0) + self.assertEqual(data['count'], 0)