From 89864f5ca145b4f23d09c51e42acaf322c86a78e Mon Sep 17 00:00:00 2001 From: Jamie Bliss Date: Mon, 15 Feb 2021 14:41:23 -0500 Subject: [PATCH 1/8] Update for httpx --- .cirrus.yml | 2 +- gqlmod_cirrusci/__init__.py | 10 ++++++---- setup.cfg | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 0a4d795..b958996 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -3,7 +3,7 @@ test_task: image: python:3 setup_script: # Until we get release stuff rolling - - pip install "git+https://github.com/gqlmod/gqlmod.git#egg=gqlmod" + - pip install "git+https://github.com/gqlmod/gqlmod.git#egg=gqlmod[httpx]" - pip install . test_script: - python setup.py test diff --git a/gqlmod_cirrusci/__init__.py b/gqlmod_cirrusci/__init__.py index 2fc4f9a..36aaace 100644 --- a/gqlmod_cirrusci/__init__.py +++ b/gqlmod_cirrusci/__init__.py @@ -1,15 +1,17 @@ """ Provider for Cirrus CI's GraphQL API. """ -from gqlmod.helpers.urllib import UrllibJsonProvider +from gqlmod.helpers.httpx import HttpxProvider -class CirrusCiProvider(UrllibJsonProvider): +class CirrusCiProvider(HttpxProvider): endpoint = 'https://api.cirrus-ci.com/graphql' def __init__(self, token=None): self.token = token - def modify_request(self, req, variables): + def build_request(self, query, variables): + req = super().build_request(query, variables) if self.token: - req.add_header('Authorization', f"Bearer {self.token}") + req.headers['Authorization'] = f"Bearer {self.token}" + return req diff --git a/setup.cfg b/setup.cfg index af29bc6..17c3f32 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,7 +20,7 @@ packages = find: python_requires = >=3.7 install_requires = - gqlmod + gqlmod~=0.9.0[httpx] setup_requires = wheel From 137750c3151e293867e14b1ab924c99959d60dc7 Mon Sep 17 00:00:00 2001 From: Jamie Bliss Date: Mon, 15 Feb 2021 14:44:13 -0500 Subject: [PATCH 2/8] Fix reqs --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 17c3f32..0b7e3ad 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,7 +20,7 @@ packages = find: python_requires = >=3.7 install_requires = - gqlmod~=0.9.0[httpx] + gqlmod[httpx]~=0.9.0 setup_requires = wheel From 00c5e424fce7c84aaab42329aee61d6a94fc1ef6 Mon Sep 17 00:00:00 2001 From: Jamie Bliss Date: Mon, 15 Feb 2021 14:47:43 -0500 Subject: [PATCH 3/8] Try that --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index b958996..757357c 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -4,7 +4,7 @@ test_task: setup_script: # Until we get release stuff rolling - pip install "git+https://github.com/gqlmod/gqlmod.git#egg=gqlmod[httpx]" - - pip install . + # - pip install . test_script: - python setup.py test From 19226f04522f491281521c717c88bec06b1fa884 Mon Sep 17 00:00:00 2001 From: Jamie Bliss Date: Mon, 15 Feb 2021 14:50:31 -0500 Subject: [PATCH 4/8] Stop using `setup.py test` --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 757357c..e30c526 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -6,7 +6,7 @@ test_task: - pip install "git+https://github.com/gqlmod/gqlmod.git#egg=gqlmod[httpx]" # - pip install . test_script: - - python setup.py test + - pytest flake8_task: From 51f6142502b9de31868f5a3ddda8e1fa491f08df Mon Sep 17 00:00:00 2001 From: Jamie Bliss Date: Mon, 15 Feb 2021 14:51:41 -0500 Subject: [PATCH 5/8] Test deps --- .cirrus.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index e30c526..74b8f40 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -2,9 +2,8 @@ test_task: container: image: python:3 setup_script: - # Until we get release stuff rolling - pip install "git+https://github.com/gqlmod/gqlmod.git#egg=gqlmod[httpx]" - # - pip install . + - pip install pytest test_script: - pytest From dc2ece4231f7288cc02f270d35b6777e8e980b27 Mon Sep 17 00:00:00 2001 From: Jamie Bliss Date: Mon, 15 Feb 2021 15:13:50 -0500 Subject: [PATCH 6/8] ci: do that --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 74b8f40..fcbb385 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -2,7 +2,7 @@ test_task: container: image: python:3 setup_script: - - pip install "git+https://github.com/gqlmod/gqlmod.git#egg=gqlmod[httpx]" + - pip install -e "git+https://github.com/gqlmod/gqlmod.git#egg=gqlmod[httpx]" . - pip install pytest test_script: - pytest From e5d7e30c2db25185afce384d7577711324196c2f Mon Sep 17 00:00:00 2001 From: Jamie Bliss Date: Mon, 15 Feb 2021 15:17:01 -0500 Subject: [PATCH 7/8] Don't use the solver --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index fcbb385..781a865 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -2,7 +2,7 @@ test_task: container: image: python:3 setup_script: - - pip install -e "git+https://github.com/gqlmod/gqlmod.git#egg=gqlmod[httpx]" . + - pip install --use-deprecated=legacy-resolve -e "git+https://github.com/gqlmod/gqlmod.git#egg=gqlmod[httpx]" . - pip install pytest test_script: - pytest From cc07870c28c396102120329929d374cb0e9fed32 Mon Sep 17 00:00:00 2001 From: Jamie Bliss Date: Mon, 15 Feb 2021 15:25:08 -0500 Subject: [PATCH 8/8] ci: typo --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 781a865..5786bb5 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -2,7 +2,7 @@ test_task: container: image: python:3 setup_script: - - pip install --use-deprecated=legacy-resolve -e "git+https://github.com/gqlmod/gqlmod.git#egg=gqlmod[httpx]" . + - pip install --use-deprecated=legacy-resolver -e "git+https://github.com/gqlmod/gqlmod.git#egg=gqlmod[httpx]" . - pip install pytest test_script: - pytest