openai-python
/
pyproject.toml
182 строки · 3.8 Кб
1[project]
2name = "openai"
3version = "1.13.3"
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"types-pyaudio > 0"
66]
67
68[tool.rye.scripts]
69format = { chain = [
70"format:ruff",
71"format:docs",
72"fix:ruff",
73]}
74"format:black" = "black ."
75"format:docs" = "python bin/ruffen-docs.py README.md api.md"
76"format:ruff" = "ruff format"
77"format:isort" = "isort ."
78
79"lint" = { chain = [
80"check:ruff",
81"typecheck",
82]}
83"check:ruff" = "ruff ."
84"fix:ruff" = "ruff --fix ."
85
86typecheck = { chain = [
87"typecheck:pyright",
88"typecheck:mypy"
89]}
90"typecheck:pyright" = "pyright"
91"typecheck:verify-types" = "pyright --verifytypes openai --ignoreexternal"
92"typecheck:mypy" = "mypy ."
93
94[build-system]
95requires = ["hatchling"]
96build-backend = "hatchling.build"
97
98[tool.hatch.build]
99include = [
100"src/*"
101]
102
103[tool.hatch.build.targets.wheel]
104packages = ["src/openai"]
105
106[tool.black]
107line-length = 120
108target-version = ["py37"]
109
110[tool.pytest.ini_options]
111testpaths = ["tests"]
112addopts = "--tb=short"
113xfail_strict = true
114asyncio_mode = "auto"
115filterwarnings = [
116"error"
117]
118
119[tool.pyright]
120# this enables practically every flag given by pyright.
121# there are a couple of flags that are still disabled by
122# default in strict mode as they are experimental and niche.
123typeCheckingMode = "strict"
124pythonVersion = "3.7"
125
126exclude = [
127"_dev",
128".venv",
129".nox",
130]
131
132reportImplicitOverride = true
133
134reportImportCycles = false
135reportPrivateUsage = false
136
137[tool.ruff]
138line-length = 120
139output-format = "grouped"
140target-version = "py37"
141select = [
142# isort
143"I",
144# bugbear rules
145"B",
146# remove unused imports
147"F401",
148# bare except statements
149"E722",
150# unused arguments
151"ARG",
152# print statements
153"T201",
154"T203",
155# misuse of typing.TYPE_CHECKING
156"TCH004"
157]
158ignore = [
159# mutable defaults
160"B006",
161]
162unfixable = [
163# disable auto fix for print statements
164"T201",
165"T203",
166]
167ignore-init-module-imports = true
168
169[tool.ruff.format]
170docstring-code-format = true
171
172[tool.ruff.lint.isort]
173length-sort = true
174length-sort-straight = true
175combine-as-imports = true
176extra-standard-library = ["typing_extensions"]
177known-first-party = ["openai", "tests"]
178
179[tool.ruff.per-file-ignores]
180"bin/**.py" = ["T201", "T203"]
181"tests/**.py" = ["T201", "T203"]
182"examples/**.py" = ["T201", "T203"]
183