openai/openai-python

Public

mirrored from https://github.com/openai/openai-pythonAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
84c85bdffde6bdfe8fd152ba5eec371e9260d0a8

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

pyproject.toml

162lines · modecode

1[project]
2name = "openai"
3version = "1.3.6"
4description = "The official Python library for the openai API"
5readme = "README.md"
6license = "Apache-2.0"
7authors = [
8{ name = "OpenAI", email = "support@openai.com" },
9]
10dependencies = [
11 "httpx>=0.23.0, <1",
12 "pydantic>=1.9.0, <3",
13 "typing-extensions>=4.5, <5",
14 "anyio>=3.5.0, <4",
15 "distro>=1.7.0, <2",
16 "sniffio",
17 "tqdm > 4"
18]
19requires-python = ">= 3.7.1"
20classifiers = [
21 "Typing :: Typed",
22 "Intended Audience :: Developers",
23 "Programming Language :: Python :: 3.7",
24 "Programming Language :: Python :: 3.8",
25 "Programming Language :: Python :: 3.9",
26 "Programming Language :: Python :: 3.10",
27 "Programming Language :: Python :: 3.11",
28 "Programming Language :: Python :: 3.12",
29 "Operating System :: OS Independent",
30 "Operating System :: POSIX",
31 "Operating System :: MacOS",
32 "Operating System :: POSIX :: Linux",
33 "Operating System :: Microsoft :: Windows",
34 "Topic :: Software Development :: Libraries :: Python Modules",
35 "License :: OSI Approved :: Apache Software License"
36]
37
38[project.optional-dependencies]
39datalib = ["numpy >= 1", "pandas >= 1.2.3", "pandas-stubs >= 1.1.0.11"]
40
41[project.urls]
42Homepage = "https://github.com/openai/openai-python"
43Repository = "https://github.com/openai/openai-python"
44
45[project.scripts]
46openai = "openai.cli:main"
47
48[tool.rye]
49managed = true
50dev-dependencies = [
51 "pyright==1.1.332",
52 "mypy==1.7.1",
53 "black==23.3.0",
54 "respx==0.19.2",
55 "pytest==7.1.1",
56 "pytest-asyncio==0.21.1",
57 "ruff==0.0.282",
58 "isort==5.10.1",
59 "time-machine==2.9.0",
60 "nox==2023.4.22",
61 "dirty-equals>=0.6.0",
62 "azure-identity >=1.14.1",
63 "types-tqdm > 4"
64]
65
66[tool.rye.scripts]
67format = { chain = [
68 "format:black",
69 "format:docs",
70 "format:ruff",
71 "format:isort",
72]}
73"format:black" = "black ."
74"format:docs" = "python bin/blacken-docs.py README.md api.md"
75"format:ruff" = "ruff --fix ."
76"format:isort" = "isort ."
77
78"check:ruff" = "ruff ."
79
80typecheck = { chain = [
81 "typecheck:pyright",
82 "typecheck:mypy"
83]}
84"typecheck:pyright" = "pyright"
85"typecheck:verify-types" = "pyright --verifytypes openai --ignoreexternal"
86"typecheck:mypy" = "mypy --enable-incomplete-feature=Unpack ."
87
88[build-system]
89requires = ["hatchling"]
90build-backend = "hatchling.build"
91
92[tool.hatch.build]
93include = [
94 "src/*"
95]
96
97[tool.hatch.build.targets.wheel]
98packages = ["src/openai"]
99
100[tool.black]
101line-length = 120
102target-version = ["py37"]
103
104[tool.pytest.ini_options]
105testpaths = ["tests"]
106addopts = "--tb=short"
107xfail_strict = true
108asyncio_mode = "auto"
109filterwarnings = [
110 "error"
111]
112
113[tool.pyright]
114# this enables practically every flag given by pyright.
115# there are a couple of flags that are still disabled by
116# default in strict mode as they are experimental and niche.
117typeCheckingMode = "strict"
118pythonVersion = "3.7"
119
120exclude = [
121 "_dev",
122 ".venv",
123 ".nox",
124]
125
126reportImplicitOverride = true
127
128reportImportCycles = false
129reportPrivateUsage = false
130
131[tool.isort]
132profile = "black"
133length_sort = true
134extra_standard_library = ["typing_extensions"]
135
136[tool.ruff]
137line-length = 120
138format = "grouped"
139target-version = "py37"
140select = [
141 # remove unused imports
142 "F401",
143 # bare except statements
144 "E722",
145 # unused arguments
146 "ARG",
147 # print statements
148 "T201",
149 "T203",
150]
151unfixable = [
152 # disable auto fix for print statements
153 "T201",
154 "T203",
155]
156ignore-init-module-imports = true
157
158
159[tool.ruff.per-file-ignores]
160"bin/**.py" = ["T201", "T203"]
161"tests/**.py" = ["T201", "T203"]
162"examples/**.py" = ["T201", "T203"]
163