Skip to content
This repository was archived by the owner on May 24, 2023. It is now read-only.

Commit

Permalink
Merge pull request #4 from 15five/remove-3.6
Browse files Browse the repository at this point in the history
remove python 3.6 and add 3.10
  • Loading branch information
caleb15 authored Aug 11, 2022
2 parents 3376699 + bcaa414 commit 92e4cd5
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 28 deletions.
49 changes: 30 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
version: 2.1

workflows:
workflows:
lint_and_test_pr:
jobs:
- lint:
filters:
branches:
ignore:
- master
- test-python:
name: test-python3.6
version: "3.6"
requires:
- lint
- test-python:
name: test-python3.7
version: "3.7"
Expand All @@ -23,18 +18,23 @@ workflows:
version: "3.8"
requires:
- lint
- test-python:
name: test-python3.9
version: "3.9"
requires:
- lint
- test-python:
name: test-python3.10
version: "3.10"
requires:
- lint
lint_test_deploy:
jobs:
- lint:
filters:
branches:
only:
- master
- test-python:
name: test-python3.6
version: "3.6"
requires:
- lint
- test-python:
name: test-python3.7
version: "3.7"
Expand All @@ -45,6 +45,16 @@ workflows:
version: "3.8"
requires:
- lint
- test-python:
name: test-python3.9
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
Expand All @@ -58,17 +68,18 @@ workflows:
# requires:
# - hold-deploy
requires:
- test-python3.6
- test-python3.7
- test-python3.8
- test-python3.9
- test-python3.10
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
Expand All @@ -78,7 +89,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:
Expand Down Expand Up @@ -126,17 +137,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
Expand All @@ -146,7 +157,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:
Expand Down
4 changes: 2 additions & 2 deletions dev-requirements.pip
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
-r requirements.txt
# Linters
black==19.10b0
black==22.3.0
isort==4.3.20

# Testing Libraries
coverage==5.0.4
pytest==5.1.1
pytest==7.1.2
responses==0.10.6

# Release Utilities
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
25 changes: 19 additions & 6 deletions tests/test_healthchecks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
]
},
)
Expand All @@ -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(
Expand All @@ -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,
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 92e4cd5

Please sign in to comment.