Testing shows that the first two writes always go through and the rest are
dropped, so update the .exp file to match that.
Signed-off-by: Damien George <damien@micropython.org>
This tests both encoding and decoding multiple 16-bit and 32-bit services
within the one advertising field.
Signed-off-by: Damien George <damien@micropython.org>
Fixes are needed to support the cases of:
- There may be more than one UUID per advertising field.
- The UUID advertising field may be empty (no UUIDs).
- Constructing 32-bit `bluetooth.UUID()` entities, which must be done by
passing in a 4-byte bytes object, not an integer.
Signed-off-by: Damien George <damien@micropython.org>
When multiple UUIDs of the same size are advertised, they should all be
listed in a single LTV. Supplement to the Bluetooth Core Specification,
Part A, §1.1.1: "A packet or data block shall not contain more than one
instance for each Service UUID data size."
When aioble construct the advertisement data, it is creating a new data
block for each UUID that contains only that single UUID. Rather than,
e.g., a single 16-bit UUID block with a list of multiple UUIDs.
Not only is this against the specification, it wastes two bytes of limited
advertisement space per UUID beyond the first for the repeated data block
length and type fields.
Fix this by grouping each UUID size together.
Signed-off-by: Trent Piepho <tpiepho@gmail.com>
The value for the `timeout_ms` optional argument to
`DeviceConnection.disconnected()` async method is changed from 60000 to
None. This way users awaiting a device disconnection using `await
connection.disconnected()` won't be surprised by a 1 minute timeout.
Only read from the temp characteristic if the connection is still active.
Improves the example by avoiding a TypeError exception if/when the sensor
disconnects.
This sets the disconnected timeout to None, so that the peripheral waits
forever for the client to disconnect. Previously the peripheral would
abort the connection after 60 seconds (because that's the default timeout).
Signed-off-by: Stephen More <stephen.more@gmail.com>
This ensures that the peripheral notifies subscribed clients when the
characteristic is written to.
Signed-off-by: Stephen More <stephen.more@gmail.com>
The function `binascii.b2a_base64()` returns a `bytes`, but here needs a
string. Otherwise, the value of `Sec-WebSocket-Key` in the headers will be
`b'<BASE64-ENCODED_RANDOM_VALUE>'`.
Signed-off-by: AuroraTea <1352685369@qq.com>
Mostly small cleanups to put each top-level import on its own line. But
explicitly disable the lint for examples/tests which insert the current
directory into the path before importing.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Most of these look like they were used for print debugging and then kept in
when the print statements were removed or commented.
Some look like missing or incomplete functionality, these have been marked
with comments where possible.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
It's no longer necessary since the built-in C version of this type now
implements all the functionality here.
Signed-off-by: Matt Trentini <matt.trentini@gmail.com>
These packages build on top of machine.USBDevice() to provide high level
and flexible support for implementing USB devices in Python code.
Additional credits, as per included copyright notices:
- CDC support based on initial implementation by @hoihu with fixes by
@linted.
- MIDI support based on initial implementation by @paulhamsh.
- HID keypad example based on work by @turmoni.
- Everyone who tested and provided feedback on early versions of these
packages.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
axtls doesn't define all the CERT_xxx constants, nor the MBEDTLS_VERSION
constant.
This change means that `tls.SSLContext` is imported into the module, but
that's subsequently overridden by the class definition in this module.
Signed-off-by: Damien George <damien@micropython.org>
Changes are cosmetic - and maybe very minor code size - but not functional.
_reg_read() was calling struct.packinto() with an incorrect number of
arguments but it seems like MicroPython didn't mind, as result is correct
for both versions.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
If send completes before the first call to poll_send(), the driver could
get stuck in _sync_wait(). This had much less impact before rp2 port went
tickless, as _sync_wait(will_irq=True) calls machine.idle() which may not
wake very frequently on a tickless port.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
According to the docs, only freq_khz was needed for working output.
However:
- Without output_power setting, no output from SX1262 antenna (theory:
output routed to the SX1261 antenna).
- SF,BW,etc. settings were different from the SX127x power on defaults, so
modems with an identical configuration were unable to communicate.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
- Fix binary data `Content-type` header and data `Content-Length`
calculation.
- Fix query length when data is included.
- Fix `json` and `text` methods of `ClientResponse` to read
`Content-Length` size
Signed-off-by: Carlos Gil <carlosgilglez@gmail.com>
MicroPython now supplies SSL/TLS functionality in a new built-in `tls`
module. The `ssl` module is now implemented purely in Python, in this
repository. Other libraries are updated to work with this scheme.
Signed-off-by: Felix Dörre <felix@dogcraft.de>
There don't seem to be any MQTT implementations that expect an empty
username (instead of the field missing), so the check for unused `user` can
be simplified.
Signed-off-by: Felix Dörre <felix@dogcraft.de>
Implement `aiohttp` with `ClientSession`, websockets and `SSLContext`
support.
Only client is implemented and API is mostly compatible with CPython
`aiohttp`.
Signed-off-by: Carlos Gil <carlosgilglez@gmail.com>
Allows modifying current line, adding/deleting characters in the middle
etc. Includes home/end keys to move to start/end of current line.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
This is the last remaining use of the "options" feature. Nothing in the
main repo which `require()`'s this package sets it.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
- Add config for [tool.ruff.format] to pyproject.toml.
- Update pre-commit to run both ruff and ruff-format.
- Update a small number of files that change with ruff's rules.
- Update CI.
- Simplify codeformat.py just forward directly to "ruff format"
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This adds verifygitlog.py from the main repo, adds it to GitHub workflows,
and also pre-commit.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
PCRE is marked as EOL and won't receive any new security update.
Convert the re module to PCRE2 API to enforce security. Additional
dependency is now needed with uctypes due to changes in how PCRE2 return
the match_data in a pointer and require special handling.
The converted module is tested with the test_re.py with no regression.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
The `--format` flag was changed to `--output-format` in the recent update.
Pin to this version to prevent further updates from breaking (e.g. through new rules or other changes).
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Chunked detection does not work as generators never have an `__iter__`
attribute. They do have `__next__`.
Example that now works with this commit:
def read_in_chunks(file_object, chunk_size=4096):
while True:
data = file_object.read(chunk_size)
if not data:
break
yield data
file = open(filename, "rb")
r = requests.post(url, data=read_in_chunks(file))
Previously a BufferedCharacteristic could only be read by the client, where
it should have been writeable. This makes it support all ops (read / write
/ write-with-response, etc).
Adds a test to check the max_len and append functionality of
BufferedCharacteristic.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
In micropython/micropython#11239 we added support for passing data to
gatts_indicate (to make it match gatts_notify).
This adds the same to aioble.
Also update the documentation to mention this (and fix some mistakes and
add a few more examples).
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
- If no reset pin was set, calling standby() in the constructor
would enable the TCXO (XOSC) before the timeout was correctly set.
- This manifested as a BUSY timeout on the STM32WL5, first time after power
on reset.
- Clean up the general handling of BUSY timeouts, but also add some safety
margin to the base timeout just in case (not an issue, is only a stop-gap
to prevent the modem blocking indefinitely.)
Signed-off-by: Angus Gratton <angus@redyak.com.au>
For unknown reason, power output in this configuration is lower than it
should be (including when compared to the STM32Cube C libraries running on
the same board.
Suspect either the Nucleo board antenna switch or the power amplifier
registers are being set wrong, but the actual root cause remains elusive...
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Support depends on hardware support in MicroPython.
Also includes some tweaks in the SX126x base class, to deal with slightly
different platform configuration on STM32WL55, longer timeouts, tx_ant
options, etc.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Also adds some global ignores for manifest files (which have implicit
imports) and the multitests (which have the same).
Other F821 fixes or accommodations are in the parent commits to this
commit.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
As-written this code is unreachable (return statement two line above),
so this change is really just to make the linter happy.
Found by Ruff checking F821.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
This is a change just to make the linter happy, the code
probably would have run OK without it.
Found by Ruff checking F821.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
These were probably intentional missing names, however raising
NotImplementedError or KeyError is more explicit than trying to call an
unknown function.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Looks like copy-pasta from bmi270 driver.
There is a soft reset capability documented in the BMM150 datasheet, but it
uses different register bits and I don't have a BMM150 at hand to test it.
Found by Ruff checking F821.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Result message from servers pre version 3.2 do not encode start or end
time, so workaround this by using the t3, t0 timestamps used elsewhere for
sending.
Fixes issue #665.
This was added to speed up running codeformat.py when only a small number
of files are changed, but it breaks running the tool on the master branch.
The pre-commit tool handles this correctly, and it's working well in the
main repo, so we can remove the special handling.
This makes codeformat.py behave identically to the main repository, but
without additional code for handling .c/.h files.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This is a replacement for the `zlib` module that used to be built-in and
has been replaced by the MicroPython-specific `deflate` module.
Also updates the `gzip` module in a similar fashion and provide the
`gzip.GzipFile` class and `gzip.open` function.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
- For packages that were just x.y, update to x.y.0.
- For that were x.y.z-n, update to x.y.(z+1)
From now on we'll apply semver rules:
- MAJOR version when you make incompatible API changes
- MINOR version when you add functionality in a backward compatible manner
- PATCH version when you make backward compatible bug fixes
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This module implements a subset of the Python requests module, and so
it should have the same name.
Added a backwards-compatibility wrapper to allow people to continue to use
`import urequests`. This lives in micropython/urequests.
Changed requests to be a package, so that we can implement extension
packages in the future for optional functionality.
Added a basic README.md to both.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
With the recent MicroPython change to remove the u prefix by default on
builtins (micropython/micropython#11740) the format checker in fnmatch
which was detecting ure no longer works.
This commit updates the module to filter the regex automatically as needed.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
It is inserted automatically during publish/freezing and having them in the
code prevents the automatic process from happening.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
f-strings aren't enabled on all builds (e.g. low-flash ESP8266).
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit allows you to pass an exception object in as the exc_info kwarg
(CPython allows this), so logging exceptions can work even if the
MICROPY_PY_SYS_EXC_INFO option is disabled in the firmware.
Separately to that, currently even when sys.exc_info() is enabled, it's
only printing the traceback to _stream = sys.stderr - not to the configured
logging handlers. This means for instance if you've got a file log
handler it misses out on the tracebacks. That's also fixed in this commit.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
Due to changes in MicroPython to support PEP-479, StopIteration has been
deprecated for return. This results in xmltok to raise RuntimeError every
time. This commit is a simple fix to just change from StopIteration to
EOFError and then return it in the generator.
Even though we now have a `string` module, just keep the existing
IDENTCHARS definition.
- If someone doesn't already have string installed (or aren't otherwise
importing it), this would add an extra dependency and more memory used.
- If they do, then the resulting concatenated string has to be allocated
separately, so there's no gain from using the string.x components.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
For reading, the size is always terminated by a null, so just ignore it by
using 11 for the uctypes entry (this fixes a regression introduced in
7128d423c2).
For writing, the size must always be terminated by a null.
Signed-off-by: Damien George <damien@micropython.org>
This splits out each algorithm into its own extension package, so that only
the necessary algorithms can be installed.
This allows for a significant reduction in RAM and flash. i.e. previously
installing hashlib meant that all algorithms were imported.
Additionally ensures that any built-in hash algorithms (from uhashlib) are
still exposed (e.g. `md5`), and retains the existing behavior to use the
built-in preferentially.
Also includes a refactoring of the algorithms to reduce code size and
reduce the number of allocations they do as well as using bytearrays in
place of list-of-int where possible.
Add more comprehensive tests (using unittest).
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Includes:
- component oriented driver, to only install the parts that are needed
- synchronous operation
- async wrapper class for asynchronous operation
- two examples with async & synchronous versions
- documentation
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
This adds a utarfile-write extension package that adds the ability to
create and append to tar files.
Work done by Doug Ellis <dpwe@ee.columbia.edu>.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Removes the workaround for micropython/issues/6864.
Sets the default flags for discovered descriptors to be WRITE,
so that d.write() will implicitly set response=True.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This tool makes a buildable package (including pyproject.toml) from
supported micropython-lib packages, suitable for publishing to PyPI and
using from CPython.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This is so the package knows the "upstream" name of the corresponding PyPI
package that it's based on.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Prior to this commit, if no tests were found when running unittest discover
then nothing at all was written to stdout, leading one to think it's not
working at all. CPython unittest does display a "0 tests run" sort of
output in such a case, and this commit ensures this package does the same.
Opt-in feature to make it easier for folks to test packages that are still
in development, open in Pull Requests, or even in independent forks.
---
To enable this on your own GitHub fork of the micropython-lib repository
then navigate to the fork's "Settings" -> "Secrets and variables" ->
"Actions" -> "Variables" page, then click "New repository variable", and
create a variable named MIP_INDEX with value true (or any "truthy" value).
Once enabled then any time a branch is pushed to your fork and builds
successfully, GitHub Actions will also push the built packages and package
index to the gh-pages branch which is associated with the repo's GitHub
Pages web site. The packages can then be installed remotely via:
mpremote mip --index \
https://USERNAME.github.io/micropython-lib/mip/BRANCH_NAME PACKAGE_NAME
or on a device as:
mip.install(PACKAGE_NAME, index="https://USERNAME.github.io/micropython-lib/mip/BRANCHNAME")
(Replace USERNAME, BRANCH_NAME and PACKAGE_NAME as applicable. If you've
renamed your fork, change the name micropython-lib to match.)
Note: As well as the MIP_INDEX repository variable, this functionality
depends on both GitHub Actions and GitHub Pages being enabled on your
repository in GitHub. However both options should enable automatically,
unless they have been manually disabled.
This work was funded through GitHub Sponsors.
This is designed to be a common set of packages that all deployments with
networking support should include.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This is not included by default in most builds, and isn't necessary for
this module anyway.
Also fix the local variable shadowing the traceback module in _capture_exc.
Added test for both (works on CPython and MicroPython).
Version bump to 0.10.2.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Adds missing "duration_ms" argument to the example, and a second example
that shows the "interval_us" / "window_us" and also active scan.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Previously a child logger just uses the global default when unset.
Modified to matches the CPython behavior of using the parent's level.
Also implemented CPython's getEffectiveLevel() which provides a convenient
way to implement this. In our version, we only ever have one parent
(the root), so it only has to recurse one level.
Also set the default level to WARNING to match CPython.
Updated the examples to highlight the differences (but they now match).
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
* Add instructions for how to use micropython-lib.
* Add a terminology guide and use consistent terminology
(package/module/library).
* Improve code conventions and contributor guidelines.
* Misc readme updates.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Add support for all format specifiers, support for `datefmt` using
(optional) strftime, and support for Stream and File handlers.
Ports/boards that need to use `FileHandlers` should enable
`MICROPY_PY_SYS_ATEXIT`, and enabled `MICROPY_PY_SYS_EXC_INFO` if using
`logging.exception()`.
This adds most of the common functionality of pathlib.Path.
The glob functionality could use some work; currently it only supports a
single "*" wildcard; however, this is the vast majority of common use-cases
and it won't fail silently if non-supported glob patterns are provided.
Use explicit pin numbers to instantiate the SPI interface on RP2.
On ESP32 use SoftSPI(...) rather than SPI(-1, ...).
Update terminology to initiator/responder.
Tested with two Pico boards.
Originally by @peterhinch.
See https://github.com/micropython/micropython/pull/6007 for discussion.
The summary is that on some cards (especially older Kingston ones) if the
bus is shared with other SPI devices, then it seems to require that MISO
is high for a few cycles before the transaction is initiated.
Because CS is high, this change should otherwise be a no-op.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This allows a much more natural way of implementing unitttest-discover:
- unittest provides unittest/__init__.py
- unittest-discover provides unittest/__main__.py
It also fixes an bug where unittest.py previously detected the presence of
unittest-discover.py by importing an checking for the ImportError. But that
could also be raised by a missing dependency. Now when you run
`micropython -m unittest` without unittest-discover, you get
`ImportError: no module named 'unittest.__main__'`, and without the
required deps, `ImportError: no module named 'argparse'`.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Works like "python -m venv path" and creates a rudimentary virtual
environment for the Unix port:
- sets MICROPYPATH
- copies the micropython binary to venv/bin/micropython which is in $PATH
- installs mip & mip-cmdline in the venv
Using the venv is the same as for CPython -- source the activate script to
enter, and call the deactivate function to leave.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Moves mip.py to mip/__init__.py, so that the optional (added in this
commit) mip/__main__.py can exist to support:
`micropython -m mip install [--target,--index,--no-mpy] package@version`
"install" works by forwarding the arguments directly to mip.install.
Updates mip to v0.2.0 because of the change in directory structure.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Duplicate Ctrl-C and LF detection requires this, but it was incorrectly
saving the current value, not the previous.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
The regular REPL uses the uncooked input, but aiorepl reads from sys.stdin
which is cooked. The result is that if the client sends a CRLF, aiorepl
will see LFLF.
This ignores a second LF in quick succession from the first.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
- `_FLAG_WRITE` was incorrectly `_FLAGS_WRITE`
- `response` should be defaulted to `None` rather than `False` in order
to detect that when it is unspecified.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This tool implements a subset of the ESP32 ROM bootloader protocol, and
it's mainly intended for updating Nina WiFi firmware from MicroPython, but
can be used to flash any ESP32 chip.
Check the machine module first, then search in previous places. This
supports having machine.dht_readinto as the new standard, while still being
backwards compatible.
This replaces the options that could be specified previously to include
and require.
The `aioble` package now provides everything. For a minimal install, the
individual components can now be installed or require()'ed explicitly.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
After `reconnect()`, MQTTClient.socket is blocking by default, and
check_msg() can block. This commit aims to fix that behaviour by
reimplementing `check_msg()` for umqtt.robust and setting the socket to
non-blocking.
Fixes issue #192.
The statement "with assertRaises(errtype) as ctxt" checks the type of a
raised exception, but did not store the exception into ctxt like unittest
of CPython. The exception instance is usually used to check its message or
other args.
Riffing on "pip", "mip installs packages".
This is a replacement for the previous `upip` tool for on-device
installation of packages.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This populates https://micropython.org/pi/v2 with compiled packages,
suitable for use by `mip` and `mpremote`.
This work was funded through GitHub Sponsors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This replaced the per-characteristic queues with a single shared queue,
which means that the characteristics will return from `written()` in the
exact order that the original writes arrived, even if the writes are
occuring across multiple different characteristics.
This work was funded by Planet Innovation.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This provides an async REPL with the following features:
- Run interactive REPL in the background.
- Execute statements using await.
- Simple history.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
In order to make this more suitable for non-unix ports, the discovery
functionality is moved to a separate 'extension' module which can be
optionally installed.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Although this primarily makes sense for the unix port, there's nothing
preventing it being used on any port, and it's written for MicroPython.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
The `bluetooth` module replaced the def_handle field with end_handle
in the characteristic result IRQ. Use this when querying for
descriptors.
In the case where this is not available (older versions of micropython)
continue the existing behavior of searching just past the value handle,
although decrease this to +2 to avoid finding other characteristic's
descriptors.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
With the dependencies captured in manifest.py, several packages in
python-stdlib were still unix-only due to direct or transitive dependencies
on unix-only or ffi modules. Or they just make no sense to run on
microcontroller targets.
In a few cases (e.g. base64) where possible, the unix dependency could be
removed.
Updates manifest.py to use the `unix_ffi=True` arg to `require()` for these
libraries.
Rename re-pcre to re now that unix-ffi is effectively its own namespace.
Update unix-ffi/README.md, and strengthen the wording that the unix
libraries are unmaintained.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Uses the new require()/package()/module() functions from manifestfile.py.
Add manifest.py for iperf3 and pyjwt.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This is unmaintained and not the one installed by default on boards
(see github.com/micropython/micropython/blob/master/tools/upip.py).
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2015-01-01 07:45:46.790 INFO Received OLCP_OP_FIRST
2015-01-01 07:45:46.979 ERROR Error in ble_write_listener
Traceback (most recent call last):
File "aioble/server.py", line 223, in indicate
NameError: name 'GattError' isn't defined
This library was non-functional unless used with the micropython-lib
pure-Python implementation of hashlib, even if the device provides
sha1 and sha256.
This updates hmac to be significantly more RAM efficient (removes the
512-byte table), and functional with the built-in hash functions.
The only unsupported function is "copy", but this is non-critical, and now
fails with a NotSupportedError.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
On the ESP32, socket.getaddrinfo() might return SOCK_DGRAM instead of
SOCK_STREAM, eg with ".local" adresses. As a HTTP request is always a TCP
stream, we don't need to rely on the values returned by getaddrinfo.
Even though we use HTTP 1.0, where closing connection after sending
response should be the default, some servers ignore this requirement and
keep the connection open. So, explicitly send corresponding header to get
the expected behavior.
This is controlled by parse_headers param to request(), which defaults to
True for compatibility with upstream requests. In this case, headers are
available as .headers of Response objects. They are however normal (not
case-insensitive) dict.
If parse_headers=False, old behavior of ignore response headers is used,
which saves memory on the dict.
Finally, parse_headers can be a custom function which can e.g. parse only
subset of headers (again, to save memory).
Without this change, current implementaiton produces a false positive
result for AssertionError type.
Example of falsely passing test code:
def test(a, b):
assert a > 10
assert b > 10
self.assertRaises(AssertionError, test, 20, 20)
A number of fields (services, appearance, manufacturer, name) can appear
when a scan is requested. However there is only so much space in the
header so, if a user has configured multiple fields, some may be 'pushed'
into the active scan response which requires additional communication.
When iOS scans for BLE devices it can filter by services, and so services
must be in the advertising (as opposed to scan response) payload.
- cp() copies a file. If the target is a directory, the file is copied
into that directory. It uses a small buffer, so it's not fast.
- ls uses ilistdir and creates a sorted output with directories listed as
the first group.
- rm optionally deletes recursive, if the target is a directory.
It can be difficult using the codeformat.py tool when there are other files
in the repository not currently matching the standard.
For developers, running over the entire repo can throw up a large list of
changes in a local git which can lead to inclusion of unrelated changes in
commits if they're added accidentally. If the files arg is used to trim
down the list of files scanned, it runs a risk of missing some files
they've modified. In CI, it means that PR's can fail on codeformat for
issues that aren't related to that PR.
This change adds a git query in the codeformat tool by default to only work
on the list of files that have been modified in the current branch. This
can still be overridden by the files arg to run over all files still, eg.
python3 tools/codeformat.py -v '**'.
This new module is a port of Python datetime providing classes for
manipulating dates, times, and deltas. It completely replaces the existing
unix-ffi version.
Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
Allows `await channel.disconnected()`.
This also fixes a bug where connection._l2cap_channel wasn't being set to
None on disconnect.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This replicates the failure described in #453 (which is fixed by #459.
Also adds a test for subscription.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This allows a server to write a characteristic and automatically
notify/indicate all subscribed clients.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
After a client does a successful `await char.notified()`, then before the
next call to `notified()` a notification arrives, then they call
`notified()` twice before the _next_ notification, the second call will
return None rather than waiting.
This applies the same fix as in 5a86aa5866
which solved a similar problem for server-side `char.written()`. Using
a deque is slightly overkill here, but it's consistent with the server
side, and also makes it very easy to support having a notification queue
in the future.
Also makes the client characteristic properly flags/properties-aware (i.e.
explicitly fail operations that aren't supported).
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This fixes a bug where an incoming write before `written` is awaited causes
`written` to return None. It also introduces a mechanism for a server to
"capture" all incoming written values (instead of only having access to the
most recent value).
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Any custom handlers will be passed a LogRecord instance which has members
and a dict with "levelname", "message" and "name", to be used for creating
a log message. The handler list is a global singleton so that sub-logging
objects all use the same set of (root) handlers.
The name of the root handler is also changed from None to "root", to match
CPython.
Signed-off-by: Damien George <damien@micropython.org>
Instead of using single priority queue for all tasks, split into using
"run queue", which represents tasks not waiting until specific time,
which should be run on every (well, next) loop iteration, and wait queue,
still a priority queue. Run queue is a simple FIFO, implemented by
ucollections.deque, recently introduced in pfalcon/micropython. Thus,
there's minimal storage overhead and intrinsic scheduling fairness.
Generally, run queue should hold both a callback/coro and its arguments,
but as we don't feed any send args into coros still, it's optimized to
hold just 1 items for coros, while 2 for callbacks.
Introducing run queue will also allow to get rid of tie-breaking counter
in utimeq implementation, which was introduced to enforce fair scheduling.
It's no longer needed, as all tasks which should be run at given time
are batch-removed from wait queue and batch-inserted into run queue. So,
they may be executed not in the order scheduled (due to non-stable order
of heap), but the whole batch will be executed "atomically", and any new
schedulings from will be processed no earlier than next loop iteration.
This is convenient when components need only to parse a subset of an
application's arguments, and can be implemented with minor changes to
_parse_args: basically just add unknown arguments to a list instead of
raising an exception.
During development, following questions were posed, and subsequently,
answered:
Q #1: Should this be in uasyncio package at all? Upstream doesn't have
this. Pro: will be easier for people do discover (see e.g.
https://github.com/micropython/micropython-lib/issues/148)
A: uasyncio diverges more and more from asyncio, so if something is
convinient for uasyncio, there's no need to look back at asyncio.
Q #2: This provides implements 2 ways to create a WS connections:
1) using start_ws_server(); 2) using wrapping existing StreamReader
and StreamWriter. History: initial prototype of course used 2). But
the idea was "it should be like the official start_server()!!1". But
then I though how to integrate it e.g. with Picoweb, and became clear
that 2) is the most flixble way. So, 1) is intended to be removed.
A: 1) was removed and is not part of the merged version of the patch.
Q #3: Uses native websocket module for read path, but has own
write path due to https://github.com/micropython/micropython/issues/3396
A: So far, so good.
Q #4: Requires https://github.com/micropython/micropython-lib/pull/227
due to https://github.com/micropython/micropython/issues/3394 .
A: The prerequisite was merged.
To use address as returned by getaddrinfo(), we should create a socket
compatible with address family, etc., returned by the same call alongside
the address itself.
To use address as returned by getaddrinfo(), we should create a socket
compatible with address family, etc., returned by the same call alongside
the address itself.
To use address as returned by getaddrinfo(), we should create a socket
compatible with address family, etc., returned by the same call alongside
the address itself.
E.g. "HTTP/1.1 500". RFC7230 seems to formally require at least a space
after the numeric code, but it was reported that some software sends
lines like above nonetheless.
Ref: https://github.com/micropython/micropython-lib/issues/247
E.g. "HTTP/1.1 500". RFC7230 seems to formally require at least a space
after the numeric code, but it was reported that some software sends
lines like above nonetheless.
Ref: https://github.com/micropython/micropython-lib/issues/247
E.g. "HTTP/1.1 500". RFC7230 seems to formally require at least a space
after the numeric code, but it was reported that some software sends
lines like above nonetheless.
Ref: https://github.com/micropython/micropython-lib/issues/247
Arguments whose values are the default are not passed to ussl, because
many arguments are not accepted by current ussl implementations, even
if the desired behavior is the same as when they are omitted.
This also adds CancelledError exception and makes TimeoutError be a
subclass of it. As well as adds default exception handler for it in
the eventloop (which just skips re-adding this coro to the scheduling
queue, as expected).
This module implements "Sans I/O" approach, where packets are created/
parsed using BytesIO objects, and all networking happens outside the
module.
The module implements enough functionality to resolve a domain name
into IP address, for both IPv4 and IPv6.
Other DNS functionality is outside the scope of this module, that's
why it's called *u*dnspkt.
The API is experimental and subject to change.
This module requires .readbin()/.writebin() methods on a stream.
Don't have any wrapper classes for UDP socket, instead just have top-level
coroutines, taking raw socket as an argument:
s.recv(1500) => await uasyncio.udp.recv(s, 1500)
Coros which are passed to .add_reader()/.add_writer() are marked as
I/O-bound using .pend_throw(False). Before scheduling it for normal
execution again, we need to unmark it with .pend_throw(None).
Coros which removed from normal scheduling queue (and possibly put into
another queue, like I/O queue here) are marked with .pend_throw(False).
If wait_for() cancels such a coro, it is explicitly scheduled for execution,
so they actually could process pending exception (coro's exception handler
should take care of removing it from another queue and related clean up).
Unlike optimize_upip, which instantiates a separate distutils/setuptools
command to run after "sdist", sdist_upip overrides "sdist" implementation,
so it simplifies publishing workflow (no need to run adhoc commands).
Besides what optimize_upip did (post-porocessing to remove superfluous
files and recompressing with gzip 4K dictionary), sdist_upip also
adds pre-processing step of generation resource module (R.py) from
resource files.
So, now there's a single (and standard) command to generate a distrubution
package for MicroPython.
It performs handshake in blocking manner, hopes that writes
work without short writes, and hopes that non-blocking read
is implemented properly by ussl module (there're known issues
with axTLS module for example).
Currently executed task is a top-level coroutine scheduled in the event
loop (note that sub-coroutines aren't scheduled in the event loop and
are executed implicitly by yield from/await, driven by top-level coro).
API is not stable and will guaranteedly change, likely completely.
Currently, this tries to folow the same idea as TCP open_connection()
call, but that doesn't make much sense, so that will likely change.
The idea behind this implementation is that getrandbits() is guaranteed
(required) to be equally distributed. Thus, we can just repeatedly
sample it until get a suitable value, there's no bias accumulated and
the process should be finite (and on average take few iterations).
Poll socket is what's passed to uselect.poll(), while I/O socket is what's
used for .read(). This is a workaround of the issue that MicroPython doesn't
support proxying poll functionality for stream wrappers (like SSL, websocket,
etc.)
This issue is tracked as https://github.com/micropython/micropython/issues/3394
It may be that it's more efficient to apply such a workaround on uasyncio
level rather than implementing full solution of uPy side.
POLLHUP/POLERR may be returned anytime (per POSIX, these flags aren't
even valid in input flags, they just appear in output flags). Subsequent
I/O operation on stream will lead to exception. If an application
doesn't do proper exception handling, the stream won't be closed, and
following calls will return POLLHUP/POLLERR status again (infinitely).
So, proactively unregister such a stream.
This change is questionable, because apps should handle errors properly
and close the stream in such case (or it will be leaked), and closing
will remove the stream from poller too.
But again, if that's not done, it may lead to cascade of adverse effects,
e.g. after eef054d98, benchmark/test_http_server_heavy.py regressed and
started and started to throw utimeq queue overflow exceptions. The story
behind it is: Boom benchmarker does an initial probe request to the app
under test which it apparently doen't handle properly, leading to
EPIPE/ECONNRESET on the side of the test app, the app didn't close the
socket, so each invocation to .wait() resulted in that socket being
returned with POLLHUP again and again. Given that after eef054d98, .wait()
is called on each even loop iteration, that create positive feedback in
the queue leading to it growing to overflow.
yield False won't reschedule current coroutine to be run again. This is
useful when coro is put on some waiting queue (and is similar to what
yield IORead/yield IOWrite do).
If there is a coroutine to run immediately (with wait delay <= 0),
uasyncio.core never called .wait() method, which is required to
process I/O events (and schedule coroutines waiting for them). So
now, call .wait(0) even if there's a coroutine to run immediately.
If there is a coroutine to run immediately (with wait delay <= 0),
uasyncio.core never calls .wait() method, which is required to
process I/O events (and schedule coroutines waiting for them).
This test demonstrates the problem.
The <int>.to_bytes(...) function requires two arguments. The first
specifies the number of bytes to return, and the second specifies the
endianness of those bytes. By definition, Base64 encoding is big
endian.
This incorrect behavior was a result of the function that performs
table-driven byte translation. The function first used the chr(...)
function to convert each resulting byte, represented as an integer,
to a string of length one. Then, the <str>.encode(...) function was
used to convert the string to a byte string with an intended length
of one. That didn't work well for bytes with high bit set, as they
were trated as UTF-8 chars. Instead, perform operations directly on
bytes.
This was an artifact of porting this to MicroPython, as the original
CPython module uses bytes.translate(...) method (not available in
uPy).
set_debug() from uasyncio.core doesn't have effect on the main uasyncio
package, so let them both have set_debug() function, and allow to enable
debug logging independently.
Use MicroPython .write() extension of passing offset/size to efficiently
spool buffers larger than socket output buffer. Also, make awrite()
accept these params too.
uasyncio uses different timebase than CPython's asyncio, so absolute
time scheduling compatible with it is impossible. Instead, there's
call_at_() which schedules using modular millisecond time.
We should include files by default, as a package may contain arbitrary
files, e.g. as resources. So, rework inclusion/exlusion logic to work
using incremental refinement.
wait() may finish prematurely due to I/O completion, and schedule new,
earlier than before tasks to run. So, after call to wait(), we need to
check current time and time of head task, and continue to wait if needed.
Recently introduced provisional utimeq.peektime() is used to optimize
querying time of a head task.
When using the POST method you get the Location of the new
object in a Location header but it's not a redirect.
For details see for example RFC2616 10.2.2 and 10.2.3
Specifically, that a coroutine scheduled to run at some time (after some
delay) waits requested time before it's run and not run prematurely in
case an I/O completion happens before it.
The default queue length is set to take under 0.5K RAM on 32-bit system.
A queue length can be passed to get_event_loop() to override it. This
change follows similar change in uasyncio.core.
Otherwise, "in" operation uses list protocol (enumeration using
__getitem__, which adds a key/value pair to teh underlying dict)
and ends with memory overflow.
Allows zero-allocation scheduling of tasks. As long as tasks don't use
await/yield from with coroutines, and don't allocate memory themselves,
there will be no allocation and GC.
Make this deducing friendly to baremetal systems by falling back to
sys.path if os.getenv() is not available (sys.path[1] is used as
an install path in this case).
Utilising retained messages and multiple subscribes, a message could
arrive before the SUBACK packet. Therefore, wait_msg() must be called
in subscribe().
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-future',
version='0.0.2',
description='Dummy __future__ module for MicroPython',
long_description='This is a dummy implementation of a module for MicroPython standard library.\nIt contains zero or very little functionality, and primarily intended to\navoid import errors (using idea that even if an application imports a\nmodule, it may be not using it onevery code path, so may work at least\npartially). It is expected that more complete implementation of the module\nwill be provided later. Please help with the development if you are\ninterested in this module.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-_markupbase',
version='3.3.3',
description='CPython _markupbase module ported to MicroPython',
long_description='This is a module ported from CPython standard library to be compatible with\nMicroPython interpreter. Usually, this means applying small patches for\nfeatures not supported (yet, or at all) in MicroPython. Sometimes, heavier\nchanges are required. Note that CPython modules are written with availability\nof vast resources in mind, and may not work for MicroPython ports with\nlimited heap. If you are affected by such a case, please help reimplement\nthe module from scratch.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-abc',
version='0.0.0',
description='Dummy abc module for MicroPython',
long_description='This is a dummy implementation of a module for MicroPython standard library.\nIt contains zero or very little functionality, and primarily intended to\navoid import errors (using idea that even if an application imports a\nmodule, it may be not using it onevery code path, so may work at least\npartially). It is expected that more complete implementation of the module\nwill be provided later. Please help with the development if you are\ninterested in this module.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-argparse',
version='0.3.2',
description='argparse module for MicroPython',
long_description="This is a module reimplemented specifically for MicroPython standard library,\nwith efficient and lean design in mind. Note that this module is likely work\nin progress and likely supports just a subset of CPython's corresponding\nmodule. Please help with the development if you are interested in this\nmodule.",
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-base64',
version='3.3.3-2',
description='CPython base64 module ported to MicroPython',
long_description='This is a module ported from CPython standard library to be compatible with\nMicroPython interpreter. Usually, this means applying small patches for\nfeatures not supported (yet, or at all) in MicroPython. Sometimes, heavier\nchanges are required. Note that CPython modules are written with availability\nof vast resources in mind, and may not work for MicroPython ports with\nlimited heap. If you are affected by such a case, please help reimplement\nthe module from scratch.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-binascii',
version='2.4.0-3',
description='PyPy binascii module ported to MicroPython',
long_description='This is a module ported from PyPy standard library to be compatible with\nMicroPython interpreter. Usually, this means applying small patches for\nfeatures not supported (yet, or at all) in MicroPython. Sometimes, heavier\nchanges are required. Note that CPython modules are written with availability\nof vast resources in mind, and may not work for MicroPython ports with\nlimited heap. If you are affected by such a case, please help reimplement\nthe module from scratch.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-binhex',
version='0.0.1',
description='Dummy binhex module for MicroPython',
long_description='This is a dummy implementation of a module for MicroPython standard library.\nIt contains zero or very little functionality, and primarily intended to\navoid import errors (using idea that even if an application imports a\nmodule, it may be not using it onevery code path, so may work at least\npartially). It is expected that more complete implementation of the module\nwill be provided later. Please help with the development if you are\ninterested in this module.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-calendar',
version='0.0.0',
description='Dummy calendar module for MicroPython',
long_description='This is a dummy implementation of a module for MicroPython standard library.\nIt contains zero or very little functionality, and primarily intended to\navoid import errors (using idea that even if an application imports a\nmodule, it may be not using it onevery code path, so may work at least\npartially). It is expected that more complete implementation of the module\nwill be provided later. Please help with the development if you are\ninterested in this module.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-cgi',
version='3.3.3-1',
description='CPython cgi module ported to MicroPython',
long_description='This is a module ported from CPython standard library to be compatible with\nMicroPython interpreter. Usually, this means applying small patches for\nfeatures not supported (yet, or at all) in MicroPython. Sometimes, heavier\nchanges are required. Note that CPython modules are written with availability\nof vast resources in mind, and may not work for MicroPython ports with\nlimited heap. If you are affected by such a case, please help reimplement\nthe module from scratch.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-cmd',
version='3.4.0-1',
description='CPython cmd module ported to MicroPython',
long_description='This is a module ported from CPython standard library to be compatible with\nMicroPython interpreter. Usually, this means applying small patches for\nfeatures not supported (yet, or at all) in MicroPython. Sometimes, heavier\nchanges are required. Note that CPython modules are written with availability\nof vast resources in mind, and may not work for MicroPython ports with\nlimited heap. If you are affected by such a case, please help reimplement\nthe module from scratch.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-collections.defaultdict',
version='0.2.1',
description='collections.defaultdict module for MicroPython',
long_description="This is a module reimplemented specifically for MicroPython standard library,\nwith efficient and lean design in mind. Note that this module is likely work\nin progress and likely supports just a subset of CPython's corresponding\nmodule. Please help with the development if you are interested in this\nmodule.",
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-collections.deque',
version='0.1.2',
description='collections.deque module for MicroPython',
long_description="This is a module reimplemented specifically for MicroPython standard library,\nwith efficient and lean design in mind. Note that this module is likely work\nin progress and likely supports just a subset of CPython's corresponding\nmodule. Please help with the development if you are interested in this\nmodule.",
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-collections',
version='0.1.1',
description='collections module for MicroPython',
long_description="This is a module reimplemented specifically for MicroPython standard library,\nwith efficient and lean design in mind. Note that this module is likely work\nin progress and likely supports just a subset of CPython's corresponding\nmodule. Please help with the development if you are interested in this\nmodule.",
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-concurrent.futures',
version='0.0.0',
description='Dummy concurrent.futures module for MicroPython',
long_description='This is a dummy implementation of a module for MicroPython standard library.\nIt contains zero or very little functionality, and primarily intended to\navoid import errors (using idea that even if an application imports a\nmodule, it may be not using it onevery code path, so may work at least\npartially). It is expected that more complete implementation of the module\nwill be provided later. Please help with the development if you are\ninterested in this module.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-contextlib',
version='3.4.2-3',
description='CPython contextlib module ported to MicroPython',
long_description='This is a module ported from CPython standard library to be compatible with\nMicroPython interpreter. Usually, this means applying small patches for\nfeatures not supported (yet, or at all) in MicroPython. Sometimes, heavier\nchanges are required. Note that CPython modules are written with availability\nof vast resources in mind, and may not work for MicroPython ports with\nlimited heap. If you are affected by such a case, please help reimplement\nthe module from scratch.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-csv',
version='0.0.0',
description='Dummy csv module for MicroPython',
long_description='This is a dummy implementation of a module for MicroPython standard library.\nIt contains zero or very little functionality, and primarily intended to\navoid import errors (using idea that even if an application imports a\nmodule, it may be not using it onevery code path, so may work at least\npartially). It is expected that more complete implementation of the module\nwill be provided later. Please help with the development if you are\ninterested in this module.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-curses.ascii',
version='3.4.2',
description='CPython curses.ascii module ported to MicroPython',
long_description='This is a module ported from CPython standard library to be compatible with\nMicroPython interpreter. Usually, this means applying small patches for\nfeatures not supported (yet, or at all) in MicroPython. Sometimes, heavier\nchanges are required. Note that CPython modules are written with availability\nof vast resources in mind, and may not work for MicroPython ports with\nlimited heap. If you are affected by such a case, please help reimplement\nthe module from scratch.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-datetime',
version='0.0.1',
description='Dummy datetime module for MicroPython',
long_description='This is a dummy implementation of a module for MicroPython standard library.\nIt contains zero or very little functionality, and primarily intended to\navoid import errors (using idea that even if an application imports a\nmodule, it may be not using it onevery code path, so may work at least\npartially). It is expected that more complete implementation of the module\nwill be provided later. Please help with the development if you are\ninterested in this module.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-dbm',
version='0.0.1',
description='Dummy dbm module for MicroPython',
long_description='This is a dummy implementation of a module for MicroPython standard library.\nIt contains zero or very little functionality, and primarily intended to\navoid import errors (using idea that even if an application imports a\nmodule, it may be not using it onevery code path, so may work at least\npartially). It is expected that more complete implementation of the module\nwill be provided later. Please help with the development if you are\ninterested in this module.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-decimal',
version='0.0.1',
description='Dummy decimal module for MicroPython',
long_description='This is a dummy implementation of a module for MicroPython standard library.\nIt contains zero or very little functionality, and primarily intended to\navoid import errors (using idea that even if an application imports a\nmodule, it may be not using it onevery code path, so may work at least\npartially). It is expected that more complete implementation of the module\nwill be provided later. Please help with the development if you are\ninterested in this module.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-difflib',
version='0.0.1',
description='Dummy difflib module for MicroPython',
long_description='This is a dummy implementation of a module for MicroPython standard library.\nIt contains zero or very little functionality, and primarily intended to\navoid import errors (using idea that even if an application imports a\nmodule, it may be not using it onevery code path, so may work at least\npartially). It is expected that more complete implementation of the module\nwill be provided later. Please help with the development if you are\ninterested in this module.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-email.charset',
version='0.5',
description='CPython email.charset module ported to MicroPython',
long_description='This is a module ported from CPython standard library to be compatible with\nMicroPython interpreter. Usually, this means applying small patches for\nfeatures not supported (yet, or at all) in MicroPython. Sometimes, heavier\nchanges are required. Note that CPython modules are written with availability\nof vast resources in mind, and may not work for MicroPython ports with\nlimited heap. If you are affected by such a case, please help reimplement\nthe module from scratch.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-email.encoders',
version='0.5',
description='CPython email.encoders module ported to MicroPython',
long_description='This is a module ported from CPython standard library to be compatible with\nMicroPython interpreter. Usually, this means applying small patches for\nfeatures not supported (yet, or at all) in MicroPython. Sometimes, heavier\nchanges are required. Note that CPython modules are written with availability\nof vast resources in mind, and may not work for MicroPython ports with\nlimited heap. If you are affected by such a case, please help reimplement\nthe module from scratch.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-email.errors',
version='0.5',
description='CPython email.errors module ported to MicroPython',
long_description='This is a module ported from CPython standard library to be compatible with\nMicroPython interpreter. Usually, this means applying small patches for\nfeatures not supported (yet, or at all) in MicroPython. Sometimes, heavier\nchanges are required. Note that CPython modules are written with availability\nof vast resources in mind, and may not work for MicroPython ports with\nlimited heap. If you are affected by such a case, please help reimplement\nthe module from scratch.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-email.feedparser',
version='0.5',
description='CPython email.feedparser module ported to MicroPython',
long_description='This is a module ported from CPython standard library to be compatible with\nMicroPython interpreter. Usually, this means applying small patches for\nfeatures not supported (yet, or at all) in MicroPython. Sometimes, heavier\nchanges are required. Note that CPython modules are written with availability\nof vast resources in mind, and may not work for MicroPython ports with\nlimited heap. If you are affected by such a case, please help reimplement\nthe module from scratch.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-email.header',
version='0.5.1',
description='CPython email.header module ported to MicroPython',
long_description='This is a module ported from CPython standard library to be compatible with\nMicroPython interpreter. Usually, this means applying small patches for\nfeatures not supported (yet, or at all) in MicroPython. Sometimes, heavier\nchanges are required. Note that CPython modules are written with availability\nof vast resources in mind, and may not work for MicroPython ports with\nlimited heap. If you are affected by such a case, please help reimplement\nthe module from scratch.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-email.internal',
version='0.5',
description='CPython email.internal module ported to MicroPython',
long_description='This is a module ported from CPython standard library to be compatible with\nMicroPython interpreter. Usually, this means applying small patches for\nfeatures not supported (yet, or at all) in MicroPython. Sometimes, heavier\nchanges are required. Note that CPython modules are written with availability\nof vast resources in mind, and may not work for MicroPython ports with\nlimited heap. If you are affected by such a case, please help reimplement\nthe module from scratch.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-email.message',
version='0.5.2',
description='CPython email.message module ported to MicroPython',
long_description='This is a module ported from CPython standard library to be compatible with\nMicroPython interpreter. Usually, this means applying small patches for\nfeatures not supported (yet, or at all) in MicroPython. Sometimes, heavier\nchanges are required. Note that CPython modules are written with availability\nof vast resources in mind, and may not work for MicroPython ports with\nlimited heap. If you are affected by such a case, please help reimplement\nthe module from scratch.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-email.parser',
version='0.5',
description='CPython email.parser module ported to MicroPython',
long_description='This is a module ported from CPython standard library to be compatible with\nMicroPython interpreter. Usually, this means applying small patches for\nfeatures not supported (yet, or at all) in MicroPython. Sometimes, heavier\nchanges are required. Note that CPython modules are written with availability\nof vast resources in mind, and may not work for MicroPython ports with\nlimited heap. If you are affected by such a case, please help reimplement\nthe module from scratch.',
# Remove current dir from sys.path, otherwise setuptools will peek up our
# module instead of system.
sys.path.pop(0)
fromsetuptoolsimportsetup
setup(name='micropython-email.utils',
version='3.3.3-1',
description='CPython email.utils module ported to MicroPython',
long_description='This is a module ported from CPython standard library to be compatible with\nMicroPython interpreter. Usually, this means applying small patches for\nfeatures not supported (yet, or at all) in MicroPython. Sometimes, heavier\nchanges are required. Note that CPython modules are written with availability\nof vast resources in mind, and may not work for MicroPython ports with\nlimited heap. If you are affected by such a case, please help reimplement\nthe module from scratch.',