Wykres commitów

1496 Commity (2d16f210b96c48a598b3595ad55313c21deac06e)

Autor SHA1 Wiadomość Data
Angus Gratton 2d16f210b9 lsm6dsox: Add missing time import.
Driver calls time.sleep_ms() in one place.

Found by Ruff checking F821.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-08-22 22:43:04 +10:00
Angus Gratton 86050c3d7a bmm150: Remove broken reset function.
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>
2023-08-22 22:42:48 +10:00
Angus Gratton 674e734a1c drivers/display/lcd160cr: Use isinstance() for type checking.
Fixes linter warning E721, expanded in Ruff 823 to include
direct comparison against built-in types.
2023-08-09 18:59:03 +10:00
Graeme Winter 01ab7ba6e2 iperf3: Add compatibility for servers pre version 3.2.
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.
2023-07-27 16:01:30 +10:00
Jim Mussared ce3f282967 github/workflows: Split ruff into its own action.
This matches the main repo, and conceputually ruff is not strictly doing
"code formatting".

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-07-27 12:28:29 +10:00
Jim Mussared efa0402846 tools/codeformat.py: Fix ruff warnings.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-07-27 12:28:29 +10:00
Jim Mussared 5cdfe71536 top: Add pre-commit config.
This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-07-27 12:28:15 +10:00
Jim Mussared 232859250c tools/codeformat.py: Remove git state detection.
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>
2023-07-27 12:26:08 +10:00
Jim Mussared 36e74c1b57 zlib: Add zlib module.
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>
2023-07-25 18:19:51 +10:00
Christian Clauss 4da6e6f1b2 all: Lint Python code with ruff.
Signed-off-by: Christian Clauss <cclauss@me.com>
2023-07-24 07:51:33 +02:00
Damien George 752ce66c24 github/workflows: Build all example .py files as part of CI.
Signed-off-by: Damien George <damien@micropython.org>
2023-07-24 10:28:49 +10:00
Jim Mussared 8fc9edabf3 all: Standardise x.y.z versioning for all packages.
- 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>
2023-07-23 11:48:57 +10:00
Jim Mussared ebbb78e8e4 logging: Bump minor version.
For changes in 5329ef5301.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-07-23 11:48:46 +10:00
Jim Mussared a19d2a3596 copy: Bump patch version.
For changes in 0e68c7d518.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-07-23 11:48:29 +10:00
Jim Mussared 97b7a30ab9 xmltok: Bump patch version.
For changes in 66924d9fa1.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-07-23 11:48:25 +10:00
Jim Mussared 87b4cdae2f aiorepl: Bump patch version.
For changes in ff842310de.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-07-23 11:48:14 +10:00
Jim Mussared 8513bfbe9d requests: Rename urequests to requests.
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>
2023-07-23 11:41:44 +10:00
Jim Mussared 5004436164 tarfile: Rename from utarfile.
This is compatible with the CPython module, so should
be named tarfile.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-07-23 11:41:44 +10:00
Andrew Leech e45a7f6c18 fnmatch: Fix compatibility with ure -> re.
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>
2023-07-21 17:19:43 +10:00
Jim Mussared 6103823b1b all: Remove __version__ from .py files.
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>
2023-07-21 17:15:00 +10:00
Jim Mussared ff842310de aiorepl: Replace f-string with str.format.
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>
2023-07-21 17:10:41 +10:00
Andrew Leech 0e68c7d518 copy: Declare dependency on types. 2023-07-21 17:07:06 +10:00
Andrew Leech 5329ef5301 logging: Add full support for logging exception tracebacks.
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>
2023-07-21 17:01:42 +10:00
Andrew Leech 028a369f90 keyword: Add manifest file. 2023-07-21 16:58:48 +10:00
Andrew Leech b95deb31e5 json: Add manifest file. 2023-07-21 16:58:48 +10:00
Andrew Leech 0f768c9af7 bisect: Add manifest file. 2023-07-21 16:58:48 +10:00
Andrew Leech c2b44ea83b types: Add manifest file. 2023-07-21 16:58:48 +10:00
Jim Mussared c48b17dd17 aiorepl/README.md: More info about globals.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-07-21 16:06:49 +10:00
ThunderEX 66924d9fa1 xmltok: Change StopIteration to EOFError due to PEP-479.
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.
2023-07-21 15:59:10 +10:00
Jim Mussared fe3e0a2fae cmd: Remove comments about using the string module.
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>
2023-07-21 15:28:14 +10:00
Damien George 0a5b635594 utarfile: Fix read/write handling of nulls in tar header.
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>
2023-07-21 12:58:40 +10:00
Jim Mussared da5ddfc6e2 hashlib: Refactor, split, and optimise.
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>
2023-07-20 23:28:08 +10:00
Angus Gratton 2fba6b8644 lora: Workaround SX1262 bug with GetStatus.
This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-07-20 23:13:03 +10:00
Angus Gratton 1957f24020 lora: Add lora modem drivers for SX127x and SX126x.
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>
2023-07-20 23:07:22 +10:00
Dan Ellis 7128d423c2 utarfile: Support creating/appending tar files.
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>
2023-05-22 15:02:05 +10:00
glenn20 a1b9aa934c aioespnow: Add library providing asyncio support for espnow module.
This module provides asyncio support for the espnow module on ESP32 and
ESP8266 ports.
2023-05-04 14:21:32 +10:00
Jim Mussared c113611765 aioble: Fix descriptor flag handling.
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>
2023-04-12 07:04:12 +10:00
Jim Mussared 01db3da37e senml: Allow publishing to PyPI as micropython-senml.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-04-07 13:28:15 +10:00
Jim Mussared 9b5f4d73b0 tools/makepyproject.py: Add tool to generate PyPI package.
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>
2023-04-07 13:24:15 +10:00
Jim Mussared afc9d0a541 micropython: Add missing metadata for packages.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-04-07 13:24:15 +10:00
Jim Mussared 386ab99d7f python-ecosys: Add pypi= to metadata.
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>
2023-04-06 12:06:15 +10:00
Andrew Leech f672353180 unittest-discover: Print results when no tests are found/run.
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.
2023-03-27 12:06:04 +11:00
Damien George ea21cb3fdc iperf3: Support devices without os.urandom().
Also add a version to the manifest.

Signed-off-by: Damien George <damien@micropython.org>
2023-03-21 16:04:00 +11:00
iabdalkader c8603192d1 senml: Fix data record encoding to use binascii instead of base64. 2023-03-06 23:12:38 +11:00
iabdalkader 295a9e300a senml: Remove u-module prefix from imports.
Signed-off-by: Damien George <damien@micropython.org>
2023-03-03 12:26:31 +11:00
iabdalkader b9741f6584 cbor2: Remove u-module prefix from imports. 2023-03-03 12:20:28 +11:00
Angus Gratton 40dfc5fbc5 github/workflows: Attach built packages to GitHub workflow artifacts. 2023-03-02 16:45:08 +11:00
Angus Gratton 1eb282ad47 tools/ci.sh: Support publishing package and index files to GitHub Pages.
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.
2023-03-02 16:44:18 +11:00
iabdalkader 9ee02576cb senml: Add SenML library.
This is a new library that doesn't follow any existing API.

The library is originally from
https://github.com/kpn-iot/senml-micropython-library.
2023-03-01 01:18:30 +11:00
iabdalkader 52fcb8e4a7 cbor2: Add cbor2 library.
This aims to follow the API of the cbor2 library found at
https://github.com/agronholm/cbor2 (also on PyPI as cbor2).

The original source for this MicroPython version of cbor2 is from
https://github.com/kpn-iot/senml-micropython-library.
2023-03-01 01:13:06 +11:00