Skip to content
This repository was archived by the owner on Jun 29, 2022. It is now read-only.

Commit d9ca53f

Browse files
authored
Merge pull request #49 from Stewart86/dependencies-updates
update dependencies and fix CI
2 parents 4a898ca + 09f0bf7 commit d9ca53f

File tree

8 files changed

+48
-58
lines changed

8 files changed

+48
-58
lines changed

.github/workflows/constraints.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
pip==21.3.1
22
nox==2021.10.1
33
nox-poetry==0.8.6
4-
virtualenv==20.9.0
54
poetry==1.1.11
5+
virtualenv==20.10.0
6+
pyparsing < 3

.github/workflows/test.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
include:
15-
- { python-version: 3.9, os: ubuntu-latest, session: "pre-commit" }
16-
- { python-version: 3.9, os: ubuntu-latest, session: "safety" }
15+
- { python-version: "3.10", os: ubuntu-latest, session: "pre-commit" }
16+
- { python-version: "3.10", os: ubuntu-latest, session: "safety" }
17+
- { python-version: "3.10", os: ubuntu-latest, session: "mypy" }
1718
- { python-version: 3.9, os: ubuntu-latest, session: "mypy" }
1819
- { python-version: 3.9, os: ubuntu-latest, session: "tests" }
1920
- { python-version: 3.9, os: windows-latest, session: "tests" }
2021
- { python-version: 3.9, os: macos-latest, session: "tests" }
22+
- { python-version: "3.10", os: ubuntu-latest, session: "tests" }
23+
- { python-version: "3.10", os: windows-latest, session: "tests" }
24+
- { python-version: "3.10", os: macos-latest, session: "tests" }
2125

2226
env:
2327
NOXSESSION: ${{ matrix.session }}

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.9.5
1+
3.9.7

aiocloudflare/commons/auth.py

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
QueryParamTypes,
1313
RequestContent,
1414
RequestFiles,
15-
TimeoutTypes,
1615
)
1716

1817
from aiocloudflare.commons.exceptions import AuthenticationError
@@ -49,8 +48,7 @@ async def get(
4948
headers: HeaderTypes = None, # type: ignore[assignment]
5049
cookies: CookieTypes = None, # type: ignore[assignment]
5150
auth: Union[AuthTypes, UseClientDefault] = USE_CLIENT_DEFAULT,
52-
allow_redirects: Union[bool, UseClientDefault] = USE_CLIENT_DEFAULT,
53-
timeout: Union[TimeoutTypes, UseClientDefault] = USE_CLIENT_DEFAULT,
51+
follow_redirects: Union[bool, UseClientDefault] = USE_CLIENT_DEFAULT,
5452
) -> Response:
5553
"""GET method with AUTH"""
5654
self.__auth_init()
@@ -60,10 +58,9 @@ async def get(
6058
headers=headers,
6159
cookies=cookies,
6260
auth=self._auth,
63-
allow_redirects=allow_redirects
64-
if allow_redirects is not None
61+
follow_redirects=follow_redirects
62+
if follow_redirects is not None
6563
else USE_CLIENT_DEFAULT,
66-
timeout=timeout if timeout is not None else USE_CLIENT_DEFAULT,
6764
)
6865

6966
async def post(
@@ -77,8 +74,7 @@ async def post(
7774
headers: HeaderTypes = None, # type: ignore[assignment]
7875
cookies: CookieTypes = None, # type: ignore[assignment]
7976
auth: Union[AuthTypes, UseClientDefault] = USE_CLIENT_DEFAULT,
80-
allow_redirects: Union[bool, UseClientDefault] = USE_CLIENT_DEFAULT,
81-
timeout: Union[TimeoutTypes, UseClientDefault] = USE_CLIENT_DEFAULT,
77+
follow_redirects: Union[bool, UseClientDefault] = USE_CLIENT_DEFAULT,
8278
) -> Response:
8379
self.__auth_init()
8480
return await super().post(
@@ -91,10 +87,9 @@ async def post(
9187
headers=headers,
9288
cookies=cookies,
9389
auth=self._auth,
94-
allow_redirects=allow_redirects
95-
if allow_redirects is not None
90+
follow_redirects=follow_redirects
91+
if follow_redirects is not None
9692
else USE_CLIENT_DEFAULT,
97-
timeout=timeout if timeout is not None else USE_CLIENT_DEFAULT,
9893
)
9994

10095
async def put(
@@ -108,8 +103,7 @@ async def put(
108103
headers: HeaderTypes = None, # type: ignore[assignment]
109104
cookies: CookieTypes = None, # type: ignore[assignment]
110105
auth: Union[AuthTypes, UseClientDefault] = USE_CLIENT_DEFAULT,
111-
allow_redirects: Union[bool, UseClientDefault] = USE_CLIENT_DEFAULT,
112-
timeout: Union[TimeoutTypes, UseClientDefault] = USE_CLIENT_DEFAULT,
106+
follow_redirects: Union[bool, UseClientDefault] = USE_CLIENT_DEFAULT,
113107
) -> Response:
114108
self.__auth_init()
115109
return await super().put(
@@ -122,10 +116,9 @@ async def put(
122116
headers=headers,
123117
cookies=cookies,
124118
auth=self._auth,
125-
allow_redirects=allow_redirects
126-
if allow_redirects is not None
119+
follow_redirects=follow_redirects
120+
if follow_redirects is not None
127121
else USE_CLIENT_DEFAULT,
128-
timeout=timeout if timeout is not None else USE_CLIENT_DEFAULT,
129122
)
130123

131124
async def delete(
@@ -135,8 +128,7 @@ async def delete(
135128
headers: HeaderTypes = None, # type: ignore[assignment]
136129
cookies: CookieTypes = None, # type: ignore[assignment]
137130
auth: Union[AuthTypes, UseClientDefault] = USE_CLIENT_DEFAULT,
138-
allow_redirects: Union[bool, UseClientDefault] = USE_CLIENT_DEFAULT,
139-
timeout: Union[TimeoutTypes, UseClientDefault] = USE_CLIENT_DEFAULT,
131+
follow_redirects: Union[bool, UseClientDefault] = USE_CLIENT_DEFAULT,
140132
) -> Response:
141133
self.__auth_init()
142134
return await super().delete(
@@ -145,10 +137,9 @@ async def delete(
145137
headers=headers,
146138
cookies=cookies,
147139
auth=self._auth,
148-
allow_redirects=allow_redirects
149-
if allow_redirects is not None
140+
follow_redirects=follow_redirects
141+
if follow_redirects is not None
150142
else USE_CLIENT_DEFAULT,
151-
timeout=timeout if timeout is not None else USE_CLIENT_DEFAULT,
152143
)
153144

154145
async def patch(
@@ -162,8 +153,7 @@ async def patch(
162153
headers: HeaderTypes = None, # type: ignore[assignment]
163154
cookies: CookieTypes = None, # type: ignore[assignment]
164155
auth: Union[AuthTypes, UseClientDefault] = USE_CLIENT_DEFAULT,
165-
allow_redirects: Union[bool, UseClientDefault] = USE_CLIENT_DEFAULT,
166-
timeout: Union[TimeoutTypes, UseClientDefault] = USE_CLIENT_DEFAULT,
156+
follow_redirects: Union[bool, UseClientDefault] = USE_CLIENT_DEFAULT,
167157
) -> Response:
168158
self.__auth_init()
169159
return await super().patch(
@@ -176,10 +166,9 @@ async def patch(
176166
headers=headers,
177167
cookies=cookies,
178168
auth=self._auth,
179-
allow_redirects=allow_redirects
180-
if allow_redirects is not None
169+
follow_redirects=follow_redirects
170+
if follow_redirects is not None
181171
else USE_CLIENT_DEFAULT,
182-
timeout=timeout if timeout is not None else USE_CLIENT_DEFAULT,
183172
)
184173

185174
def __auth_init(self) -> None:

aiocloudflare/commons/base.py

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
QueryParamTypes,
1212
RequestContent,
1313
RequestFiles,
14-
TimeoutTypes,
1514
)
1615

1716
from aiocloudflare.commons.config import Config
@@ -82,8 +81,7 @@ async def get(
8281
headers: HeaderTypes = None, # type: ignore[assignment]
8382
cookies: CookieTypes = None, # type: ignore[assignment]
8483
auth: typing.Union[AuthTypes, UseClientDefault] = USE_CLIENT_DEFAULT,
85-
allow_redirects: typing.Union[bool, UseClientDefault] = USE_CLIENT_DEFAULT,
86-
timeout: typing.Union[TimeoutTypes, UseClientDefault] = USE_CLIENT_DEFAULT,
84+
follow_redirects: typing.Union[bool, UseClientDefault] = USE_CLIENT_DEFAULT,
8785
) -> Response:
8886
if self._config.DEBUG:
8987
getattr(self, "debug_print")("get", *args) # noqa
@@ -96,7 +94,7 @@ async def get(
9694
cookies=cookies,
9795
)
9896
return await self._session.send(
99-
request=request, auth=auth, allow_redirects=allow_redirects, timeout=timeout
97+
request=request, auth=auth, follow_redirects=follow_redirects
10098
)
10199

102100

@@ -119,8 +117,7 @@ async def post(
119117
headers: HeaderTypes = None, # type: ignore[assignment]
120118
cookies: CookieTypes = None, # type: ignore[assignment]
121119
auth: typing.Union[AuthTypes, UseClientDefault] = USE_CLIENT_DEFAULT,
122-
allow_redirects: typing.Union[bool, UseClientDefault] = USE_CLIENT_DEFAULT,
123-
timeout: typing.Union[TimeoutTypes, UseClientDefault] = USE_CLIENT_DEFAULT,
120+
follow_redirects: typing.Union[bool, UseClientDefault] = USE_CLIENT_DEFAULT,
124121
) -> Response:
125122
if self._config.DEBUG:
126123
getattr(self, "debug_print")("post", *args, data=data) # noqa
@@ -135,7 +132,7 @@ async def post(
135132
content=content,
136133
)
137134
return await self._session.send(
138-
request=request, auth=auth, allow_redirects=allow_redirects, timeout=timeout
135+
request=request, auth=auth, follow_redirects=follow_redirects
139136
)
140137

141138

@@ -158,8 +155,7 @@ async def put(
158155
headers: HeaderTypes = None, # type: ignore[assignment]
159156
cookies: CookieTypes = None, # type: ignore[assignment]
160157
auth: typing.Union[AuthTypes, UseClientDefault] = USE_CLIENT_DEFAULT,
161-
allow_redirects: typing.Union[bool, UseClientDefault] = USE_CLIENT_DEFAULT,
162-
timeout: typing.Union[TimeoutTypes, UseClientDefault] = USE_CLIENT_DEFAULT,
158+
follow_redirects: typing.Union[bool, UseClientDefault] = USE_CLIENT_DEFAULT,
163159
) -> Response:
164160
if self._config.DEBUG:
165161
getattr(self, "debug_print")("put", *args, data=data) # noqa
@@ -174,7 +170,7 @@ async def put(
174170
params=params,
175171
)
176172
return await self._session.send(
177-
request=request, auth=auth, allow_redirects=allow_redirects, timeout=timeout
173+
request=request, auth=auth, follow_redirects=follow_redirects
178174
)
179175

180176

@@ -197,8 +193,7 @@ async def patch(
197193
headers: HeaderTypes = None, # type: ignore[assignment]
198194
cookies: CookieTypes = None, # type: ignore[assignment]
199195
auth: typing.Union[AuthTypes, UseClientDefault] = USE_CLIENT_DEFAULT,
200-
allow_redirects: typing.Union[bool, UseClientDefault] = USE_CLIENT_DEFAULT,
201-
timeout: typing.Union[TimeoutTypes, UseClientDefault] = USE_CLIENT_DEFAULT,
196+
follow_redirects: typing.Union[bool, UseClientDefault] = USE_CLIENT_DEFAULT,
202197
) -> Response:
203198
if self._config.DEBUG:
204199
getattr(self, "debug_print")("patch", *args, data=data) # noqa
@@ -213,7 +208,7 @@ async def patch(
213208
params=params,
214209
)
215210
return await self._session.send(
216-
request=request, auth=auth, allow_redirects=allow_redirects, timeout=timeout
211+
request=request, auth=auth, follow_redirects=follow_redirects
217212
)
218213

219214

@@ -232,8 +227,7 @@ async def delete(
232227
headers: HeaderTypes = None, # type: ignore[assignment]
233228
cookies: CookieTypes = None, # type: ignore[assignment]
234229
auth: typing.Union[AuthTypes, UseClientDefault] = USE_CLIENT_DEFAULT,
235-
allow_redirects: typing.Union[bool, UseClientDefault] = USE_CLIENT_DEFAULT,
236-
timeout: typing.Union[TimeoutTypes, UseClientDefault] = USE_CLIENT_DEFAULT,
230+
follow_redirects: typing.Union[bool, UseClientDefault] = USE_CLIENT_DEFAULT,
237231
) -> Response:
238232
if self._config.DEBUG:
239233
getattr(self, "debug_print")("delete", *args) # noqa
@@ -245,5 +239,5 @@ async def delete(
245239
params=params,
246240
)
247241
return await self._session.send(
248-
request=request, auth=auth, allow_redirects=allow_redirects, timeout=timeout
242+
request=request, auth=auth, follow_redirects=follow_redirects
249243
)

noxfile.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717

1818
package = "aiocloudflare"
19-
python_versions = ["3.9"]
20-
nox.needs_version = ">= 2021.6.6"
19+
python_versions = ["3.9", "3.10"]
20+
nox.needs_version = ">= 2021.10.1"
2121
nox.options.sessions = ("pre-commit", "safety", "mypy", "tests")
2222

2323

@@ -70,7 +70,7 @@ def activate_virtualenv_in_precommit_hooks(session: Session) -> None:
7070
hook.write_text("\n".join(lines))
7171

7272

73-
@session(name="pre-commit", python="3.9")
73+
@session(name="pre-commit", python="3.10")
7474
def precommit(session: Session) -> None:
7575
"""Lint using pre-commit."""
7676
args = session.posargs or ["run", "--all-files", "--show-diff-on-failure"]
@@ -90,7 +90,7 @@ def precommit(session: Session) -> None:
9090
activate_virtualenv_in_precommit_hooks(session)
9191

9292

93-
@session(python="3.9")
93+
@session(python="3.10")
9494
def safety(session: Session) -> None:
9595
"""Scan dependencies for insecure packages."""
9696
requirements = session.poetry.export_requirements()

poetry.lock

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
[tool.poetry]
22
name = "aiocloudflare"
3-
version = "0.2.0-beta-3"
3+
version = "0.2.1"
44
description = "A Cloudflare API wrapper for Python with asyncio support"
55
authors = ["Stewart Wong <[email protected]>"]
66
license = "MIT"
77
readme = "README.rst"
88
homepage = "https://github.com/stewart86/aiocloudflare"
99
repository = "https://github.com/stewart86/aiocloudflare"
1010
classifiers = [
11-
"Development Status :: 4 - Beta",
11+
"Development Status :: 5 - Production/Stable",
1212
"Intended Audience :: Developers",
1313
"Programming Language :: Python :: 3.9",
14+
"Programming Language :: Python :: 3.10",
1415
"Topic :: Software Development :: Libraries :: Python Modules",
1516
]
1617

1718
[tool.poetry.dependencies]
1819
python = "^3.9"
1920
python-dotenv = "^0.19.0"
20-
httpx = "^0.19.0"
21+
httpx = "^0.20.0"
2122

2223
[tool.poetry.dev-dependencies]
23-
isort = "^5.9.3"
24+
isort = "^5.10.0"
2425
flake8 = "^4.0.1"
2526
safety = "^1.10.3"
2627
mypy = "^0.910"

0 commit comments

Comments
 (0)