Issue 20020: "modernize" the modulefinder module (original) (raw)

Issue20020

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/64219

classification

Title: "modernize" the modulefinder module
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.5

process

Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Arfrever, berker.peksag, eric.snow, matrixise, theller
Priority: low Keywords: patch, patch

Created on 2013-12-19 04:05 by eric.snow, last changed 2022-04-11 14:57 by admin.

Pull Requests
URL Status Linked Edit
PR 11787 merged brandtbucher,2019-02-08 03:24
PR 11787 merged brandtbucher,2019-02-08 03:24
Messages (3)
msg206576 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2013-12-19 04:05
The modulefinder module (Lib/modulefinder.py) provides a ModuleFinder class (plus 2 helpers) you can use to see what modules a script imports (directly or indirectly). The module's implementation is centered on the old imp.find_/load_module() API (which has been deprecated). The implementation should be refactored to reflect/make use of the newer import-related APIs. The documented API for ModuleFinder is very small. However, it has quite a few methods that are "public" in the sense that their names do not start with an underscore. This will make any kind of refactoring trickier.
msg206608 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2013-12-19 12:20
I have written a new modulefinder based on importlib. It is not a refactoring of the old one, so it is no plug-in replacement. Instead it has some new features: - Better logging output - collects dependencies (self._depgraph maps module names to callers) - when run as script, the command line syntax are easier to understand (although parsing is still done by getopt; argparse would be event better) - The Module proxies that modulefinder collects give better access to the module's attributes, including the byte code It is not yet tested in the wild but I will use it for the Python3 py2exe implementation. If anyone wants to take a look the current version is here: http://code.google.com/p/ctypes-stuff/source/browse/trunk/mf/py2exe/mf3.py
msg229310 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2014-10-14 16:35
The code of Thomas has not the same API than the "modulefinder" module. If you want a patch, we need to rework the code of Thomas and provide an equivalent API with the existing one. What do you suggest?
History
Date User Action Args
2022-04-11 14:57:55 admin set github: 64219
2019-02-08 03:24:33 brandtbucher set keywords: + patchstage: needs patch -> patch reviewpull_requests: + <pull%5Frequest11789>
2019-02-08 03:24:25 brandtbucher set keywords: + patchstage: needs patch -> needs patchpull_requests: + <pull%5Frequest11788>
2015-10-04 02:14:25 Arfrever set nosy: + Arfrever
2014-10-14 17:36:21 berker.peksag set nosy: + berker.peksag
2014-10-14 16:35:47 matrixise set nosy: + matrixisemessages: +
2014-09-01 10:29:35 berker.peksag set stage: needs patch
2013-12-19 12:20:25 theller set nosy: + thellermessages: +
2013-12-19 04:05:25 eric.snow create