micropython-lib/python-stdlib
Jim Mussared 038b4ac657 unittest: Convert to a package.
This allows a much more natural way of implementing unitttest-discover:
 - unittest provides unittest/__init__.py
 - unittest-discover provides unittest/__main__.py

It also fixes an bug where unittest.py previously detected the presence of
unittest-discover.py by importing an checking for the ImportError. But that
could also be raised by a missing dependency. Now when you run
`micropython -m unittest` without unittest-discover, you get
`ImportError: no module named 'unittest.__main__'`, and without the
required deps, `ImportError: no module named 'argparse'`.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-11-09 14:56:34 +11:00
..
__future__
abc
argparse
base64
binascii
bisect
cmd
collections
collections-defaultdict
collections-deque
contextlib
copy
curses.ascii
datetime
errno
fnmatch
functools all: Replace metadata.txt with manifest.py. 2022-09-05 17:50:28 +10:00
gzip
hashlib
heapq
hmac
html
inspect
io
itertools
json
keyword
locale
logging
operator
os
os-path os.path: Remove external / ffi dependencies in os.path. 2022-09-30 17:51:06 +10:00
pickle
pkg_resources
pkgutil all: Replace metadata.txt with manifest.py. 2022-09-05 17:50:28 +10:00
pprint
quopri
random
shutil shutil: Add disk_usage function. 2022-11-09 14:44:40 +11:00
ssl
stat
string
struct
textwrap
threading
traceback
types
unittest unittest: Convert to a package. 2022-11-09 14:56:34 +11:00
unittest-discover unittest: Convert to a package. 2022-11-09 14:56:34 +11:00
uu
venv venv: Add a command-line package for creating virtual environments. 2022-11-09 12:52:03 +11:00
warnings all: Replace metadata.txt with manifest.py. 2022-09-05 17:50:28 +10:00
README.md

README.md

CPython standard libraries

The libraries in this directory aim to provide compatible implementations of standard libraries to allow existing Python code to run un-modified on MicroPython.

Implementation

Many libraries are implemented in pure Python, often based on the original CPython implementation. (e.g. collections.defaultdict)

Some libraries are based on or extend from the built-in "micro" modules in the MicroPython firmware, providing additional functionality that didn't need to be written in C (e.g. collections, socket, struct).

Future plans (ideas for contributors):

  • Add README.md to each library explaining compatibility and limitations.