Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Commit

Permalink
fix: auto-install typing-extensions on all python versions (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Jan 6, 2024
1 parent 5d20831 commit 91f110e
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions rplugin/python3/gkeep/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,18 @@ def __getattr__(self, key: str) -> Any:
try:
import gkeepapi
import keyring

if sys.version_info < (3, 8):
import typing_extensions
import typing_extensions
except ImportError:
# gpsoauth doesn't work with urllib3 2.0
modules = ["urllib3<2.0", "gkeepapi", "keyring"]
if sys.version_info < (3, 8):
modules.append("typing-extensions")
modules = ["urllib3<2.0", "gkeepapi", "keyring", "typing-extensions"]
subprocess.call([sys.executable, "-m", "pip", "install", "-q"] + modules)
try:
import gkeepapi
import keyring

if sys.version_info < (3, 8):
import typing_extensions
import typing_extensions
except ImportError as e:
raise ImportError(
"Could not auto-install gkeepapi and keyring. Please `pip install gkeepapi keyring` in your neovim python environment"
"Could not auto-install gkeepapi, keyring, and typing_extensions. Please `pip install gkeepapi keyring typing_extensions` in your neovim python environment"
) from e

from gkeep.plugin import GkeepPlugin
Expand Down

0 comments on commit 91f110e

Please sign in to comment.