ENH Add `micropip.freeze`. This adds a function `micropip.freeze()` which creates a `packages.json`
lock file which includes all packages that were loaded by micropip in the
current Pyodide session. This can be used in subsequent sessions to load
the same set of packages with `pyodide.loadPackage`.

For example in our repl:

```py
from js.console import log
import micropip
await micropip.install("sphinx-version-warning") # Installs 19 wheels from pypi
log(micropip.freeze())
```
Then opening the browser console, we can copy the JSON and make a new `packages.json`
file out of it. (Our repl will just say "<Long output truncated>" but the browser
console truncates it and provides tools to make it easy to copy.) Reloading the page
with the new `packages.json`, `versionwarning` will autoload:
```py
import versionwarning # Automatically loads 19 wheels from PyPI
```
We detected that `versionwarning` is an export provided by the `sphinx-version-warning`
package via the `top_level.txt` file. Distressingly this file is part of the `egg-info`
spec but isn't mentioned anywhere in the `dist-info` spec. But wheels seem to include
it nonetheless.
### Description

### Checklists

- [x] Add a [CHANGELOG](https://github.com/pyodide/pyodide/blob/main/docs/project/changelog.md) entry
- [x] Add / update tests
- [x] Add new / update outdated documentation

# Pyodide Python package

A Python package providing core interpreter functionality for Pyodide.

This package is an integral part of the Pyodide runtime which cannot start
without it. Install in a native Python for type checking or testing purposes.
Some of the functionality is missing when imported in a native Python, but for
the APIs we either provide reimplementations or nonfunctional type stubs.

## License

Pyodide uses the [Mozilla Public License Version
2.0](https://choosealicense.com/licenses/mpl-2.0/).

## Design information for Pyodide contributors

This directory consists of two Python packages py/\_pyodide and py/pyodide. The
difference between these packages is when they are imported. They are both
imported by core/pyodide as a part of setting up the Pyodide/javascript foreign
function interface.

py/\_pyodide is imported as the first step after initializing
the CPython interpreter. py/\_pyodide cannot have any import time dependencies
other than the CPython stdlib.

py/pyodide is imported as the final step of core/pyodide. It has an import time
dependency on `_pyodide_core` which is a Python C extension assembled by
core/pyodide to serve the needs of py/pyodide.

# Pyodide Python package

A Python package providing core interpreter functionality for Pyodide.

This package is an integral part of the Pyodide runtime which cannot start
without it. Install in a native Python for type checking or testing purposes.
Some of the functionality is missing when imported in a native Python, but for
the APIs we either provide reimplementations or nonfunctional type stubs.

## License

Pyodide uses the [Mozilla Public License Version
2.0](https://choosealicense.com/licenses/mpl-2.0/).

## Design information for Pyodide contributors

This directory consists of two Python packages py/\_pyodide and py/pyodide. The
difference between these packages is when they are imported. They are both
imported by core/pyodide as a part of setting up the Pyodide/javascript foreign
function interface.

py/\_pyodide is imported as the first step after initializing
the CPython interpreter. py/\_pyodide cannot have any import time dependencies
other than the CPython stdlib.

py/pyodide is imported as the final step of core/pyodide. It has an import time
dependency on `_pyodide_core` which is a Python C extension assembled by
core/pyodide to serve the needs of py/pyodide.
