{"action":"created","issue":{"url":"https://api.github.com/repos/morepath/morepath/issues/319","labels_url":"https://api.github.com/repos/morepath/morepath/issues/319/labels{/name}","comments_url":"https://api.github.com/repos/morepath/morepath/issues/319/comments","events_url":"https://api.github.com/repos/morepath/morepath/issues/319/events","html_url":"https://github.com/morepath/morepath/issues/319","id":72095770,"number":319,"title":"If there is no buildout and no eggs, morepath.autosetup fails","user":{"login":"href","id":273163,"avatar_url":"https://avatars.githubusercontent.com/u/273163?v=3","gravatar_id":"","url":"https://api.github.com/users/href","html_url":"https://github.com/href","followers_url":"https://api.github.com/users/href/followers","following_url":"https://api.github.com/users/href/following{/other_user}","gists_url":"https://api.github.com/users/href/gists{/gist_id}","starred_url":"https://api.github.com/users/href/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/href/subscriptions","organizations_url":"https://api.github.com/users/href/orgs","repos_url":"https://api.github.com/users/href/repos","events_url":"https://api.github.com/users/href/events{/privacy}","received_events_url":"https://api.github.com/users/href/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-30T08:14:47Z","updated_at":"2015-04-30T09:55:15Z","closed_at":null,"body":"I developed a kind of application server for my project that loads a configuration file and then starts a Morepath application. This works great in my development buildout environment, but it utterly fails when I deploy using pip.\r\n\r\nMorepath tries to scan *all* my packages in this case (not just the ones depending on Morepath). This fails with various scanning errors, as not all packages lend themselves to be scanned.\r\n\r\nWhat's interesting is that this only fails if there are no eggs. If I install my package using `pip install --egg` it works, at least under Python 3 (pip under Python 2 fails to actually create eggs for most packages).\r\n\r\nI can work around the problem by either installing using `pip install --egg` under Python 3, or to not use morepath.autosetup. But I like morepath.autosetup and it would be great if it got more robust.\r\n\r\nI don't really have a test case for this unfortunately, because I don't quiet see how to do that here. You can however reproduce the error by installing my package. Unfortunately this requires having Postgres and Memcached installed. If that is given, run this to reproduce the error:\r\n\r\n```\r\nbrew install libmemcached\r\npip install onegov.town\r\n\r\ncurl https://raw.githubusercontent.com/OneGov/dev/master/onegov.yml.example > onegov.yml\r\nonegov-server\r\n```\r\n\r\nThe error seems to stem from the `morepath_packages` method. If no eggs are installed, the paths it finds are as follows:\r\n\r\n```\r\n/Users/denis/.virtualenvs/town-3-default/lib/python3.4/site-packages\r\n/Users/denis/.virtualenvs/town-3-default/lib/python3.4/site-packages\r\n... and so on ..\r\n```\r\nThough fixing those paths doesn't really help. I tried various small fixes, but I'm a bit confused how `morepath_packages` is supposed to work. It's function should basically be to return all modules that depend on Morepath, right? It seems like there should be a better, cleaner way. But then this is Python packaging, so I'm assuming this is messy :)\r\n\r\nAnyway, I'm still investigating this, any hints would be appreciated."},"comment":{"url":"https://api.github.com/repos/morepath/morepath/issues/comments/97725358","html_url":"https://github.com/morepath/morepath/issues/319#issuecomment-97725358","issue_url":"https://api.github.com/repos/morepath/morepath/issues/319","id":97725358,"user":{"login":"faassen","id":327472,"avatar_url":"https://avatars.githubusercontent.com/u/327472?v=3","gravatar_id":"","url":"https://api.github.com/users/faassen","html_url":"https://github.com/faassen","followers_url":"https://api.github.com/users/faassen/followers","following_url":"https://api.github.com/users/faassen/following{/other_user}","gists_url":"https://api.github.com/users/faassen/gists{/gist_id}","starred_url":"https://api.github.com/users/faassen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faassen/subscriptions","organizations_url":"https://api.github.com/users/faassen/orgs","repos_url":"https://api.github.com/users/faassen/repos","events_url":"https://api.github.com/users/faassen/events{/privacy}","received_events_url":"https://api.github.com/users/faassen/received_events","type":"User","site_admin":false},"created_at":"2015-04-30T09:55:15Z","updated_at":"2015-04-30T09:55:15Z","body":"On Apr 30, 2015 11:25, \"Denis Krienbühl\" <notifications@github.com> wrote:\n>\n\n> That might just be me, but it seems weird to me that the namespace\nfixtures are named ns and ns2, when I would expect them to be named ns.real\nand ns2.real. I assumed doing namespace packages meant naming them with the\nnamespace included, but I can't find any canon about this. But in my years\nof working with Zope/Plone I haven't seen any packages that run under a\nnamespace, without having that namespace prefixed to the package name.\n\nReal quick, not much time now:\n\nThere is absolutely no requirement that project names in setup.py match\nnamespaces or module names. So if you rely on this you can't.\n\nAlso: the tox tests test this behavior and do not rely on buildout at all.\nAre they installing things as eggs? I think tox uses pip.\n\nRegards,\n\nMartijn\n"}}