To increase the similarity between this module and CPythons sqlite3 module
the commit() and rollback() as defined in CPythons version have been
added, along with the different (auto)commit behaviors present there.
The defaults are also set to the same as in CPython, and can be changed
with the same parameters in connect(), as is showcased in the new test.
Signed-off-by: Robert Klink <rhermanklink@ripe.net>
The sqlite3_prepare and sqlite3_close have been changed to use the v2
version. For the prepare this was done as the v1 version is "legacy",
and for close the documentation describes the v2 version to be used for
"host languages that are garbage collected, and where the order in
which destructors are called is arbitrary", which fits here.
Some clean-up to comments has also be done, and the tests now also
close the Cursor and Connections.
Signed-off-by: Robert Klink <rhermanklink@ripe.net>
This commit adds the ability to enable URI on the connect, as can be done
in the cpython sqlite3 module. URI allows, among other things, to create
a shared named in-memory database, which non URI filenames cannot create.
Signed-off-by: Robert Klink <rhermanklink@ripe.net>
Currently, statements are only finalized upon a call to Cursor.close().
However, in Cursor.execute() new statements get created without the
previous statements being finalized, causing those to get leaked,
preventing the database from being closed. The fix addresses this by
finalizing the previous statement if it exists.
Signed-off-by: Robert Klink <rhermanklink@ripe.net>
Currently, the bytes object used to store the sqlite3 database pointer
is always 4 bytes, which causes segfaults on 64 bit platforms with 8
byte pointers. To address this, the size is now dynamically determined
using the uctypes modules pointer size.
Signed-off-by: Robert Klink <rhermanklink@ripe.net>
This changes almost all uses of "u-module" to just "module" for the
following built-in modules:
- binascii
- collections
- errno
- io
- json
- socket
- struct
- sys
- time
There are some remaining uses of "u-module" naming, for the cases where the
built-in module is extended in Python, eg `python-stdlib/os` uses `uos`.
Also, there are remaining uses of `utime` when non-standard (compared to
CPython) functions are used, like `utime.ticks_ms()`.
Signed-off-by: Damien George <damien@micropython.org>
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>
- 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>
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>
* 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>
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>
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 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>