Tool for finding external dependencies

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rob Cakebread

    #1

    Tool for finding external dependencies

    Hi,

    I need to find external dependencies for modules (not Python standard
    library imports).

    Currently I use pylint and manually scan the output, which is very
    nice, or use pylint's --ext-import-graph option to create a .dot file
    and extract the info from it, but either way can take a very long
    time.

    I'm aware of Python's modulefinder.py , but it doesn't find external
    dependencies (or at least I don't know how to make it do them).

    Thanks,
    Rob

  • kyosohma@gmail.com

    #2
    Re: Tool for finding external dependencies

    On Jul 8, 8:39 pm, Rob Cakebread <gentoo...@gmai l.comwrote:
    Hi,
    >
    I need to find external dependencies for modules (not Python standard
    library imports).
    >
    Currently I use pylint and manually scan the output, which is very
    nice, or use pylint's --ext-import-graph option to create a .dot file
    and extract the info from it, but either way can take a very long
    time.
    >
    I'm aware of Python's modulefinder.py , but it doesn't find external
    dependencies (or at least I don't know how to make it do them).
    >
    Thanks,
    Rob
    Recently I ran into some debugging issues and the freeware app
    "Dependency Walker" was suggested to me. I still haven't used it much
    since I only got it last Friday, but it looks promising:
    depends,depends.exe,dependency walker,dependency,walker,dependencies,DLL,EXE,OCX,SYS,import,export,dynamic,implicit,explicit,function,GetProcAddress,LoadLibrary,DllMain,file,found,missing,unresolved,external,version,hook,dumpbin,quickview,quikview,full,path,module,library,procedure,entry,point,windows,win32,utility,tool,application,COM,OLE,VB,Visual,Basic,C++,mangled,decorated,PE,executable,link,compile,initialize,checksum,error,failure,show,reveal


    Mike

    Comment

    • Rob Cakebread

      #3
      Re: Tool for finding external dependencies

      On Jul 9, 7:17 am, kyoso...@gmail. com wrote:
      >
      Recently I ran into some debugging issues and the freeware app
      "Dependency Walker" was suggested to me. I still haven't used it much
      since I only got it last Friday, but it looks promising:http://www.dependencywalker.com
      >
      Mike
      Thanks Mike, but I'm just trying to determine Python imports, like:

      $ pylint g_pypi

      [snip lots of other tests which take a lonnnnnng time]

      External dependencies
      ---------------------
      ::

      configobj (g_pypi.config)
      portage (g_pypi.enamer, g_pypi.portage_ utils,g_pypi.cl i)
      pkg_resources (g_pypi.cli,g_p ypi.ebuild)
      yolk
      \-pypi (g_pypi.cli)
      \-setuptools_supp ort (g_pypi.cli)
      \-yolklib (g_pypi.cli)
      gentoolkit (g_pypi.portage _utils)
      pygments (g_pypi.ebuild)
      \-lexers (g_pypi.ebuild)
      \-formatters (g_pypi.ebuild)
      Cheetah
      \-Template (g_pypi.ebuild)


      Comment

      • kyosohma@gmail.com

        #4
        Re: Tool for finding external dependencies

        On Jul 9, 9:27 am, Rob Cakebread <gentoo...@gmai l.comwrote:
        On Jul 9, 7:17 am, kyoso...@gmail. com wrote:
        >
        >
        >
        Recently I ran into some debugging issues and the freeware app
        "Dependency Walker" was suggested to me. I still haven't used it much
        since I only got it last Friday, but it looks promising:http://www.dependencywalker.com
        >
        Mike
        >
        Thanks Mike, but I'm just trying to determine Python imports, like:
        >
        $ pylint g_pypi
        >
        [snip lots of other tests which take a lonnnnnng time]
        >
        External dependencies
        ---------------------
        ::
        >
        configobj (g_pypi.config)
        portage (g_pypi.enamer, g_pypi.portage_ utils,g_pypi.cl i)
        pkg_resources (g_pypi.cli,g_p ypi.ebuild)
        yolk
        \-pypi (g_pypi.cli)
        \-setuptools_supp ort (g_pypi.cli)
        \-yolklib (g_pypi.cli)
        gentoolkit (g_pypi.portage _utils)
        pygments (g_pypi.ebuild)
        \-lexers (g_pypi.ebuild)
        \-formatters (g_pypi.ebuild)
        Cheetah
        \-Template (g_pypi.ebuild)
        Hmmm...I also use GUI2Exe, which may help you too. It'll list "missing
        modules" and binary dependencies. It's basically a GUI interface to
        py2exe:




        This looks interesting, but I've never used it:




        Finally, here's some more info on modulefinder:



        Looks like you run modulefinder like this:

        <code>

        mod = modulefinder.Mo duleFinder()
        mod.run_script( path/to/python_script.p y)
        mod.report()

        </code>

        Mike

        Comment

        • Rob Cakebread

          #5
          Re: Tool for finding external dependencies

          On Jul 9, 7:54 am, kyoso...@gmail. com wrote:
          <snip>
          <code>
          >
          mod = modulefinder.Mo duleFinder()
          mod.run_script( path/to/python_script.p y)
          mod.report()
          >
          </code>
          >
          Mike
          Nope. All of those tools and the code above show *all* imports/
          dependencies, which is way too much information. I just need the
          'external' dependencies, like in the example from pylint I pasted
          above. If nothing exists I'll just have to figure out how pylint does
          it.

          I'm working on g-pypi which creates ebuilds for Gentoo Linux. For
          packages that use setuptools I can get the dependencies easily enough
          because of 'install_requir es', but for packages that don't, I need
          another way to find them.

          Thanks,
          Rob

          Comment

          • Alex Popescu

            #6
            Re: Tool for finding external dependencies

            On Jul 9, 6:42 pm, Rob Cakebread <gentoo...@gmai l.comwrote:
            On Jul 9, 7:54 am, kyoso...@gmail. com wrote:
            <snip>
            >
            <code>
            >
            mod = modulefinder.Mo duleFinder()
            mod.run_script( path/to/python_script.p y)
            mod.report()
            >
            </code>
            >
            Mike
            >
            Nope. All of those tools and the code above show *all* imports/
            dependencies, which is way too much information. I just need the
            'external' dependencies, like in the example from pylint I pasted
            above. If nothing exists I'll just have to figure out how pylint does
            it.
            >
            Isn't it possible to get from modulefinder what it has found and just
            filter it out according to your rules?
            This way you are in control and can deicde what is internal/external.

            ../alex
            --
            ..w( the_mindstorm )p.
            I'm working on g-pypi which creates ebuilds for Gentoo Linux. For
            packages that use setuptools I can get the dependencies easily enough
            because of 'install_requir es', but for packages that don't, I need
            another way to find them.
            >
            Thanks,
            Rob

            Comment

            • Rob Cakebread

              #7
              Re: Tool for finding external dependencies

              On Jul 9, 9:23 am, Alex Popescu <the.mindstorm. mailingl...@gma il.com>
              wrote:
              Isn't it possible to get from modulefinder what it has found and just
              filter it out according to your rules?
              This way you are in control and can deicde what is internal/external.
              >
              At first glance it looked easy enough, by just filtering out
              everything that isn't in site-packages, but that isn't quite accurate
              as accurate as pylint and it also shows indirect dependencies too.
              e.g. pkga imports pkgb, which imports pkgc. I don't want pkgc.

              To clarify, if I had a module with:

              import os,sys, re
              import sqlobject

              I only want to know about sqlobject. I don't want any of sqlobject's
              dependencies, such as MySQLdb, pysqlite2, psycopg2 etc. which
              modulefinder shows also.

              And as far as I can tell, modulefinder needs a Python script, but its
              much easier for me to find a package's modules automatically.


              Thanks,
              Rob



              Comment

              • John J. Lee

                #8
                Re: Tool for finding external dependencies

                Rob Cakebread <gentoodev@gmai l.comwrites:
                Hi,
                >
                I need to find external dependencies for modules (not Python standard
                library imports).
                >
                Currently I use pylint and manually scan the output, which is very
                nice, or use pylint's --ext-import-graph option to create a .dot file
                and extract the info from it, but either way can take a very long
                time.
                >
                I'm aware of Python's modulefinder.py , but it doesn't find external
                dependencies (or at least I don't know how to make it do them).
                Try looking at py2exe and pyinstaller. They may have useful ideas.


                John

                Comment

                • syt

                  #9
                  Re: Tool for finding external dependencies

                  On Jul 9, 3:39 am, Rob Cakebread <gentoo...@gmai l.comwrote:
                  Hi,
                  >
                  I need to find external dependencies for modules (not Python standard
                  library imports).
                  >
                  Currently I usepylintand manually scan the output, which is very
                  nice, or usepylint's--ext-import-graph option to create a .dot file
                  and extract the info from it, but either way can take a very long
                  time.
                  >
                  I'm aware of Python's modulefinder.py , but it doesn't find external
                  dependencies (or at least I don't know how to make it do them).
                  notice that you can launch pylint in the following way to disabling
                  everything but dependencies analysis : ::

                  pylint --enable-checker=imports yourproject

                  this will disable all others checkers and you may gain a signifiant
                  speedup.

                  -- Sylvain

                  Comment

                  Working...