Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Py2app 88 #103

Closed
wants to merge 215 commits into from
Closed

Py2app 88 #103

wants to merge 215 commits into from

Conversation

derwolfe
Copy link
Contributor

@derwolfe derwolfe commented Nov 9, 2014

Pushing the first stages of the commit. As of right now, py2app will build the application, but when run, it will fail with the following error:

11/9/14 8:36:46.890 AM mimic[39596]: ImportError: No module named syslog
11/9/14 8:45:41.470 AM mimic[40056]: File "twisted/python/syslog.pyc", line 11, in

I'm pretty sure this is related to how my start-app.py script is working.

Also this has no tests, which will obviously need to change.

@derwolfe
Copy link
Contributor Author

derwolfe commented Nov 9, 2014

related to issue #88

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling fac1cf5 on derwolfe:py2app-88 into 86e9dd9 on rackerlabs:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 092f20c on derwolfe:py2app-88 into c26e5c3 on rackerlabs:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 3488f54 on derwolfe:py2app-88 into c26e5c3 on rackerlabs:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) when pulling 8586739 on derwolfe:py2app-88 into c26e5c3 on rackerlabs:master.

@derwolfe
Copy link
Contributor Author

Also - my apologies for not TDDing this. If I get some time, I'll try to add some test coverage for run-tests.py and start-app.py

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) when pulling 4d8f68f on derwolfe:py2app-88 into c26e5c3 on rackerlabs:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) when pulling 4d8f68f on derwolfe:py2app-88 into c26e5c3 on rackerlabs:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) when pulling 026d400 on derwolfe:py2app-88 into c26e5c3 on rackerlabs:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) when pulling f570897 on derwolfe:py2app-88 into c26e5c3 on rackerlabs:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) when pulling aa91191 on derwolfe:py2app-88 into c26e5c3 on rackerlabs:master.

@derwolfe
Copy link
Contributor Author

This was just rebased against master, so it should have the most recent plugins.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 150ca69 on derwolfe:py2app-88 into 402715c on rackerlabs:master.

@derwolfe
Copy link
Contributor Author

I need to add a note to the docs about the fact that this requires a brewed or non-system python to be used.

(venv)$ pip install -r dev-requirements.txt
(venv)$ pip install -r py2app-requirements.txt

The to build the the application, run ``make`` from the root directory.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Then to build the application

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lekhajee Thanks for noticing this - I've fixed it.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 26e4617 on derwolfe:py2app-88 into 402715c on rackerlabs:master.

@derwolfe
Copy link
Contributor Author

Just as an FYI - I'm going to be on vacation until next Friday, so I'll have sporadic access to email.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 8b99a79 on derwolfe:py2app-88 into 402715c on rackerlabs:master.

@derwolfe
Copy link
Contributor Author

I'm going to try to setup tox to run the builder, then I'll put this up for review.

@glyph
Copy link
Collaborator

glyph commented Dec 30, 2014

Fantastic. Thanks.

@derwolfe
Copy link
Contributor Author

In order to get travis to build the application using an OSX builder, there is a feature flag that needs to be enabled manually by travis's staff. They ask that you send them an email requesting the OSX builder feature be turned on. The steps are detailed at http://docs.travis-ci.com/user/multi-os/#Manual-intervention-required.

If this is ok, could you @glyph or @lekhajee send an email to them asking them to turn the feature on?

Thanks!

@derwolfe
Copy link
Contributor Author

derwolfe commented Mar 4, 2015

It looks like it (it being the py2app portion of setup.py) isn't pulling in the mimic/twisted/plugins/mimic.py file.

@glyph
Copy link
Collaborator

glyph commented Mar 4, 2015

Could this be because we added the --develop option to tox in b4f61dd in order to get the coverage report to accurately reflect the plugin file being imported?

@derwolfe
Copy link
Contributor Author

derwolfe commented Mar 4, 2015

I'm pretty sure it isn't - it is happening locally as well.

@glyph
Copy link
Collaborator

glyph commented Mar 4, 2015

Hrm. But only after merging master?

@glyph
Copy link
Collaborator

glyph commented Mar 4, 2015

Now I'm getting this: https://gist.github.com/glyph/fcc354d38222dd9d4ae0

@derwolfe
Copy link
Contributor Author

derwolfe commented Mar 4, 2015

It looks this is the commit that introduced the change: b71c72f

@derwolfe
Copy link
Contributor Author

derwolfe commented Mar 4, 2015

Do you get the same error if you run ./build-app.sh?

@glyph
Copy link
Collaborator

glyph commented Mar 4, 2015

No, then I get exceptions.ImportError: No module named mimic, same as on travis…

@glyph
Copy link
Collaborator

glyph commented Mar 4, 2015

Looking inside site_packages.zip, I don't even see twisted's own plugins:

★ unzip -l dist/mimic.app/Contents/Resources/lib/python2.7/site-packages.zip | grep twisted/plugins
      499  03-03-15 17:58   twisted/plugins/__init__.pyc
     9751  03-03-15 17:58   twisted/plugins/dropin.cache

@derwolfe
Copy link
Contributor Author

derwolfe commented Mar 4, 2015

Yes - I just found that as well! It looks like it generates a dropin.cache, but nothing else..

@glyph
Copy link
Collaborator

glyph commented Mar 4, 2015

It's possible that --system-site-packages is causing some confusion. Have you had any better luck with your own pyobjc?

@glyph
Copy link
Collaborator

glyph commented Mar 4, 2015

Without --system-site-packages, I'm back to the scan_code error.

@derwolfe
Copy link
Contributor Author

derwolfe commented Mar 4, 2015

With the scan_code error, which version of py2app are you running? If I remember correctly, newer versions of py2app have an issue. I need to pin the py2app dependencies, instead of just minimum requirements.

@glyph
Copy link
Collaborator

glyph commented Mar 4, 2015

Yeah, I was just messing around with py2app versions…

@glyph
Copy link
Collaborator

glyph commented Mar 4, 2015

I think the version with the error was 0.9?

@glyph
Copy link
Collaborator

glyph commented Mar 4, 2015

When pinning it to 0.8.1, I now get this at the end of the test run:

+ python setup.py py2app
Traceback (most recent call last):
  File "setup.py", line 8, in <module>
    from py2app.build_app import py2app
  File "/Users/glyph/Projects/Mimic/venv-app/lib/python2.7/site-packages/py2app/__init__.py", line 31, in <module>
    __version__ = pkg_resources.require('py2app')[0].version
  File "/Users/glyph/Projects/Mimic/venv-app/lib/python2.7/site-packages/pkg_resources/__init__.py", line 918, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/Users/glyph/Projects/Mimic/venv-app/lib/python2.7/site-packages/pkg_resources/__init__.py", line 810, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (modulegraph 0.10.4 (/Users/glyph/Projects/Mimic/venv-app/lib/python2.7/site-packages), Requirement.parse('modulegraph>=0.11'), set(['py2app']))
+ ./dist/mimic.app/Contents/MacOS/run-tests
build-app.sh: line 33: ./dist/mimic.app/Contents/MacOS/run-tests: No such file or directory

@derwolfe
Copy link
Contributor Author

derwolfe commented Mar 4, 2015

I'm now getting odd framework python build errors on my machine.

@glyph
Copy link
Collaborator

glyph commented Mar 4, 2015

I think one thing that might be screwing it up is the fact that if py2app is available at all, the setup.py no longer provides any of the other necessary build metadata to the build process, such as package_dir or packages.

@glyph
Copy link
Collaborator

glyph commented Mar 4, 2015

I am deeply confused. py2app appears to have regressed in some way since the last time I was looking at this; and not just regressed in its current version, but older versions are broken too. I really don't understand what is going on, but clearly that AttributeError is a py2app bug and we should report it.

@derwolfe
Copy link
Contributor Author

derwolfe commented Mar 4, 2015

I'm quite confused myself. One way or another, I'm now getting the following error, using the same steps as before.

2015-03-03 21:46:09.077 run-tests[33926:88303] A Python runtime not could be located. You may need to install a framework build of Python, or edit the PyRuntimeLocations array in this application's Info.plist file.

The env is still being built using the system python too.

@glyph
Copy link
Collaborator

glyph commented Mar 4, 2015

one of the many bugs blocking us seems to be https://bitbucket.org/ronaldoussoren/py2app/issue/156/virtualenvpy-recipe-calls-methods-renamed so I've commented there...

@glyph
Copy link
Collaborator

glyph commented Mar 4, 2015

Since that bug is in the virtualenv recipe, I have now been messing around with using --user installation to get things set up instead of a virtualenv. I'm getting a little further, but still having trouble generating the plugin.cache and getting it into the zip file.

@glyph glyph mentioned this pull request Mar 4, 2015
@lekhajee
Copy link
Contributor

Merged #191, which includes all the commits from this PR. Closing this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants