Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #12810 +/- ##
=======================================
Coverage 98.43% 98.43%
=======================================
Files 163 163
Lines 21290 21290
=======================================
Hits 20956 20956
Misses 334 334 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This is an automated heads-up that we've just merged a Pull Request See #13763 A search suggests this PR might apply the STATIC macro to some C code. If it Although this is an automated message, feel free to @-reply to me directly if |
|
Code size report: |
0aae1b9 to
dc44e7c
Compare
|
Apart from the |
Fix in #14188 |
Note these are mostly the 'bare' socket tests, not the ssl/tls ones for instance: most of these don't run on CPython because of incompatible wrap_socket() arguments. The change mostly consists of checking the WSA error codes next to the errno ones and these are written as numeric values because the names (like WSAEAGAIN) are only available in CPython and not in micropython. Signed-off-by: stijn <[email protected]>
Signed-off-by: stijn <[email protected]>
Upcoming commits are going to port this file to work with sockets on windows so prepare for that with the platform-specific bits. Signed-off-by: stijn <[email protected]>
Signed-off-by: stijn <[email protected]>
Signed-off-by: stijn <[email protected]>
This is more consistent with the Makefile/CMake-based builds. Signed-off-by: stijn <[email protected]>
This is consistent with extmod.mk's split between SRC_EXTMOD_C and SRC_THIRDPARTY_C, the latter specifying source files which get compiled but not included in qstr generation. Signed-off-by: stijn <[email protected]>
Supports preprocessor definitions like /Dval="quotedvalue" by turning that into /Dval=\"quotedvalue\". Signed-off-by: stijn <[email protected]>
Signed-off-by: stijn <[email protected]>
|
So, during the EuroPython 2026 @jonnor has organized a sprint on MicroPython. I have forked micropython and rebased the branch of @stinos onto a fresh There were some conflicts, all of them straightforward. It works, has been tested using the # https_test.py
import socket
import ssl
host = "api.open-meteo.com"
addr = socket.getaddrinfo(host, 443)[0][-1]
sock = socket.socket()
try:
sock.connect(addr)
sock = ssl.wrap_socket(sock, server_hostname=host)
sock.write(
b"GET /v1/forecast?latitude=59.91&longitude=10.75¤t=temperature_2m HTTP/1.0\r\nHost: %s\r\n\r\n" % host.encode()
)
print(sock.read(600))
finally:
sock.close()Steps to build and test on windows: cd micropython\ports\windows
msbuild "..\..\mpy-cross\mpy-cross.vcxproj" /p:Configuration=Release /p:Platform=x64 /p:PyVariant=standard
msbuild micropython.vcxproj /t:UpdateSubmodules
msbuild micropython.vcxproj /p:Configuration=Release /p:Platform=x64
# minimal smoketest:
.\build-standard\Releasex64\micropython.exe -c "import socket, ssl; print('socket+ssl OK')"
# actual test:
.\build-standard\Releasex64\micropython.exe https_test.py:) |
Socket module is enabled for mingw and msvc builds, mbedtls only for the former; for no particular reason, I can add it there as well if that makes more sense.
As for testing I manually ran the relevant multi_net/net_inet/net_hosted tests and tried the requests module both with and without SSL, and all of that works fine so it's likely that everything is done correctly.
The new multi_net/tcp_recv_timeout.py fails sometimes on ci, likely because one of the recv() calls errors out because the remote disconnected already, which I thought
multitest.next()would make sure didn't happen but I probably misunderstood what it does. Someone has an idea for that? I just want the recv calls on both ends to time out.The test fixes with the numeric values I'm not super happy about, but the only proper way of doing this is to provide common functions to check these errors in a test_helpers module or something like that, and then perhaps implementing a complete errno module for windows which does include all WSAXXX error code, which is a bit much maybe?