[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] [report] modules Pygame imports



Hi,

René Dudfield wrote:
ah that's cool :)  Maybe we can reduce dependencies between some
modules with this.

That's one possibility. Another idea is to generalize the program so it can be used to determine which Pygame modules are required in a Py2exe or Py2app executable.

Seems to work fine here.  It only checks module access, not object
attribute access.

That is right, it only checks modules. Perhaps the profiler would show object access as well. trackmod was adapted from a lazy import project, so replaces the module type with something that responds to __getattribute__ calls.

cu!


On Wed, Dec 17, 2008 at 6:35 AM, Lenard Lindstrom <len-l@xxxxxxxxx> wrote:
I have added a program, check_test.py, to trunk. It lists which Pygame
modules that were accessed by a unit test module.

usage:

python check_test.py <test module>

e.g.

python check_test.py surface_test.py

The listing, to standard output, shows the attribute accesses for each
Pygame module imported. Modules that were imported but not accessed are
omitted. I hope this is what you were looking for René. It is open to
modification, or even removal.

Lenard


Lenard Lindstrom wrote:
I added it to SVN under its own branch:
svn://seul.org/svn/pygame/branches/trackmod

Right now it is a package that generates a report file. It will need some
testing. For use with unittest the collected data should be exposed through
some kind of API. Also needed is a way to turn off data collection. It is
bases on a lazy importer I reinvented for use with Pygame. I don't know if
there is any demand for that though.

Lenard

René Dudfield wrote:
Could be a useful script to run the tests through :)


On Tue, Dec 9, 2008 at 11:56 AM, Lenard Lindstrom <len-l@xxxxxxxxx>
wrote:

Hi,

Some Pygame 1.9 import information for those who are curious. Please
feel
free to ignore. I ran a module usage tool (experimental) on Pygame to
see
what is imported. These results are for "import pygame" on Windows with
numpy installed.


[snip a bunch of module names]
I can make the reporting tool available if anyone wants to try it on
their
game.




--
Lenard Lindstrom
<len-l@xxxxxxxxx>