1. Ronald Oussoren
  2. py2app
  3. Issues

Issues

Issue #71 new

--extra-scripts=bar/bar.py does not find dependencies in bar

Andrew Barnert
created an issue

After the fix for #68, you can now pass --extra-scripts=bar/bar.py and it properly builds the app.

However, it apparently looks for dependencies in bar/bar.py in . instead of bar, which means it ultimately silently fails to copy in necessary dependencies.

In the attached test project, foo.py properly pulls qux.py into python33.zip, but bar/bar.py does not pull bar/baz.py in, so you get an import error on attempting to run the packaged bar.

Comments (1)

  1. Ronald Oussoren repo owner

    Fixing this for the general case could be hard. In particular, the current bundle and zipfile structure won't work when two scripts in different directories both import a module with the same name, but in their respective directories. In your test project: when both foo.py and bar.py import qux.py and qux.py is both at the toplevel and in 'bar/'.

    Doing the right thing for your test project should be easier, but detecting cross-contamination would be hard.

    In the longer run py2app should calculate a new module graph for every directory containing scripts and merge them. This would do the right thing for the test project, and would detect naming conflicts between modules used in the different script directories.

    BTW. "silently fails to copy dependencies" is a known issue, not only here but also in more basic cases. The verbose output of py2app probably already contains the needed data, but in a fairly useless manner (way to verbose), it should be fairly easy to print a short report at the end that mentions which dependencies weren't copied into the bundle.

  2. Log in to comment