diff --git a/adafruit_asyncio.py b/adafruit_asyncio.py deleted file mode 100644 index 83f96db..0000000 --- a/adafruit_asyncio.py +++ /dev/null @@ -1,35 +0,0 @@ -# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries -# SPDX-FileCopyrightText: Copyright (c) 2021 Dan Halbert for Adafruit Industries -# -# SPDX-License-Identifier: MIT -""" -`adafruit_asyncio` -================================================================================ - -Cooperative multitasking and asynchronous I/O - - -* Author(s): Dan Halbert - -Implementation Notes --------------------- - -**Hardware:** - -.. todo:: Add links to any specific hardware product page(s), or category page(s). - Use unordered list & hyperlink rST inline format: "* `Link Text `_" - -**Software and Dependencies:** - -* Adafruit CircuitPython firmware for the supported boards: - https://github.com/adafruit/circuitpython/releases - -.. todo:: Uncomment or remove the Bus Device and/or the Register library dependencies - based on the library's use of either. - -# * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice -# * Adafruit's Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register -""" - -# imports__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_asyncio.git" diff --git a/asyncio/__init__.py b/asyncio/__init__.py index 6268d0b..798b1a2 100644 --- a/asyncio/__init__.py +++ b/asyncio/__init__.py @@ -4,6 +4,12 @@ # # MicroPython uasyncio module # MIT license; Copyright (c) 2019 Damien P. George +# +# This code comes from MicroPython, and has not been run through black or pylint there. +# Altering these files significantly would make merging difficult, so we will not use +# pylint or black. +# pylint: skip-file +# fmt: off from .core import * diff --git a/asyncio/core.py b/asyncio/core.py index 7ba0fed..3a51727 100644 --- a/asyncio/core.py +++ b/asyncio/core.py @@ -4,6 +4,12 @@ # # MicroPython uasyncio module # MIT license; Copyright (c) 2019 Damien P. George +# +# This code comes from MicroPython, and has not been run through black or pylint there. +# Altering these files significantly would make merging difficult, so we will not use +# pylint or black. +# pylint: skip-file +# fmt: off from adafruit_ticks import ticks_ms as ticks, ticks_diff, ticks_add import sys, select diff --git a/asyncio/event.py b/asyncio/event.py index 0d692c9..346b974 100644 --- a/asyncio/event.py +++ b/asyncio/event.py @@ -4,6 +4,12 @@ # # MicroPython uasyncio module # MIT license; Copyright (c) 2019-2020 Damien P. George +# +# This code comes from MicroPython, and has not been run through black or pylint there. +# Altering these files significantly would make merging difficult, so we will not use +# pylint or black. +# pylint: skip-file +# fmt: off from . import core @@ -11,7 +17,9 @@ class Event: def __init__(self): self.state = False # False=unset; True=set - self.waiting = core.TaskQueue() # Queue of Tasks waiting on completion of this event + self.waiting = ( + core.TaskQueue() + ) # Queue of Tasks waiting on completion of this event def is_set(self): return self.state diff --git a/asyncio/funcs.py b/asyncio/funcs.py index 95baa8a..01fe551 100644 --- a/asyncio/funcs.py +++ b/asyncio/funcs.py @@ -4,6 +4,12 @@ # # MicroPython uasyncio module # MIT license; Copyright (c) 2019-2020 Damien P. George +# +# This code comes from MicroPython, and has not been run through black or pylint there. +# Altering these files significantly would make merging difficult, so we will not use +# pylint or black. +# pylint: skip-file +# fmt: off from . import core diff --git a/asyncio/lock.py b/asyncio/lock.py index e0d7c27..0a93872 100644 --- a/asyncio/lock.py +++ b/asyncio/lock.py @@ -4,6 +4,12 @@ # # MicroPython uasyncio module # MIT license; Copyright (c) 2019-2020 Damien P. George +# +# This code comes from MicroPython, and has not been run through black or pylint there. +# Altering these files significantly would make merging difficult, so we will not use +# pylint or black. +# pylint: skip-file +# fmt: off from . import core diff --git a/asyncio/manifest.py b/asyncio/manifest.py index 4ca6468..24082ff 100644 --- a/asyncio/manifest.py +++ b/asyncio/manifest.py @@ -2,6 +2,13 @@ # # SPDX-License-Identifier: MIT # +# +# This code comes from MicroPython, and has not been run through black or pylint there. +# Altering these files significantly would make merging difficult, so we will not use +# pylint or black. +# pylint: skip-file +# fmt: off + # This list of frozen files doesn't include task.py because that's provided by the C module. freeze( "..", diff --git a/asyncio/stream.py b/asyncio/stream.py index 4254a38..41baeb2 100644 --- a/asyncio/stream.py +++ b/asyncio/stream.py @@ -4,6 +4,12 @@ # # MicroPython uasyncio module # MIT license; Copyright (c) 2019-2020 Damien P. George +# +# This code comes from MicroPython, and has not been run through black or pylint there. +# Altering these files significantly would make merging difficult, so we will not use +# pylint or black. +# pylint: skip-file +# fmt: off from . import core @@ -83,7 +89,9 @@ async def open_connection(host, port): from uerrno import EINPROGRESS import usocket as socket - ai = socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM)[0] # TODO this is blocking! + ai = socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM)[ + 0 + ] # TODO this is blocking! s = socket.socket(ai[0], ai[1], ai[2]) s.setblocking(False) ss = Stream(s) diff --git a/asyncio/task.py b/asyncio/task.py index b755fee..2bc8bbd 100644 --- a/asyncio/task.py +++ b/asyncio/task.py @@ -4,6 +4,12 @@ # # MicroPython uasyncio module # MIT license; Copyright (c) 2019-2020 Damien P. George +# +# This code comes from MicroPython, and has not been run through black or pylint there. +# Altering these files significantly would make merging difficult, so we will not use +# pylint or black. +# pylint: skip-file +# fmt: off # This file contains the core TaskQueue based on a pairing heap, and the core Task class. # They can optionally be replaced by C implementations. diff --git a/docs/api.rst b/docs/api.rst index 984b1e6..b8c4c04 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -1,8 +1,12 @@ +:py:mod:`~asyncio` .. If you created a package, create one automodule per module in the package. .. If your library file(s) are nested in a directory (e.g. /adafruit_foo/foo.py) .. use this format as the module name: "adafruit_foo.foo" -.. automodule:: adafruit_asyncio +.. automodule:: asyncio :members: + +.. toctree:: + :hidden: diff --git a/setup.py b/setup.py index e3f6e55..586b121 100644 --- a/setup.py +++ b/setup.py @@ -57,10 +57,7 @@ ], # What does your project relate to? keywords="adafruit blinka circuitpython micropython asyncio async", - # You can just specify the packages manually here if your project is # simple. Or you can use find_packages(). - # TODO: IF LIBRARY FILES ARE A PACKAGE FOLDER, - # CHANGE `py_modules=['...']` TO `packages=['...']` - py_modules=["adafruit_asyncio"], + packages=["asyncio"], )