{"action":"created","issue":{"url":"https://api.github.com/repos/networkx/networkx-metis/issues/16","labels_url":"https://api.github.com/repos/networkx/networkx-metis/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/networkx/networkx-metis/issues/16/comments","events_url":"https://api.github.com/repos/networkx/networkx-metis/issues/16/events","html_url":"https://github.com/networkx/networkx-metis/pull/16","id":91424746,"number":16,"title":"Setup Travis-CI","user":{"login":"OrkoHunter","id":8065913,"avatar_url":"https://avatars.githubusercontent.com/u/8065913?v=3","gravatar_id":"","url":"https://api.github.com/users/OrkoHunter","html_url":"https://github.com/OrkoHunter","followers_url":"https://api.github.com/users/OrkoHunter/followers","following_url":"https://api.github.com/users/OrkoHunter/following{/other_user}","gists_url":"https://api.github.com/users/OrkoHunter/gists{/gist_id}","starred_url":"https://api.github.com/users/OrkoHunter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OrkoHunter/subscriptions","organizations_url":"https://api.github.com/users/OrkoHunter/orgs","repos_url":"https://api.github.com/users/OrkoHunter/repos","events_url":"https://api.github.com/users/OrkoHunter/events{/privacy}","received_events_url":"https://api.github.com/users/OrkoHunter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/networkx/networkx-metis/milestones/1","html_url":"https://github.com/networkx/networkx-metis/milestones/networkx-metis-1.0","labels_url":"https://api.github.com/repos/networkx/networkx-metis/milestones/1/labels","id":1152940,"number":1,"title":"networkx-metis-1.0","description":"","creator":{"login":"ysitu","id":7018196,"avatar_url":"https://avatars.githubusercontent.com/u/7018196?v=3","gravatar_id":"","url":"https://api.github.com/users/ysitu","html_url":"https://github.com/ysitu","followers_url":"https://api.github.com/users/ysitu/followers","following_url":"https://api.github.com/users/ysitu/following{/other_user}","gists_url":"https://api.github.com/users/ysitu/gists{/gist_id}","starred_url":"https://api.github.com/users/ysitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ysitu/subscriptions","organizations_url":"https://api.github.com/users/ysitu/orgs","repos_url":"https://api.github.com/users/ysitu/repos","events_url":"https://api.github.com/users/ysitu/events{/privacy}","received_events_url":"https://api.github.com/users/ysitu/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":20,"state":"open","created_at":"2015-06-06T19:20:10Z","updated_at":"2015-06-30T17:54:34Z","due_on":"2015-07-08T07:00:00Z","closed_at":null},"comments":74,"created_at":"2015-06-27T06:36:57Z","updated_at":"2015-07-04T19:33:56Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/networkx/networkx-metis/pulls/16","html_url":"https://github.com/networkx/networkx-metis/pull/16","diff_url":"https://github.com/networkx/networkx-metis/pull/16.diff","patch_url":"https://github.com/networkx/networkx-metis/pull/16.patch"},"body":"Fixes #12 .\r\n\r\nNOTES\r\n\r\n* Currently, instead of `pip install networkx`, I'm installing [this branch](https://github.com/orkohunter/networkx/tree/addons) from my fork of networkx.\r\n* Because of which, `nosetests` is checking the entire `networkx` + `networkx+metis` library.\r\n* Building with branches `master` `setup` and `travis-ci` all merged in one `travis-test` over [https://travis-ci.org/OrkoHunter/networkx-metis](https://travis-ci.org/OrkoHunter/networkx-metis)\r\n* Build status : Passing.\r\n\r\n*But it's not ready yet.* Namespace packaging is done, but there seems to be a little problem while installing. `setup.py` is installing a strange file named `_metis.py` in the same location as `_metis.so` with the following content\r\n```py\r\ndef __bootstrap__():\r\n   global __bootstrap__, __loader__, __file__\r\n   import sys, pkg_resources, imp\r\n   __file__ = pkg_resources.resource_filename(__name__,'_metis.so')\r\n   __loader__ = None; del __bootstrap__, __loader__\r\n   imp.load_dynamic(__name__,__file__)\r\n__bootstrap__()\r\n```\r\nThis file is causing trouble and interfering while importing `networkx.addons.metis._metis`. Renaming the `.so` file doesn't help either, the new file is given the same name except for having `.py` extension.\r\n\r\nRelated : http://askubuntu.com/questions/442357/environment-setup-for-importing-a-userdefined-module/442363#comment917656_442363"},"comment":{"url":"https://api.github.com/repos/networkx/networkx-metis/issues/comments/118544948","html_url":"https://github.com/networkx/networkx-metis/pull/16#issuecomment-118544948","issue_url":"https://api.github.com/repos/networkx/networkx-metis/issues/16","id":118544948,"user":{"login":"OrkoHunter","id":8065913,"avatar_url":"https://avatars.githubusercontent.com/u/8065913?v=3","gravatar_id":"","url":"https://api.github.com/users/OrkoHunter","html_url":"https://github.com/OrkoHunter","followers_url":"https://api.github.com/users/OrkoHunter/followers","following_url":"https://api.github.com/users/OrkoHunter/following{/other_user}","gists_url":"https://api.github.com/users/OrkoHunter/gists{/gist_id}","starred_url":"https://api.github.com/users/OrkoHunter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OrkoHunter/subscriptions","organizations_url":"https://api.github.com/users/OrkoHunter/orgs","repos_url":"https://api.github.com/users/OrkoHunter/repos","events_url":"https://api.github.com/users/OrkoHunter/events{/privacy}","received_events_url":"https://api.github.com/users/OrkoHunter/received_events","type":"User","site_admin":false},"created_at":"2015-07-04T19:33:56Z","updated_at":"2015-07-04T19:33:56Z","body":"##### A short report after some long hours of debugging and trying things out (a great time sink)\r\n\r\n`NetworkX` uses a very nice way of testing the installed code. With these two lines\r\n```\r\nexport NX_INSTALL=`pip show networkx | grep Location | awk '{print $2\"/networkx\"}'`\r\ncd $NX_INSTALL\r\n```\r\nit migrates the path to `.egg` directory inside the `site-packages` and runs `nosetests` there.\r\n\r\n*So, why don't we simply use it for `networkx-metis`?*\r\n\r\nTaken from http://svn.python.org/projects/sandbox/trunk/setuptools/doc/formats.txt\r\n\r\n> There are two basic formats currently implemented for Python eggs:\r\n>\r\n> 1. ``.egg`` format: a directory or zipfile *containing* the project's\r\n   code and resources, along with an ``EGG-INFO`` subdirectory that\r\n   contains the project's metadata\r\n> \r\n> 2. ``.egg-info`` format: a file or directory placed *adjacent* to the\r\n   project's code and resources, that directly contains the project's\r\n   metadata.\r\n\r\nSo, I tried three different builds [#113](https://travis-ci.org/OrkoHunter/networkx-metis/builds/69556504) [#114](https://travis-ci.org/OrkoHunter/networkx-metis/builds/69557106) and [#115](https://travis-ci.org/OrkoHunter/networkx-metis/builds/69558906) with `pip install -e .`, `pip install .` and `python setup.py install` respectively. and got three different results in all three cases.\r\n\r\n1. In first case, an [`.egg-link`](https://travis-ci.org/OrkoHunter/networkx-metis/builds/69556504#L766) is generated and is installed inside `site-packages`. It's just a symbolic link to where the code is actually building, `/home/travis/build` in that case. So, there is no installed code inside `site-packages` for networkx-metis to test.\r\n\r\n2. In second case, a [`.egg-info`](https://travis-ci.org/OrkoHunter/networkx-metis/builds/69557106#L3347) and a [`-nspkg.pth`](https://travis-ci.org/OrkoHunter/networkx-metis/builds/69557106#L3348) files are being created. `.pth` file simply adds the building directory's path inside `sys.path`. So, it also acts as a symlink for the actual `build` directory.\r\n\r\n3. This one creates a [`.egg`](https://travis-ci.org/OrkoHunter/networkx-metis#L1092) file inside site-packages. But unlike the case of `NetworkX` which has a directory type `.egg` inside `site-packages`, `Networkx-Metis` seems to be generating an archive `.egg`. The single line of code which I mentioned above won't work for this.\r\n\r\nSo, the possible way I can think of is to write script to extract the archieve, `cd` into it and then test it."}}