summaryrefslogtreecommitdiff
path: root/ports/unix
AgeCommit message (Collapse)Author
2021-03-26[ure] to save space, disable debug dumps by defaultArtyom Skrobov
Has to stay enabled in unix port for the sake of tests/extmod/ure_debug.py
2021-03-15run code formatting scriptmicroDev
2021-01-14ports/unix: Fix parallel build problemJeff Epler
This is the same as I added to mpy-cross at e666e86035d5, see #3074
2020-12-23Stub out mp_hal_is_interrupted for UNIXScott Shawcroft
2020-11-19Introduce, use mp_raise_arg1Jeff Epler
This raises an exception with a given object value. Saves a bit of code size.
2020-10-15cxd56 needed more precise include for __packed; needed SRC_C += on some portsDan Halbert
2020-10-14Removed MICROPY_PY_COLLECTIONS_NAMEDTUPLE__ASDICT from unix coveragegamblor21
2020-10-13Moved ORDEREDDICT define to central locationgamblor21
2020-08-04various: Use mp_obj_get_type_qstr more widelyJeff Epler
This removes runtime allocations of the cstring version of the qstring. It is not a size improvement
2020-07-06Add license to some obvious files.Diego Elio Pettenò
2020-06-25remove machine_i2c, machine_spiJeff Epler
This micropython code is not used in circuitpython
2020-03-17ulab: rename enable macro so it appears in the support matrixJeff Epler
2020-03-03Merge remote-tracking branch 'origin/master' into ulabJeff Epler
2020-03-01Makefiles: add targets to build unix port, mpy-cross for fuzzingJeff Epler
This assumes you have properly install afl-fuzz with afl-clang-fast. Tested with AFLplusplus 2.60c-75-g2c6847b.
2020-02-27ulab: Incorporate itJeff Epler
2020-02-27unix port: add help(), help('modules')Jeff Epler
2019-12-04protocols: Allow them to be (optionally) type-safeJeff Epler
Protocols are nice, but there is no way for C code to verify whether a type's "protocol" structure actually implements some particular protocol. As a result, you can pass an object that implements the "vfs" protocol to one that expects the "stream" protocol, and the opposite of awesomeness ensues. This patch adds an OPTIONAL (but enabled by default) protocol identifier as the first member of any protocol structure. This identifier is simply a unique QSTR chosen by the protocol designer and used by each protocol implementer. When checking for protocol support, instead of just checking whether the object's type has a non-NULL protocol field, use `mp_proto_get` which implements the protocol check when possible. The existing protocols are now named: protocol_framebuf protocol_i2c protocol_pin protocol_stream protocol_spi protocol_vfs (most of these are unused in CP and are just inherited from MP; vfs and stream are definitely used though) I did not find any crashing examples, but here's one to give a flavor of what is improved, using `micropython_coverage`. Before the change, the vfs "ioctl" protocol is invoked, and the result is not intelligible as json (but it could have resulted in a hard fault, potentially): >>> import uos, ujson >>> u = uos.VfsPosix('/tmp') >>> ujson.load(u) Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: syntax error in JSON After the change, the vfs object is correctly detected as not supporting the stream protocol: >>> ujson.load(p) Traceback (most recent call last): File "<stdin>", line 1, in <module> OSError: stream operation not supported
2019-03-12Fix unix build by using safe mode stubScott Shawcroft
2019-02-21Fix unix build by using filesystem stubScott Shawcroft
2019-01-18Fix unix buildScott Shawcroft
2019-01-18More make_new fixes for unix buildScott Shawcroft
2018-12-07Stub out serial_write as wellScott Shawcroft
2018-12-06Fix unixScott Shawcroft
2018-11-30A few tweaks based on review feedbackScott Shawcroft
2018-11-30Add support for adding release info into adafruit/circuitpython-orgScott Shawcroft
This also changes the build script to python with better output.
2018-08-16Fix unix coverage and update translations.Scott Shawcroft
2018-08-16Fix nrf and unixScott Shawcroft
2018-08-07Support internationalisation.Scott Shawcroft
2018-07-28merge finishedDan Halbert
2018-07-11WIP: after merge; before testingDan Halbert
2018-06-18tests/unix/extra_coverage: Don't test stream objs with NULL write fun.Damien George
This behaviour of a NULL write C method on a stream that uses the write adaptor objects is no longer supported. It was only ever used by the coverage build for testing the fail path of mp_get_stream_raise().
2018-06-12ports: Enable IOBase on unix, stm32, esp8266 and esp32.Damien George
It's a core feature, in particular required for user-streams with uasyncio.
2018-06-12ports: Call gc_sweep_all() when doing a soft reset.Damien George
This calls finalisers of things like files and sockets to cleanly close them.
2018-06-06unix/moduos_vfs: Add missing uos functions from traditional uos module.Damien George
Now that the coverage build has fully switched to the VFS sub-system these functions were no longer available, so add them to the uos_vfs module. Also, vfs_open is no longer needed, it's available as the built-in open.
2018-06-06unix: Support MICROPY_VFS_POSIX and enable it in coverage build.Damien George
The unix coverage build is now switched fully to the VFS implementation, ie the uos module is the uos_vfs module. For example, one can now sandbox uPy to their home directory via: $ ./micropython_coverage >>> import uos >>> uos.umount('/') # unmount existing root VFS >>> vfs = uos.VfsPosix('/home/user') # create new POSIX VFS >>> uos.mount(vfs, '/') # mount new POSIX VFS at root Some filesystem/OS features may no longer work with the coverage build due to this change, and these need to be gradually fixed. The standard unix port remains unchanged, it still uses the traditional uos module which directly accesses the underlying host filesystem.
2018-05-22ports: Enable MICROPY_PY_BUILTINS_ROUND_INT on selected ports.Damien George
2018-04-10py/stream: Switch stream close operation from method to ioctl.Damien George
This patch moves the implementation of stream closure from a dedicated method to the ioctl of the stream protocol, for each type that implements closing. The benefits of this are: 1. Rounds out the stream ioctl function, which already includes flush, seek and poll (among other things). 2. Makes calling mp_stream_close() on an object slightly more efficient because it now no longer needs to lookup the close method and call it, rather it just delegates straight to the ioctl function (if it exists). 3. Reduces code size and allows future types that implement the stream protocol to be smaller because they don't need a dedicated close method. Code size reduction is around 200 bytes smaller for x86 archs and around 30 bytes smaller for the bare-metal archs.
2018-03-31Merge pull request #729 from jepler/tests-parallel-circuitpythonScott Shawcroft
Optionally parallelize the testsuite
2018-03-31ports/unix/Makefile: parallelize testsJeff Epler
2018-03-27Add VfsFat.label propertyJeff Epler
These allow accessing the filesystem label. For instance, in boot.py, you can set the label on the built-in storage with: storage.remount('/', False) storage.getmount('/').label = "NEWLABEL" storage.remount('/', True) Users with multiple CIRCUITPY boards may find it desirable to choose a different label for each board they own.
2018-03-08unix/coverage: Allow coverage tests to pass with debugging disabled.Damien George
2018-03-02tests: Move heap-realloc-while-locked test from C to Python.Damien George
This test for calling gc_realloc() while the GC is locked can be done in pure Python, so better to do it that way since it can then be tested on more ports.
2018-03-01tests/unix: Add coverage tests for various GC calls.Damien George
2018-02-27tests/unix: Add coverage test for VM executing invalid bytecode.Damien George
2018-02-25tests/unix: Add coverage tests for mpz_set_from_float, mpz_mul_inpl.Damien George
These new tests cover cases that can't be reached from Python and get coverage of py/mpz.c to 100%. These "unreachable from Python" pieces of code could be removed but they form an integral part of the mpz C API and may be useful for non-Python usage of mpz.
2018-02-21ports: Enable ucollections.deque on relevant ports.Damien George
These ports are all capable of running uasyncio.
2018-02-14unix/mpconfigport_coverage: Enable range (in)equality comparison.Damien George
2018-02-14unix/Makefile,embedding/Makefile: Remove obsolete use of STMHAL_SRC_C.Damien George
2018-02-08.travis.yml,ports/unix/Makefile: Add coverage test for script via stdin.Damien George
2018-02-08tests/unix: Add coverage test for calling mp_obj_new_bytearray.Damien George