{"action":"created","issue":{"url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/4824","repository_url":"https://api.github.com/repos/sphinx-doc/sphinx","labels_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/4824/labels{/name}","comments_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/4824/comments","events_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/4824/events","html_url":"https://github.com/sphinx-doc/sphinx/pull/4824","id":312401018,"number":4824,"title":"Added support for reading .pyi files.","user":{"login":"alliefitter","id":13684558,"avatar_url":"https://avatars2.githubusercontent.com/u/13684558?v=4","gravatar_id":"","url":"https://api.github.com/users/alliefitter","html_url":"https://github.com/alliefitter","followers_url":"https://api.github.com/users/alliefitter/followers","following_url":"https://api.github.com/users/alliefitter/following{/other_user}","gists_url":"https://api.github.com/users/alliefitter/gists{/gist_id}","starred_url":"https://api.github.com/users/alliefitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alliefitter/subscriptions","organizations_url":"https://api.github.com/users/alliefitter/orgs","repos_url":"https://api.github.com/users/alliefitter/repos","events_url":"https://api.github.com/users/alliefitter/events{/privacy}","received_events_url":"https://api.github.com/users/alliefitter/received_events","type":"User","site_admin":false},"labels":[{"id":162415664,"url":"https://api.github.com/repos/sphinx-doc/sphinx/labels/autodoc","name":"autodoc","color":"FFFFFF","default":false},{"id":162429779,"url":"https://api.github.com/repos/sphinx-doc/sphinx/labels/proposal","name":"proposal","color":"207de5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-09T05:45:18Z","updated_at":"2018-04-09T20:05:02Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/sphinx-doc/sphinx/pulls/4824","html_url":"https://github.com/sphinx-doc/sphinx/pull/4824","diff_url":"https://github.com/sphinx-doc/sphinx/pull/4824.diff","patch_url":"https://github.com/sphinx-doc/sphinx/pull/4824.patch"},"body":"Subject: Added support for reading .pyi files\r\n\r\n### Feature or Bugfix\r\n- Feature\r\n\r\n### Purpose\r\nI created a class that dynamically builds its methods at runtime and wanted to create some docs for it. \r\nSo, I made a .pyi file with the dynamic methods defined and with docstrings. PyCharm was able to read this file and provide code completion and documentation, but sphinx required a little changing. The change in this commit is more of a proof of concept than anything. I REALLY don't know this codebase or how best to incorporate this--as a change to sphinx or as an extension. I'd really appreciate any thoughts or guidance on what I can do to expose this functionality.  \r\n\r\n### Detail\r\n- When importing a module, checks if a .pyi file exists by using `os.path.isfile('{}i'.format(module.__file__))`.\r\n- Imports the .pyi file using `importlib`.\r\n- Replaces the original module with the one imported from the .pyi file.\r\n- From testing, sphinx doesn't seem to have any issues using the object imported from .pyi file. \r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/comments/379876928","html_url":"https://github.com/sphinx-doc/sphinx/pull/4824#issuecomment-379876928","issue_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/4824","id":379876928,"user":{"login":"alliefitter","id":13684558,"avatar_url":"https://avatars2.githubusercontent.com/u/13684558?v=4","gravatar_id":"","url":"https://api.github.com/users/alliefitter","html_url":"https://github.com/alliefitter","followers_url":"https://api.github.com/users/alliefitter/followers","following_url":"https://api.github.com/users/alliefitter/following{/other_user}","gists_url":"https://api.github.com/users/alliefitter/gists{/gist_id}","starred_url":"https://api.github.com/users/alliefitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alliefitter/subscriptions","organizations_url":"https://api.github.com/users/alliefitter/orgs","repos_url":"https://api.github.com/users/alliefitter/repos","events_url":"https://api.github.com/users/alliefitter/events{/privacy}","received_events_url":"https://api.github.com/users/alliefitter/received_events","type":"User","site_admin":false},"created_at":"2018-04-09T20:05:02Z","updated_at":"2018-04-09T20:05:02Z","author_association":"NONE","body":"It's a stub file introduced in [PEP 484](https://www.python.org/dev/peps/pep-0484/#stub-files). Meant so you can use `typing` to add annotations without breaking in pre-python 3.5. See also [typeshed](https://github.com/python/typeshed) which is included with PyCharm."}}
{"actor":{"display_login":"alliefitter"}}