{"action":"reopened","issue":{"url":"https://api.github.com/repos/joke2k/faker/issues/804","repository_url":"https://api.github.com/repos/joke2k/faker","labels_url":"https://api.github.com/repos/joke2k/faker/issues/804/labels{/name}","comments_url":"https://api.github.com/repos/joke2k/faker/issues/804/comments","events_url":"https://api.github.com/repos/joke2k/faker/issues/804/events","html_url":"https://github.com/joke2k/faker/issues/804","id":354049689,"node_id":"MDU6SXNzdWUzNTQwNDk2ODk=","number":804,"title":"Commandline faker can't import community providers","user":{"login":"crd","id":152584,"node_id":"MDQ6VXNlcjE1MjU4NA==","avatar_url":"https://avatars1.githubusercontent.com/u/152584?v=4","gravatar_id":"","url":"https://api.github.com/users/crd","html_url":"https://github.com/crd","followers_url":"https://api.github.com/users/crd/followers","following_url":"https://api.github.com/users/crd/following{/other_user}","gists_url":"https://api.github.com/users/crd/gists{/gist_id}","starred_url":"https://api.github.com/users/crd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crd/subscriptions","organizations_url":"https://api.github.com/users/crd/orgs","repos_url":"https://api.github.com/users/crd/repos","events_url":"https://api.github.com/users/crd/events{/privacy}","received_events_url":"https://api.github.com/users/crd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-08-25T23:01:48Z","updated_at":"2018-09-22T14:03:45Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"See below, where I try to invoke `foo` from `mymodule` included with tests here: https://github.com/joke2k/faker/tree/master/tests/mymodule\r\n\r\n### Steps to reproduce\r\n\r\n```bash\r\n$ faker --version\r\nfaker 0.9.0\r\n$ cd workspaces/contrib/faker\r\n$ ls tests/mymodule/en_US\r\n__init__.py\r\n$ faker foo -i tests.mymodule.en_US\r\nTraceback (most recent call last):\r\n  File \"/Users/user/.pyenv/versions/3.6.6/bin/faker\", line 11, in <module>\r\n    load_entry_point('Faker==0.9.0', 'console_scripts', 'faker')()\r\n  File \"/Users/user/.pyenv/versions/3.6.6/lib/python3.6/site-packages/Faker-0.9.0-py3.6.egg/faker/cli.py\", line 282, in execute_from_command_line\r\n    command.execute()\r\n  File \"/Users/user/.pyenv/versions/3.6.6/lib/python3.6/site-packages/Faker-0.9.0-py3.6.egg/faker/cli.py\", line 264, in execute\r\n    includes=arguments.include\r\n  File \"/Users/user/.pyenv/versions/3.6.6/lib/python3.6/site-packages/Faker-0.9.0-py3.6.egg/faker/cli.py\", line 71, in print_doc\r\n    fake = Faker(locale=lang, includes=includes)\r\n  File \"/Users/user/.pyenv/versions/3.6.6/lib/python3.6/site-packages/Faker-0.9.0-py3.6.egg/faker/factory.py\", line 58, in create\r\n    prov_cls, lang_found = cls._get_provider_class(prov_name, locale)\r\n  File \"/Users/user/.pyenv/versions/3.6.6/lib/python3.6/site-packages/Faker-0.9.0-py3.6.egg/faker/factory.py\", line 69, in _get_provider_class\r\n    provider_class = cls._find_provider_class(provider, locale)\r\n  File \"/Users/user/.pyenv/versions/3.6.6/lib/python3.6/site-packages/Faker-0.9.0-py3.6.egg/faker/factory.py\", line 92, in _find_provider_class\r\n    provider_module = import_module(provider_path)\r\n  File \"/Users/user/.pyenv/versions/3.6.6/lib/python3.6/importlib/__init__.py\", line 126, in import_module\r\n    return _bootstrap._gcd_import(name[level:], package, level)\r\n  File \"<frozen importlib._bootstrap>\", line 994, in _gcd_import\r\n  File \"<frozen importlib._bootstrap>\", line 971, in _find_and_load\r\n  File \"<frozen importlib._bootstrap>\", line 941, in _find_and_load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed\r\n  File \"<frozen importlib._bootstrap>\", line 994, in _gcd_import\r\n  File \"<frozen importlib._bootstrap>\", line 971, in _find_and_load\r\n  File \"<frozen importlib._bootstrap>\", line 941, in _find_and_load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 219, in _call_with_frames_removed\r\n  File \"<frozen importlib._bootstrap>\", line 994, in _gcd_import\r\n  File \"<frozen importlib._bootstrap>\", line 971, in _find_and_load\r\n  File \"<frozen importlib._bootstrap>\", line 953, in _find_and_load_unlocked\r\nModuleNotFoundError: No module named 'tests'\r\n```\r\n\r\n\r\n\r\n### Expected behavior\r\n\r\n`foo` from the external module `mymodule` should be invoked.\r\n\r\n### Actual behavior\r\n\r\n`ModuleNotFoundError`\r\n\r\nWhile I'm at it, I should call out that the mechanism for providing a path to the module to be imported (path delimited with periods) is very weird. While refactoring this I'd recommend updating the command as `-i path/to/module/directory/`"}}
{"actor":{"display_login":"crd"}}