homepage

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.

classification
Title: Improved modulefinder
Type: Stage:
Components: Extension Modules Versions:
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: loewis, theller
Priority: normal Keywords: patch

Created on 2001年09月19日 17:43 by theller, last changed 2022年04月10日 16:04 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
mf.diff theller, 2001年09月19日 17:43 Patch against current CVS version
Messages (5)
msg37690 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2001年09月19日 17:43
This patch adds two improvements to 
freeze/modulefinder.
1. ModuleFinder now keeps track of which module is 
imported by whom.
2. ModuleFinder, when instantiated with the new 
scan_extdeps=1 argument, tries to track dependencies 
of builtin and extension modules.
msg37691 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2001年09月19日 20:28
Logged In: YES 
user_id=21627
I dislike the chunk on finding external dependencies. What 
is the typical use case (i.e. what module has what 
external dependencies)?
It seems easier to hard-code knowledge about external 
dependencies into ModuleFinder; this hard-coded knowledge 
should cover all core modules. In addition, there should 
be an API to extend this knowledge for non-standard 
modules.
Furthermore, by executing an import, you cannot be sure 
that you really find all dependencies - some may only show 
up when a certain function is used.
msg37692 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2001年09月20日 09:42
Logged In: YES 
user_id=11105
The use case is to find as much dependencies as possible.
Sure, you cannot assume that importing an extension module 
finds all dependencies - only those which are executed 
inside the initmodule function. OTOH, this covers a *lot* 
of problematic cases, pygame and numpy for example.
The situation is (somewhat) similar to finding dependencies 
of python modules - only those donewith normal import 
statements are found, __import__, eval, or exec is not 
handled.
A possible solution would be to run the script 
in 'profiling mode', where the script is actually run, and 
all imports are monitored. This is however far beyond 
ModuleFinder's scope.
Hardcoding the knowledge about dependencies into 
ModuleFinder for the core modules would be possible 
although inelegant IMO. An API for non-standard modules 
would be possible, but how should this be used without 
executing any code?
msg37693 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2001年09月23日 21:50
Logged In: YES 
user_id=21627
I would still prefer the inelegant approach. Your approach 
appears to be quite dangerous: the packager would 
essentially run arbitrary C code... If you absolutely have 
to use such a feature, I think you can do better than 
analysing the python -v output: watch sys.modules before 
and after the import.
As for extending the hard-coded knowledge: I was 
suggesting that the packaging tool that uses modulefinder 
has a mechanism to extend the hard-coded knowledge by 
other hard-coded knowledge (which lives in the packaging 
tool, instead of living in modulefinder). If the packaging 
tool absolutely wants to, it also could run the Python 
interpreter through a pipe and put the gathered output 
into modulefinder :-)
msg37694 - (view) Author: Thomas Heller (theller) * (Python committer) Date: 2002年04月12日 17:13
Logged In: YES 
user_id=11105
Closed as rejected.
History
Date User Action Args
2022年04月10日 16:04:27adminsetgithub: 35205
2001年09月19日 17:43:03thellercreate

AltStyle によって変換されたページ (->オリジナル) /