{"action":"created","issue":{"url":"https://api.github.com/repos/timothycrosley/isort/issues/1005","repository_url":"https://api.github.com/repos/timothycrosley/isort","labels_url":"https://api.github.com/repos/timothycrosley/isort/issues/1005/labels{/name}","comments_url":"https://api.github.com/repos/timothycrosley/isort/issues/1005/comments","events_url":"https://api.github.com/repos/timothycrosley/isort/issues/1005/events","html_url":"https://github.com/timothycrosley/isort/issues/1005","id":486964406,"node_id":"MDU6SXNzdWU0ODY5NjQ0MDY=","number":1005,"title":"isort ordering issues with python-future","user":{"login":"mmphego","id":7910856,"node_id":"MDQ6VXNlcjc5MTA4NTY=","avatar_url":"https://avatars1.githubusercontent.com/u/7910856?v=4","gravatar_id":"","url":"https://api.github.com/users/mmphego","html_url":"https://github.com/mmphego","followers_url":"https://api.github.com/users/mmphego/followers","following_url":"https://api.github.com/users/mmphego/following{/other_user}","gists_url":"https://api.github.com/users/mmphego/gists{/gist_id}","starred_url":"https://api.github.com/users/mmphego/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmphego/subscriptions","organizations_url":"https://api.github.com/users/mmphego/orgs","repos_url":"https://api.github.com/users/mmphego/repos","events_url":"https://api.github.com/users/mmphego/events{/privacy}","received_events_url":"https://api.github.com/users/mmphego/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-08-29T13:38:14Z","updated_at":"2019-09-06T22:55:32Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nWe are currently doing the `Python2to3` migration using `futurize` which adds the [future.standard_library](https://python-future.org/reference.html?highlight=standard_library#module-future.standard_library). According to the docs the `standard_library` should be added after `__future__` but before any other imports. \r\n\r\nBelow you will find current `isort` configuration and source code snippets **before and after** isort.\r\n\r\nWhat I want is to have `future` import and `standard_library` below `__future__`, but `isort` doesn't like that as `future` is a 3rd party package.\r\n\r\n\r\n## What I have before running isort\r\n```python\r\nfrom __future__ import absolute_import\r\n\r\nfrom future import standard_library\r\n\r\nstandard_library.install_aliases()  \r\n\r\nimport os\r\nimport re\r\nimport time\r\n\r\nfrom logging.handlers import SysLogHandler\r\n\r\nfrom builtins import len, object, str\r\n\r\nfrom katlogger import log_formatter, log_rollover\r\n\r\nfrom .query_elastic import QueryElastic\r\n\r\n```\r\n\r\n## What I have after running isort\r\n```python\r\nfrom __future__ import absolute_import\r\n\r\n# Python Standard Library\r\nimport os\r\nimport re\r\nimport time\r\n\r\nfrom builtins import len, object, str\r\nfrom logging.handlers import SysLogHandler\r\n\r\n# Third Library\r\nfrom future import standard_library\r\n\r\n# Explicitly Local\r\nfrom .query_elastic import QueryElastic\r\n\r\n# CAM Packages\r\nfrom katlogger import log_formatter, log_rollover\r\n\r\nstandard_library.install_aliases()  # noqa: E402\r\n```\r\n\r\n## What I want after isort\r\n```python\r\nfrom __future__ import absolute_import\r\n\r\nfrom future import standard_library\r\nstandard_library.install_aliases() \r\n\r\n# Python Standard Library\r\nimport os\r\nimport re\r\nimport time\r\n\r\nfrom builtins import len, object, str\r\nfrom logging.handlers import SysLogHandler\r\n\r\n# Explicitly Local\r\nfrom .query_elastic import QueryElastic\r\n\r\n# CAM Packages\r\nfrom katlogger import log_formatter, log_rollover\r\n```\r\n\r\n## Configuration\r\n```toml\r\n[tool.isort]\r\nforce_grid_wrap = 0\r\ninclude_trailing_comma = true\r\nindent = 4\r\nline_length = 90\r\nmulti_line_output = 3\r\n# Having imports glued together is physically painful. ;)\r\nlines_between_types = 1\r\n# Imports sections\r\nsections = ['FUTURE', 'STDLIB', 'THIRDPARTY', 'FIRSTPARTY', 'LOCALFOLDER']\r\n# Imports heading\r\nimport_heading_stdlib = 'Python Standard Library'\r\nimport_heading_thirdparty = 'Third Library'\r\nimport_heading_firstparty = 'CAM Packages'\r\nimport_heading_localfolder = 'Explicitly Local'\r\n\r\n# A list of known imports that will be forced to display within their specified category.\r\nknown_first_party = ['katlogger']\r\n```"},"comment":{"url":"https://api.github.com/repos/timothycrosley/isort/issues/comments/529039878","html_url":"https://github.com/timothycrosley/isort/issues/1005#issuecomment-529039878","issue_url":"https://api.github.com/repos/timothycrosley/isort/issues/1005","id":529039878,"node_id":"MDEyOklzc3VlQ29tbWVudDUyOTAzOTg3OA==","user":{"login":"mmphego","id":7910856,"node_id":"MDQ6VXNlcjc5MTA4NTY=","avatar_url":"https://avatars1.githubusercontent.com/u/7910856?v=4","gravatar_id":"","url":"https://api.github.com/users/mmphego","html_url":"https://github.com/mmphego","followers_url":"https://api.github.com/users/mmphego/followers","following_url":"https://api.github.com/users/mmphego/following{/other_user}","gists_url":"https://api.github.com/users/mmphego/gists{/gist_id}","starred_url":"https://api.github.com/users/mmphego/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmphego/subscriptions","organizations_url":"https://api.github.com/users/mmphego/orgs","repos_url":"https://api.github.com/users/mmphego/repos","events_url":"https://api.github.com/users/mmphego/events{/privacy}","received_events_url":"https://api.github.com/users/mmphego/received_events","type":"User","site_admin":false},"created_at":"2019-09-06T22:55:32Z","updated_at":"2019-09-06T22:55:32Z","author_association":"NONE","body":"> I tried `known_future_library=future` but that didn't work.\r\n\r\nI tried defining a new section, that also didn't work."}}
{"actor":{"display_login":"mmphego"}}