{"action":"created","issue":{"url":"https://api.github.com/repos/hylang/hy/issues/857","labels_url":"https://api.github.com/repos/hylang/hy/issues/857/labels{/name}","comments_url":"https://api.github.com/repos/hylang/hy/issues/857/comments","events_url":"https://api.github.com/repos/hylang/hy/issues/857/events","html_url":"https://github.com/hylang/hy/pull/857","id":97233499,"number":857,"title":"Start of working relative imports","user":{"login":"Foxboron","id":1042946,"avatar_url":"https://avatars.githubusercontent.com/u/1042946?v=3","gravatar_id":"","url":"https://api.github.com/users/Foxboron","html_url":"https://github.com/Foxboron","followers_url":"https://api.github.com/users/Foxboron/followers","following_url":"https://api.github.com/users/Foxboron/following{/other_user}","gists_url":"https://api.github.com/users/Foxboron/gists{/gist_id}","starred_url":"https://api.github.com/users/Foxboron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Foxboron/subscriptions","organizations_url":"https://api.github.com/users/Foxboron/orgs","repos_url":"https://api.github.com/users/Foxboron/repos","events_url":"https://api.github.com/users/Foxboron/events{/privacy}","received_events_url":"https://api.github.com/users/Foxboron/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-25T15:35:39Z","updated_at":"2015-12-12T17:36:23Z","closed_at":"2015-12-12T17:36:23Z","pull_request":{"url":"https://api.github.com/repos/hylang/hy/pulls/857","html_url":"https://github.com/hylang/hy/pull/857","diff_url":"https://github.com/hylang/hy/pull/857.diff","patch_url":"https://github.com/hylang/hy/pull/857.patch"},"body":"The hack is essentially to store any modules we have looked at before and use it as a backup solution. Not the best solution, but out of ideas.\r\n\r\nCurrently there is a bug that i'm not able to debug, but it sort-off works tho.\r\n```\r\nheyho\r\nNope\r\nTraceback (most recent call last):\r\n  File \"/home/fox/.virtualenvs/hy/bin/hy\", line 9, in <module>\r\n    load_entry_point('hy==0.11.0', 'console_scripts', 'hy')()\r\n  File \"/home/fox/.virtualenvs/hy/lib/python3.4/site-packages/hy-0.11.0-py3.4.egg/hy/cmdline.py\", line 347, in hy_main\r\n    sys.exit(cmdline_handler(\"hy\", sys.argv))\r\n  File \"/home/fox/.virtualenvs/hy/lib/python3.4/site-packages/hy-0.11.0-py3.4.egg/hy/cmdline.py\", line 335, in cmdline_handler\r\n    return run_file(options.args[0])\r\n  File \"/home/fox/.virtualenvs/hy/lib/python3.4/site-packages/hy-0.11.0-py3.4.egg/hy/cmdline.py\", line 210, in run_file\r\n    import_file_to_module(\"__main__\", filename)\r\n  File \"/home/fox/.virtualenvs/hy/lib/python3.4/site-packages/hy-0.11.0-py3.4.egg/hy/importer.py\", line 80, in import_file_to_module\r\n    eval(ast_compile(_ast, fpath, \"exec\"), mod.__dict__)\r\n  File \"main.hy\", line 1, in <module>\r\n    (import something)\r\n  File \"<frozen importlib._bootstrap>\", line 2237, in _find_and_load\r\n  File \"<frozen importlib._bootstrap>\", line 2226, in _find_and_load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 1191, in _load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 1161, in _load_backward_compatible\r\n  File \"/home/fox/.virtualenvs/hy/lib/python3.4/site-packages/hy-0.11.0-py3.4.egg/hy/importer.py\", line 184, in load_module\r\n    self.path)\r\n  File \"/home/fox/.virtualenvs/hy/lib/python3.4/site-packages/hy-0.11.0-py3.4.egg/hy/importer.py\", line 80, in import_file_to_module\r\n    eval(ast_compile(_ast, fpath, \"exec\"), mod.__dict__)\r\n  File \"/home/fox/tmp/importtest/something/__init__.hy\", line 2, in <module>\r\n    (import .test2)\r\nValueError: Empty module name\r\n```\r\n\r\nDir structure\r\n```\r\nλ fox@hackbook importtest » ls  \r\nheyho.hy  main.hy  something\r\n\r\nλ fox@hackbook importtest » cat main.hy \r\n(import something)\r\n\r\nλ fox@hackbook importtest » cat heyho.hy \r\n(print \"Nope\")\r\n\r\nλ fox@hackbook importtest » cat something/__init__.hy \r\n(import heyho)\r\n(import .test2)\r\n\r\nλ fox@hackbook importtest » cat something/test2.hy\r\n(print \"Wehey!\")\r\n```\r\n\r\nOther ideas for getting around relative imports?\r\n"},"comment":{"url":"https://api.github.com/repos/hylang/hy/issues/comments/164170624","html_url":"https://github.com/hylang/hy/pull/857#issuecomment-164170624","issue_url":"https://api.github.com/repos/hylang/hy/issues/857","id":164170624,"user":{"login":"paultag","id":132447,"avatar_url":"https://avatars.githubusercontent.com/u/132447?v=3","gravatar_id":"","url":"https://api.github.com/users/paultag","html_url":"https://github.com/paultag","followers_url":"https://api.github.com/users/paultag/followers","following_url":"https://api.github.com/users/paultag/following{/other_user}","gists_url":"https://api.github.com/users/paultag/gists{/gist_id}","starred_url":"https://api.github.com/users/paultag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paultag/subscriptions","organizations_url":"https://api.github.com/users/paultag/orgs","repos_url":"https://api.github.com/users/paultag/repos","events_url":"https://api.github.com/users/paultag/events{/privacy}","received_events_url":"https://api.github.com/users/paultag/received_events","type":"User","site_admin":false},"created_at":"2015-12-12T17:36:23Z","updated_at":"2015-12-12T17:36:23Z","body":"Tests are bombing and no activity on this for a while :)\r\n\r\nClosing! Re-open when it's ready!"}}