-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ryan Northey <[email protected]>
- Loading branch information
Showing
15 changed files
with
176 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
toolshed_package("aio.web") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
aio.web | ||
======= | ||
|
||
Web utils for asyncio. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.1.0-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
toolshed_library( | ||
"aio.web", | ||
dependencies=[ | ||
"//deps:reqs#abstracts", | ||
"//deps:reqs#aiohttp", | ||
"//deps:reqs#pyyaml", | ||
], | ||
sources=[ | ||
"abstract/__init__.py", | ||
"abstract/downloader.py", | ||
"__init__.py", | ||
"exceptions.py", | ||
"interface.py", | ||
"typing.py", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
from .abstract import ( | ||
ADownloader, | ||
AChecksumDownloader) | ||
from .interface import ( | ||
IDownloader, | ||
IChecksumDownloader) | ||
|
||
|
||
__all__ = ( | ||
"ADownloader", | ||
"AChecksumDownloader", | ||
"IDownloader", | ||
"IChecksumDownloader") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from .downloader import ADownloader, AChecksumDownloader | ||
|
||
|
||
__all__ = ( | ||
"ADownloader", | ||
"AChecksumDownloader", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
import abstracts | ||
|
||
from aio.web import interface | ||
|
||
|
||
@abstracts.implementer(interface.IDownloader) | ||
class ADownloader(metaclass=abstracts.Abstraction): | ||
pass | ||
|
||
|
||
@abstracts.implementer(interface.IChecksumDownloader) | ||
class AChecksumDownloader(ADownloader, metaclass=abstracts.Abstraction): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
from typing import Type | ||
|
||
import abstracts | ||
|
||
from aio.web import abstract | ||
|
||
|
||
@abstracts.implementer(abstract.ADownloader) | ||
class Downloader: | ||
pass | ||
|
||
|
||
@abstracts.implementer(abstract.AChecksumDownloader) | ||
class ChecksumDownloader: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
class ChecksumError(Exception): | ||
pass | ||
|
||
|
||
class DownloadError(Exception): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
import abstracts | ||
|
||
|
||
class IDownloader(metaclass=abstracts.Interface): | ||
|
||
@abstracts.interfacemethod | ||
async def download(self) -> int: | ||
"""Download content from the interwebs.""" | ||
raise NotImplementedError | ||
|
||
|
||
class IChecksumDownloader(IDownloader, metaclass=abstracts.Interface): | ||
|
||
@abstracts.interfacemethod | ||
async def checksum(self, content) -> int: | ||
"""Checksum some content.""" | ||
raise NotImplementedError |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
[metadata] | ||
name = aio.web | ||
version = file: VERSION | ||
author = Ryan Northey | ||
author_email = [email protected] | ||
maintainer = Ryan Northey | ||
maintainer_email = [email protected] | ||
license = Apache Software License 2.0 | ||
url = https://github.com/envoyproxy/toolshed/tree/main/aio.web | ||
description = A collection of functional utils for asyncio | ||
long_description = file: README.rst | ||
classifiers = | ||
Development Status :: 4 - Beta | ||
Framework :: Pytest | ||
Intended Audience :: Developers | ||
Topic :: Software Development :: Testing | ||
Programming Language :: Python | ||
Programming Language :: Python :: 3 | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: 3.9 | ||
Programming Language :: Python :: 3 :: Only | ||
Programming Language :: Python :: Implementation :: CPython | ||
Operating System :: OS Independent | ||
License :: OSI Approved :: Apache Software License | ||
|
||
[options] | ||
python_requires = >=3.8 | ||
py_modules = aio.web | ||
packages = find_namespace: | ||
install_requires = | ||
abstracts>=0.0.12 | ||
aiohttp | ||
pyyaml | ||
|
||
[options.extras_require] | ||
test = | ||
pytest | ||
pytest-asyncio | ||
pytest-coverage | ||
pytest-iters | ||
pytest-patches | ||
lint = flake8 | ||
types = | ||
mypy | ||
publish = wheel | ||
|
||
[options.package_data] | ||
* = py.typed | ||
|
||
[options.packages.find] | ||
include = aio.* | ||
exclude = | ||
build.* | ||
tests.* | ||
dist.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env python | ||
|
||
from setuptools import setup # type:ignore | ||
|
||
setup() |