{"action":"created","issue":{"url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/4721","repository_url":"https://api.github.com/repos/sphinx-doc/sphinx","labels_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/4721/labels{/name}","comments_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/4721/comments","events_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/4721/events","html_url":"https://github.com/sphinx-doc/sphinx/pull/4721","id":303283437,"number":4721,"title":"util.requests: Support SPHINX_NO_NETWORK kill-switch","user":{"login":"mgorny","id":110765,"avatar_url":"https://avatars1.githubusercontent.com/u/110765?v=4","gravatar_id":"","url":"https://api.github.com/users/mgorny","html_url":"https://github.com/mgorny","followers_url":"https://api.github.com/users/mgorny/followers","following_url":"https://api.github.com/users/mgorny/following{/other_user}","gists_url":"https://api.github.com/users/mgorny/gists{/gist_id}","starred_url":"https://api.github.com/users/mgorny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgorny/subscriptions","organizations_url":"https://api.github.com/users/mgorny/orgs","repos_url":"https://api.github.com/users/mgorny/repos","events_url":"https://api.github.com/users/mgorny/events{/privacy}","received_events_url":"https://api.github.com/users/mgorny/received_events","type":"User","site_admin":false},"labels":[{"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":7,"created_at":"2018-03-07T22:27:14Z","updated_at":"2018-03-20T15:43:50Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/sphinx-doc/sphinx/pulls/4721","html_url":"https://github.com/sphinx-doc/sphinx/pull/4721","diff_url":"https://github.com/sphinx-doc/sphinx/pull/4721.diff","patch_url":"https://github.com/sphinx-doc/sphinx/pull/4721.patch"},"body":"Subject: Make it possible to disable all network access while building documentation\r\n\r\n### Feature or Bugfix\r\n- Feature\r\n\r\n### Purpose\r\nSupport a global kill-switch to disable network use in all Sphinx\r\nprocesses. When SPHINX_NO_NETWORK is defined to a non-null value\r\nin the environment, all attempts to fetch remote data via Sphinx\r\nutil.requests module will fail via exception.\r\n    \r\nThe main use case is building documentation in environments where\r\nnetwork access is undesired. A lot of modern packages use Intersphinx\r\nand disabling it per-package became really unfeasible. I have originally\r\nconsidered patching Sphinx locally for Gentoo but I've reached\r\nthe conclusion that there might be other users who would benefit\r\nfrom an option to disable network access.\r\n\r\n### Detail\r\nA detailed reasoning for disabling network access is explained\r\nin the Gentoo developer documentation. The particular article pertains\r\nto use of network in tests but it most of the arguments apply also\r\nto building documentation and other build-related activities:\r\nhttps://devmanual.gentoo.org/ebuild-writing/functions/src_test/index.html#tests-that-require-network-or-service-access\r\n\r\n\r\n### Relates\r\n- https://bugs.gentoo.org/634790\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/comments/374646498","html_url":"https://github.com/sphinx-doc/sphinx/pull/4721#issuecomment-374646498","issue_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/4721","id":374646498,"user":{"login":"tk0miya","id":748828,"avatar_url":"https://avatars2.githubusercontent.com/u/748828?v=4","gravatar_id":"","url":"https://api.github.com/users/tk0miya","html_url":"https://github.com/tk0miya","followers_url":"https://api.github.com/users/tk0miya/followers","following_url":"https://api.github.com/users/tk0miya/following{/other_user}","gists_url":"https://api.github.com/users/tk0miya/gists{/gist_id}","starred_url":"https://api.github.com/users/tk0miya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tk0miya/subscriptions","organizations_url":"https://api.github.com/users/tk0miya/orgs","repos_url":"https://api.github.com/users/tk0miya/repos","events_url":"https://api.github.com/users/tk0miya/events{/privacy}","received_events_url":"https://api.github.com/users/tk0miya/received_events","type":"User","site_admin":false},"created_at":"2018-03-20T15:43:50Z","updated_at":"2018-03-20T15:43:50Z","author_association":"OWNER","body":"I have to say this does not prevent all of network accesses. This only stops communications from sphinx-core. It can't stop the communications from 3rd party extensions, user code (`conf.py`), sub processes and so on.\r\n\r\nFor example, third party extensions and user configuration file (`conf.py`) can use network if they are not using `sphinx.util.requests` module. The module is introduced only for sphinx-core. So extensions and users might not use this.\r\n\r\nIn another case, `sphinx.ext.graphviz` invokes `dot` command internally as a subprocess. If the graph contains remote images. `dot` command will fetch them to build a graph. \r\n\r\n\r\nIf you really want to drop all of network access, you have to monkey-patch to `socket` module of python."}}
{"actor":{"display_login":"tk0miya"}}