micropip.freeze currently checks for the non-standard top_level.txt file to fill the imports field. This has a few issues:
- When the file is missing, no imports are included
- For namespace packages, the top-level imports is just the name of the namespace, but we want the imports field to name the package, e.g.
namespace.package instead
A brief online search didn't reveal any good solutions:
micropip.freezecurrently checks for the non-standardtop_level.txtfile to fill theimportsfield. This has a few issues:namespace.packageinsteadA brief online search didn't reveal any good solutions:
RECORDSfile to extract all non-special directories. I would suggest to go even one step further and extract the common prefix for all non-special directories so that we could also translatenamespace/packageintonamespace.package. To allow several adjacent namespace packages, perhaps the rule would be to look for directory prefixes until we find the first__init__.py