openai/openai-python

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v1.13.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

pyproject.toml

181lines · modecode

1[project]
2name = "openai"
3version = "1.13.0"
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.7, <5",
14 "anyio>=3.5.0, <5",
15 "distro>=1.7.0, <2",
16 "sniffio",
17 "cached-property; python_version < '3.8'",
18 "tqdm > 4"
19]
20requires-python = ">= 3.7.1"
21classifiers = [
22 "Typing :: Typed",
23 "Intended Audience :: Developers",
24 "Programming Language :: Python :: 3.7",
25 "Programming Language :: Python :: 3.8",
26 "Programming Language :: Python :: 3.9",
27 "Programming Language :: Python :: 3.10",
28 "Programming Language :: Python :: 3.11",
29 "Programming Language :: Python :: 3.12",
30 "Operating System :: OS Independent",
31 "Operating System :: POSIX",
32 "Operating System :: MacOS",
33 "Operating System :: POSIX :: Linux",
34 "Operating System :: Microsoft :: Windows",
35 "Topic :: Software Development :: Libraries :: Python Modules",
36 "License :: OSI Approved :: Apache Software License"
37]
38
39[project.optional-dependencies]
40datalib = ["numpy >= 1", "pandas >= 1.2.3", "pandas-stubs >= 1.1.0.11"]
41
42[project.urls]
43Homepage = "https://github.com/openai/openai-python"
44Repository = "https://github.com/openai/openai-python"
45
46[project.scripts]
47openai = "openai.cli:main"
48
49[tool.rye]
50managed = true
51# version pins are in requirements-dev.lock
52dev-dependencies = [
53 "pyright",
54 "mypy",
55 "respx",
56 "pytest",
57 "pytest-asyncio",
58 "ruff",
59 "time-machine",
60 "nox",
61 "dirty-equals>=0.6.0",
62 "importlib-metadata>=6.7.0",
63 "azure-identity >=1.14.1",
64 "types-tqdm > 4"
65]
66
67[tool.rye.scripts]
68format = { chain = [
69 "format:ruff",
70 "format:docs",
71 "fix:ruff",
72]}
73"format:black" = "black ."
74"format:docs" = "python bin/ruffen-docs.py README.md api.md"
75"format:ruff" = "ruff format"
76"format:isort" = "isort ."
77
78"lint" = { chain = [
79 "check:ruff",
80 "typecheck",
81]}
82"check:ruff" = "ruff ."
83"fix:ruff" = "ruff --fix ."
84
85typecheck = { chain = [
86 "typecheck:pyright",
87 "typecheck:mypy"
88]}
89"typecheck:pyright" = "pyright"
90"typecheck:verify-types" = "pyright --verifytypes openai --ignoreexternal"
91"typecheck:mypy" = "mypy ."
92
93[build-system]
94requires = ["hatchling"]
95build-backend = "hatchling.build"
96
97[tool.hatch.build]
98include = [
99 "src/*"
100]
101
102[tool.hatch.build.targets.wheel]
103packages = ["src/openai"]
104
105[tool.black]
106line-length = 120
107target-version = ["py37"]
108
109[tool.pytest.ini_options]
110testpaths = ["tests"]
111addopts = "--tb=short"
112xfail_strict = true
113asyncio_mode = "auto"
114filterwarnings = [
115 "error"
116]
117
118[tool.pyright]
119# this enables practically every flag given by pyright.
120# there are a couple of flags that are still disabled by
121# default in strict mode as they are experimental and niche.
122typeCheckingMode = "strict"
123pythonVersion = "3.7"
124
125exclude = [
126 "_dev",
127 ".venv",
128 ".nox",
129]
130
131reportImplicitOverride = true
132
133reportImportCycles = false
134reportPrivateUsage = false
135
136[tool.ruff]
137line-length = 120
138output-format = "grouped"
139target-version = "py37"
140select = [
141 # isort
142 "I",
143 # bugbear rules
144 "B",
145 # remove unused imports
146 "F401",
147 # bare except statements
148 "E722",
149 # unused arguments
150 "ARG",
151 # print statements
152 "T201",
153 "T203",
154 # misuse of typing.TYPE_CHECKING
155 "TCH004"
156]
157ignore = [
158 # mutable defaults
159 "B006",
160]
161unfixable = [
162 # disable auto fix for print statements
163 "T201",
164 "T203",
165]
166ignore-init-module-imports = true
167
168[tool.ruff.format]
169docstring-code-format = true
170
171[tool.ruff.lint.isort]
172length-sort = true
173length-sort-straight = true
174combine-as-imports = true
175extra-standard-library = ["typing_extensions"]
176known-first-party = ["openai", "tests"]
177
178[tool.ruff.per-file-ignores]
179"bin/**.py" = ["T201", "T203"]
180"tests/**.py" = ["T201", "T203"]
181"examples/**.py" = ["T201", "T203"]
182