diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 22f6582..cb2f60e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,7 +71,7 @@ jobs: run: | pip install --upgrade build twine for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do - sed -i -e "s/0.0.0-auto.0/1.2.3/" $file; + sed -i -e "s/0.0.0+auto.0/1.2.3/" $file; done; python -m build twine check dist/* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d1b4f8d..f3a0325 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,7 +82,7 @@ jobs: TWINE_PASSWORD: ${{ secrets.pypi_password }} run: | for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do - sed -i -e "s/0.0.0-auto.0/${{github.event.release.tag_name}}/" $file; + sed -i -e "s/0.0.0+auto.0/${{github.event.release.tag_name}}/" $file; done; python -m build twine upload dist/* diff --git a/circuitpython_typing/__init__.py b/circuitpython_typing/__init__.py index 9b50468..ffa0a5a 100644 --- a/circuitpython_typing/__init__.py +++ b/circuitpython_typing/__init__.py @@ -11,7 +11,7 @@ * Author(s): Alec Delaney, Dan Halbert, Randy Hudson """ -__version__ = "0.0.0-auto.0" +__version__ = "0.0.0+auto.0" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_Typing.git" import array diff --git a/circuitpython_typing/http.py b/circuitpython_typing/http.py new file mode 100644 index 0000000..03cfdf9 --- /dev/null +++ b/circuitpython_typing/http.py @@ -0,0 +1,40 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022 Alec Delaney +# +# SPDX-License-Identifier: MIT + +""" +`circuitpython_typing.http` +=========================== + +Type annotation definitions for HTTP and related objects + +* Author(s): Alec Delaney +""" + +# Protocol was introduced in Python 3.8. +from typing_extensions import Protocol +from adafruit_requests import Response + + +class HTTPProtocol(Protocol): + """Protocol for HTTP request managers, like typical wifi managers""" + + def get(self, url: str, **kw) -> Response: + """Send HTTP GET request""" + ... + + def put(self, url: str, **kw) -> Response: + """Send HTTP PUT request""" + ... + + def post(self, url: str, **kw) -> Response: + """Send HTTP POST request""" + ... + + def patch(self, url: str, **kw) -> Response: + """Send HTTP PATCH request""" + ... + + def delete(self, url: str, **kw) -> Response: + """Send HTTP DELETE request""" + ... diff --git a/pyproject.toml b/pyproject.toml index 05cccfe..4babb73 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ requires = [ [project] name = "adafruit-circuitpython-typing" description = "Types needed for type annotation that are not in `typing`" -version = "0.0.0-auto.0" +version = "0.0.0+auto.0" readme = "README.rst" authors = [ {name = "Adafruit Industries", email = "circuitpython@adafruit.com"} diff --git a/requirements.txt b/requirements.txt index c945a5c..1e8c7bb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ typing_extensions~=4.0 adafruit-circuitpython-busdevice +adafruit-circuitpython-requests