Skip to content

Do not require typing_extensions with Python 3.8+ #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion openai/api_requestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
from urllib.parse import urlencode, urlsplit, urlunsplit

import requests
from typing_extensions import Literal

# Literal is available from Python 3.8
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal

import openai
from openai import error, util, version
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"pandas-stubs>=1.1.0.11", # Needed for type hints for mypy
"openpyxl>=3.0.7", # Needed for CLI fine-tuning data preparation tool xlsx format
"numpy",
"typing_extensions", # Needed for type hints for mypy
'typing_extensions;python_version<"3.8"', # Needed for type hints for mypy
],
extras_require={
"dev": ["black~=21.6b0", "pytest==6.*"],
Expand Down