forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1
Support relative import in custom __import__ callback #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
zsquareplusc
merged 1,375 commits into
zsquareplusc:fix-override-relative-import
from
oliver-joos:fix-override-relative-import
Mar 13, 2022
Merged
Support relative import in custom __import__ callback #1
zsquareplusc
merged 1,375 commits into
zsquareplusc:fix-override-relative-import
from
oliver-joos:fix-override-relative-import
Mar 13, 2022
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Damien George <damien@micropython.org>
Because the GENERIC board won't fit in the flash defined by esp8266_ota.ld. Signed-off-by: Damien George <damien@micropython.org>
Following the unix port. Support for building variants with msvc was done by @stinos.
The application isn't necessarily called 'micropython' especially not When using variants, i.e. the tests need to be ran using $(PROG).
This is the same fix as applied in uselect_poll_basic.py.
This makes sure changes from previous related commits actually work.
Via the MICROPY_HW_FLASH_DQS flag.
And how they relate to MicroPython. As these features are implemented (or the decision is made to not implement them) the tables can be updated to document the differences between MicroPython and standard Python.
The qstr_last_chunk is not collected by the garbage collector. This relies on the assertion that qstr_pool_t also references the qstr_last_chunk. If an exception is raised while allocating the qstr_pool_t, qstr_last_chunk has to be invalidated not to become a dangling reference at the next garbage collection. Signed-off-by: Emilie Feral <emilie.feral@numworks.com>
- Cleanup pyexec flags definitions so it's clear they are different. - Use mp_uint_t for exec_flags because it should be unsigned.
- Add default values for I2S features added in ESP-IDF 4.4. - Add workaround for bug introduced in ESP-IDF 4.4 (espressif/esp-idf#8121).
After changing the bitstream implementation to use the RMT driver in commit 72d8615 ("esp32/machine_bitstream.c: Replace with RMT-based driver."), using multiple `Neopixel` instances shows signal duplication between the instances (i.e. a `write()` on one instance is written to all instances). On invocation, the rmt driver configures the GPIO matrix to route the output signal to the respective GPIO pin. When called for a different `NeoPixel` instance using a different pin, the new route is established, but the old route still exists. Now, the RMT output signal is sent to both pins. Fix this by setting the standard GPIO output function for the current pin after uninstalling the RMT driver. Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
The top value was off by 1: in order to count n ticks it has to be set to n-1. Fixes issue micropython#8122.
The duty is saved and set whenever the frequency is changed, unless the duty rate was not set yet.
As a prerequisite to upgrading to Zephyr v2.7.0, upgrade CI to use Zephyr docker image v0.21.0. In particular, this is needed to pick up a newer CMake version because Zephyr v2.7.0 increased the minimum CMake version required to 3.20.0. Signed-off-by: Maureen Helm <maureen.helm@intel.com>
As a prerequisite to upgrading to Zephyr v2.7.0, upgrade the minimum CMake version required for the Zephyr port to 3.20.0. Signed-off-by: Maureen Helm <maureen.helm@intel.com>
The reboot header was moved to a different path in Zephyr v2.6.0. The old path was deprecated for two releases (v2.6.0 and v2.7.0) and will no longer be supported after Zephyr v2.7.0. Signed-off-by: Maureen Helm <maureen.helm@intel.com>
Updates the Zephyr port to get the UART console device from devicetree instead of Kconfig. The Kconfig option CONFIG_UART_CONSOLE_ON_DEV_NAME was removed in Zephyr v2.7.0. Signed-off-by: Maureen Helm <maureen.helm@intel.com>
CONFIG_USB was removed in Zephyr v2.7.0 after some Kconfig rework that made it sufficient to use CONFIG_USB_DEVICE_STACK only. Signed-off-by: Maureen Helm <maureen.helm@intel.com>
Updates the Zephyr port build instructions and CI to use the latest Zephyr release tag. Signed-off-by: Maureen Helm <maureen.helm@intel.com>
- The wrong ACK is returned and checked. - Send secondary DNS to google.
Signed-off-by: Damien George <damien@micropython.org>
Fixes build on MCUs with built-in USB HS PHY. Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
This adds the "Not relevant" designation to PEP 486 since it has to do with the Python Launcher for Windows and not the Python language itself. Also fix a typo while we are touching this line. Signed-off-by: David Lechner <david@pybricks.com>
Fixes issue micropython#8380. Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
The disk_access header was moved to a different path in Zephyr v2.6.0. The old path was deprecated for two releases (v2.6.0 and v2.7.0) and will no longer be supported after Zephyr v2.7.0. Signed-off-by: Maureen Helm <maureen.helm@intel.com>
Updates the Zephyr port build instructions and CI to use the latest Zephyr release tag. Signed-off-by: Maureen Helm <maureen.helm@intel.com>
The .hex file contains more information than .bin, useful for flashing. Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Damien George <damien@micropython.org>
To not rely on sets, which are an optional feature. Signed-off-by: Damien George <damien@micropython.org>
Add support for configuring drive strength of output pins with `drive` keyword argument and `DRIVE_*` constants.
Add brief documentation of the new `drive` keyword argument.
Update documents with new common names for the drive strength constants.
Updated DRIVE_x constants representing pin drive strength. Signed-off-by: Philipp Ebensberger
The method was changed, but not for the CSx pins. No functional change.
OCOTP_Init() has been removed from mphalport.c. The library files are missing for the MIMXRT1015, and for just reading the OCOTP the Init is not required.
Sometimes frames could not be sent immediately because the controller was still busy with previous frames. Then, an error was returned to lwip. This fix adds a limited number of retries for this busy state, waiting 100µs before the next attempt. Typically the transmit succeeds now at the second attempt. Second change: Reset the controller for a clean state after soft reset.
Teensy 4.1 used different pins for SPI1 than Teensy 4.0, which made the boards unnecessarily different.
If the board directory contains a manifest.py file, it will be included. File not found errors will be ignored.
That caused Ethernet to lock up at high data rates after ~200MByte data average in a row. Tested now with data bursts up to 10 GByte and overall data rates of ~8MByte/s at the Eth100 port.
Ensure the symmetry of PWM: the duty rate of X and Q channels was not 50%, when it should have been. That is evident at high frequencies, like 15Mhz or 37.5 MHz. At low frequencies the deviation mattered less. The A/B channels were fine. Also round up or down non-integer division factors. Before, always the floor value was used.
From RFC 1950 section 2.2: "CINFO is the base-2 logarithm of the LZ77 window size, minus eight (CINFO=7 indicates a 32K window size)" Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
It is currently not enabled by default on any board.
…ive-import' into dev" This reverts commit 8413c46.
The globals need to be forwarded from the callers context.
globals() needs to be provided in case __import__ is a Python function
ef223fd
to
9a08ff6
Compare
zsquareplusc
pushed a commit
that referenced
this pull request
Mar 13, 2022
asan considers that memcmp(p, q, N) is permitted to access N bytes at each of p and q, even for values of p and q that have a difference earlier. Accessing additional values is frequently done in practice, reading 4 or more bytes from each input at a time for efficiency, so when completing "non_exist<TAB>" in the repl, this causes a diagnostic: ==16938==ERROR: AddressSanitizer: global-buffer-overflow on address 0x555555cd8dc8 at pc 0x7ffff726457b bp 0x7fffffffda20 sp 0x7fff READ of size 9 at 0x555555cd8dc8 thread T0 #0 0x7ffff726457a (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xb857a) #1 0x555555b0e82a in mp_repl_autocomplete ../../py/repl.c:301 micropython#2 0x555555c89585 in readline_process_char ../../lib/mp-readline/re micropython#3 0x555555c8ac6e in readline ../../lib/mp-readline/readline.c:513 micropython#4 0x555555b8dcbd in do_repl /home/jepler/src/micropython/ports/uni micropython#5 0x555555b90859 in main_ /home/jepler/src/micropython/ports/unix/ micropython#6 0x555555b90a3a in main /home/jepler/src/micropython/ports/unix/m micropython#7 0x7ffff619a09a in __libc_start_main ../csu/libc-start.c:308 micropython#8 0x55555595fd69 in _start (/home/jepler/src/micropython/ports/uni 0x555555cd8dc8 is located 0 bytes to the right of global variable 'import_str' defined in '../../py/repl.c:285:23' (0x555555cd8dc0) of size 8 'import_str' is ascii string 'import ' Signed-off-by: Jeff Epler <jepler@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I manually rebased your branch onto current upstream master branch.
I had to move some code into the new evaluate_relative_import() function. Type checking of globals now also captures non-relative imports. And I added 2 tests for this type checking to increase coverage.