micropython-lib
micropython-lib copied to clipboard
unix-ffi: Isolate packages from python-stdlib version of `os`
Currently, installing email.message
(or any package that requires it, i.e. email.feedparser
, email.parser
, http.client
) or glob
causes the python-stdlib version of os
to be installed instead of the unix-ffi version.
This adds unix-ffi versions of os-path
and uu
so that the unix-ffi version of os
is installed in these cases.
Thanks for the PR @jefferyto. Sorry the unix-ffi thing is a bit complicated, but I think this is a very reasonable way to solve this.
A more general solution could be to persist the unix_ffi=True
flag into nested require()
calls, that would allow a top-level unix-ffi package to include non-unix-ffi packages and have the stream of requires flow back into unix-ffi when necessary, but I'm not sure how difficult this would be or if there is any interest in this kind of functionality.
See https://github.com/micropython/micropython/pull/13620 for an alternative solution.
A more general solution could be to persist the
unix_ffi=True
flag into nestedrequire()
calls
That's effectively what the above-linked PR does.
This was solved differently as per the two comments just above. See 23df50d0ea0d64c2a4e00f3014dd4590da0a510b