From da1a8b5d0cc30a362d3da01994c53a01c8eaede4 Mon Sep 17 00:00:00 2001 From: Caleb Collins-Parks <46505081+caleb15@users.noreply.github.com> Date: Thu, 7 Apr 2022 11:31:45 -0700 Subject: [PATCH 1/6] remove python 3.6 it no longer has any security support --- .circleci/config.yml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 18c2faf..1fed66a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,11 +8,6 @@ workflows: branches: ignore: - master - - test-python: - name: test-python3.6 - version: "3.6" - requires: - - lint - test-python: name: test-python3.7 version: "3.7" @@ -23,6 +18,11 @@ workflows: version: "3.8" requires: - lint + - test-python: + name: test-python3.9 + version: "3.9" + requires: + - lint lint_test_deploy: jobs: - lint: @@ -30,11 +30,6 @@ workflows: branches: only: - master - - test-python: - name: test-python3.6 - version: "3.6" - requires: - - lint - test-python: name: test-python3.7 version: "3.7" @@ -45,6 +40,11 @@ workflows: version: "3.8" requires: - lint + - test-python: + name: test-python3.9 + version: "3.9" + requires: + - lint # Don't want to deploy every push to master? # You can switch to manual approval if desired # Uncomment below and get rid of requirement for test-python @@ -58,17 +58,17 @@ workflows: # requires: # - hold-deploy requires: - - test-python3.6 - test-python3.7 - test-python3.8 + - test-python3.9 jobs: lint: docker: - - image: cimg/python:3.6 + - image: cimg/python:3.7 steps: - checkout - restore_cache: - key: v3-dep-cache-3.6-{{ checksum "requirements.txt" }}-{{ checksum "dev-requirements.pip" }} + key: v3-dep-cache-3.7-{{ checksum "requirements.txt" }}-{{ checksum "dev-requirements.pip" }} # see https://github.com/pypa/pip/issues/4537 for why we need to install_egg_info - run: name: install python dependencies @@ -78,7 +78,7 @@ jobs: python setup.py install_egg_info make dev - save_cache: - key: v3-dep-cache-3.6-{{ checksum "requirements.txt" }}-{{ checksum "dev-requirements.pip" }} + key: v3-dep-cache-3.7-{{ checksum "requirements.txt" }}-{{ checksum "dev-requirements.pip" }} paths: - "venv" - run: @@ -126,17 +126,17 @@ jobs: path: htmlcov.tar integration: docker: - - image: cimg/python:3.6 + - image: cimg/python:3.7 steps: - run: echo "It works!" - run: echo $RUN_EXTRA_TESTS deploy: docker: - - image: cimg/python:3.6 + - image: cimg/python:3.7 steps: - checkout - restore_cache: - key: v3-dep-cache-3.6-{{ checksum "requirements.txt" }}-{{ checksum "dev-requirements.pip" }} + key: v3-dep-cache-3.7-{{ checksum "requirements.txt" }}-{{ checksum "dev-requirements.pip" }} # see https://github.com/pypa/pip/issues/4537 for why we need to install_egg_info - run: name: install python dependencies @@ -146,7 +146,7 @@ jobs: python setup.py install_egg_info make dev - save_cache: - key: v3-dep-cache-3.6-{{ checksum "requirements.txt" }}-{{ checksum "dev-requirements.pip" }} + key: v3-dep-cache-3.7-{{ checksum "requirements.txt" }}-{{ checksum "dev-requirements.pip" }} paths: - "venv" - run: From 8d4f8906f967c730f46cff8476a0872241abe2b2 Mon Sep 17 00:00:00 2001 From: Caleb Collins-Parks <46505081+caleb15@users.noreply.github.com> Date: Thu, 11 Aug 2022 14:05:44 -0700 Subject: [PATCH 2/6] no-op change --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1fed66a..9547d39 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,6 @@ version: 2.1 -workflows: +workflows: lint_and_test_pr: jobs: - lint: From 80545ae58212df49815fbe7530a5bab762303c7e Mon Sep 17 00:00:00 2001 From: Caleb Collins-Parks <46505081+caleb15@users.noreply.github.com> Date: Thu, 11 Aug 2022 14:16:17 -0700 Subject: [PATCH 3/6] fix black err see https://app.circleci.com/pipelines/github/15five/python-circleci-package-boilerplate/28/workflows/562f8389-7ecc-49d0-876a-27844ad3bcc1/jobs/88 --- dev-requirements.pip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.pip b/dev-requirements.pip index de4c795..6e9b3da 100644 --- a/dev-requirements.pip +++ b/dev-requirements.pip @@ -1,6 +1,6 @@ -r requirements.txt # Linters -black==19.10b0 +black==22.3.0 isort==4.3.20 # Testing Libraries From 57beb4f777768907a2e2631b66fdf5841f3a543f Mon Sep 17 00:00:00 2001 From: caleb15 Date: Thu, 11 Aug 2022 14:18:19 -0700 Subject: [PATCH 4/6] blackify --- setup.py | 4 +++- tests/test_healthchecks.py | 25 +++++++++++++++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 71711be..2b82ad0 100644 --- a/setup.py +++ b/setup.py @@ -30,6 +30,8 @@ ], keywords="insert your keywords here", packages=find_packages(), - install_requires=["requests==2.22.0",], + install_requires=[ + "requests==2.22.0", + ], python_requires=">=3.6", ) diff --git a/tests/test_healthchecks.py b/tests/test_healthchecks.py index 8ceb8bc..d1bfc37 100644 --- a/tests/test_healthchecks.py +++ b/tests/test_healthchecks.py @@ -47,7 +47,10 @@ def test_get_endpoint_if_not_cached_but_exists_in_website(): API_URL_BASE + "/checks/", json={ "checks": [ - {"name": "spongebob", "ping_url": "https://hc-ping.com/55555555",} + { + "name": "spongebob", + "ping_url": "https://hc-ping.com/55555555", + } ] }, ) @@ -58,7 +61,9 @@ def test_get_endpoint_if_not_cached_but_exists_in_website(): @responses.activate def test_get_endpoint_if_does_not_exist(): responses.add( - responses.GET, API_URL_BASE + "/checks/", json={"checks": []}, + responses.GET, + API_URL_BASE + "/checks/", + json={"checks": []}, ) responses.add(responses.GET, API_URL_BASE + "/channels/", json={"channels": []}) responses.add( @@ -74,7 +79,9 @@ def test_get_endpoint_if_does_not_exist(): def test_get_endpoint_if_does_not_exist_with_cache_override(): manager.cache = MockRedisCache() responses.add( - responses.GET, API_URL_BASE + "/checks/", json={"checks": []}, + responses.GET, + API_URL_BASE + "/checks/", + json={"checks": []}, ) responses.add( responses.POST, @@ -89,7 +96,9 @@ def test_get_endpoint_if_does_not_exist_with_cache_override(): @responses.activate def test_create_check(): responses.add( - responses.POST, API_URL_BASE + "/checks/", json={"ping_url": "foo"}, + responses.POST, + API_URL_BASE + "/checks/", + json={"ping_url": "foo"}, ) endpoint = manager.create_check("") assert endpoint == "foo" @@ -103,7 +112,9 @@ def test_create_check_with_channel(): json={"channels": [{"name": "slack", "id": "112536"}]}, ) responses.add( - responses.POST, API_URL_BASE + "/checks/", json={"ping_url": "foo"}, + responses.POST, + API_URL_BASE + "/checks/", + json={"ping_url": "foo"}, ) endpoint = manager.create_check("fah", {"channels": ["slack"]}) assert "foo" == endpoint @@ -114,7 +125,9 @@ def test_create_check_with_channel(): def test_default_creation_params_can_be_overridden(): manager.default_creation_params["timeout"] = 5326 responses.add( - responses.POST, API_URL_BASE + "/checks/", json={"ping_url": "foo"}, + responses.POST, + API_URL_BASE + "/checks/", + json={"ping_url": "foo"}, ) manager.create_check("fah", {"timeout": 142}) assert "5326" not in responses.calls[0].request.body From dd2c54eded3d7dfb19909cb77ca36367bc99685c Mon Sep 17 00:00:00 2001 From: caleb15 Date: Thu, 11 Aug 2022 14:20:30 -0700 Subject: [PATCH 5/6] add python 3.10 --- .circleci/config.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9547d39..0cbe712 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,6 +23,11 @@ workflows: version: "3.9" requires: - lint + - test-python: + name: test-python3.10 + version: "3.10" + requires: + - lint lint_test_deploy: jobs: - lint: @@ -45,6 +50,11 @@ workflows: version: "3.9" requires: - lint + - test-python: + name: test-python3.10 + version: "3.10" + requires: + - lint # Don't want to deploy every push to master? # You can switch to manual approval if desired # Uncomment below and get rid of requirement for test-python @@ -61,6 +71,7 @@ workflows: - test-python3.7 - test-python3.8 - test-python3.9 + - test-python3.10 jobs: lint: docker: From bcaa4145922002c9841529f3c1c49dc23c72040e Mon Sep 17 00:00:00 2001 From: caleb15 Date: Thu, 11 Aug 2022 14:22:33 -0700 Subject: [PATCH 6/6] update pytest for 3.10 --- dev-requirements.pip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.pip b/dev-requirements.pip index 6e9b3da..8d5681e 100644 --- a/dev-requirements.pip +++ b/dev-requirements.pip @@ -5,7 +5,7 @@ isort==4.3.20 # Testing Libraries coverage==5.0.4 -pytest==5.1.1 +pytest==7.1.2 responses==0.10.6 # Release Utilities