From d158d1bba70a9a4fd237ac81deb7bf3dee810099 Mon Sep 17 00:00:00 2001 From: finswimmer Date: Mon, 28 Feb 2022 20:57:37 +0100 Subject: [PATCH] remove `__future__` import from src/poetry/__init__.py --- .pre-commit-config.yaml | 6 +++++- src/poetry/__init__.py | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5b40f3f7c64..0152ce96069 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -59,7 +59,11 @@ repos: name: "isort (python)" types: [python] args: [--add-import, from __future__ import annotations] - exclude: ^(install|get)-poetry.py$ + exclude: | + (?x)( + ^(install|get)-poetry.py$ + | ^src/poetry/__init__.py$ + ) - id: isort name: "isort (pyi)" types: [pyi] diff --git a/src/poetry/__init__.py b/src/poetry/__init__.py index 9e041d50b7d..f93b2c26260 100644 --- a/src/poetry/__init__.py +++ b/src/poetry/__init__.py @@ -1,4 +1,5 @@ -from __future__ import annotations - - __path__ = __import__("pkgutil").extend_path(__path__, __name__) + +# When editing this file make sure line 1 keeps unchanged. +# Setting __path__ must take place in the first line. No line breaks are allowed either. +# Otherwise, IDEs like PyCharm are unable to follow imports to poetry.core.