Skip to content

Commit b9e4c42

Browse files
authored
Merge pull request #22 from tekktrik/dev/add-http-protocol
Add HTTPProtocol
2 parents 07db7a3 + cd7480f commit b9e4c42

File tree

6 files changed

+45
-4
lines changed

6 files changed

+45
-4
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
run: |
7272
pip install --upgrade build twine
7373
for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do
74-
sed -i -e "s/0.0.0-auto.0/1.2.3/" $file;
74+
sed -i -e "s/0.0.0+auto.0/1.2.3/" $file;
7575
done;
7676
python -m build
7777
twine check dist/*

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
TWINE_PASSWORD: ${{ secrets.pypi_password }}
8383
run: |
8484
for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do
85-
sed -i -e "s/0.0.0-auto.0/${{github.event.release.tag_name}}/" $file;
85+
sed -i -e "s/0.0.0+auto.0/${{github.event.release.tag_name}}/" $file;
8686
done;
8787
python -m build
8888
twine upload dist/*

circuitpython_typing/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Author(s): Alec Delaney, Dan Halbert, Randy Hudson
1212
"""
1313

14-
__version__ = "0.0.0-auto.0"
14+
__version__ = "0.0.0+auto.0"
1515
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_Typing.git"
1616

1717
import array

circuitpython_typing/http.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2022 Alec Delaney
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
"""
6+
`circuitpython_typing.http`
7+
===========================
8+
9+
Type annotation definitions for HTTP and related objects
10+
11+
* Author(s): Alec Delaney
12+
"""
13+
14+
# Protocol was introduced in Python 3.8.
15+
from typing_extensions import Protocol
16+
from adafruit_requests import Response
17+
18+
19+
class HTTPProtocol(Protocol):
20+
"""Protocol for HTTP request managers, like typical wifi managers"""
21+
22+
def get(self, url: str, **kw) -> Response:
23+
"""Send HTTP GET request"""
24+
...
25+
26+
def put(self, url: str, **kw) -> Response:
27+
"""Send HTTP PUT request"""
28+
...
29+
30+
def post(self, url: str, **kw) -> Response:
31+
"""Send HTTP POST request"""
32+
...
33+
34+
def patch(self, url: str, **kw) -> Response:
35+
"""Send HTTP PATCH request"""
36+
...
37+
38+
def delete(self, url: str, **kw) -> Response:
39+
"""Send HTTP DELETE request"""
40+
...

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ requires = [
1212
[project]
1313
name = "adafruit-circuitpython-typing"
1414
description = "Types needed for type annotation that are not in `typing`"
15-
version = "0.0.0-auto.0"
15+
version = "0.0.0+auto.0"
1616
readme = "README.rst"
1717
authors = [
1818
{name = "Adafruit Industries", email = "[email protected]"}

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55

66
typing_extensions~=4.0
77
adafruit-circuitpython-busdevice
8+
adafruit-circuitpython-requests

0 commit comments

Comments
 (0)