openai/openai-python

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
15488ce07cb97535d8564e82dd5cda3481bc1a81

Branches

Tags

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

Clone

HTTPS

Download ZIP

pyproject.toml

175lines · modecode

1[project]
2name = "openai"
3version = "1.9.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"check:ruff" = "ruff ."
79"fix:ruff" = "ruff --fix ."
80
81typecheck = { chain = [
82 "typecheck:pyright",
83 "typecheck:mypy"
84]}
85"typecheck:pyright" = "pyright"
86"typecheck:verify-types" = "pyright --verifytypes openai --ignoreexternal"
87"typecheck:mypy" = "mypy ."
88
89[build-system]
90requires = ["hatchling"]
91build-backend = "hatchling.build"
92
93[tool.hatch.build]
94include = [
95 "src/*"
96]
97
98[tool.hatch.build.targets.wheel]
99packages = ["src/openai"]
100
101[tool.black]
102line-length = 120
103target-version = ["py37"]
104
105[tool.pytest.ini_options]
106testpaths = ["tests"]
107addopts = "--tb=short"
108xfail_strict = true
109asyncio_mode = "auto"
110filterwarnings = [
111 "error"
112]
113
114[tool.pyright]
115# this enables practically every flag given by pyright.
116# there are a couple of flags that are still disabled by
117# default in strict mode as they are experimental and niche.
118typeCheckingMode = "strict"
119pythonVersion = "3.7"
120
121exclude = [
122 "_dev",
123 ".venv",
124 ".nox",
125]
126
127reportImplicitOverride = true
128
129reportImportCycles = false
130reportPrivateUsage = false
131
132[tool.ruff]
133line-length = 120
134output-format = "grouped"
135target-version = "py37"
136select = [
137 # isort
138 "I",
139 # bugbear rules
140 "B",
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]
151ignore = [
152 # mutable defaults
153 "B006",
154]
155unfixable = [
156 # disable auto fix for print statements
157 "T201",
158 "T203",
159]
160ignore-init-module-imports = true
161
162[tool.ruff.format]
163docstring-code-format = true
164
165[tool.ruff.lint.isort]
166length-sort = true
167length-sort-straight = true
168combine-as-imports = true
169extra-standard-library = ["typing_extensions"]
170known-first-party = ["openai", "tests"]
171
172[tool.ruff.per-file-ignores]
173"bin/**.py" = ["T201", "T203"]
174"tests/**.py" = ["T201", "T203"]
175"examples/**.py" = ["T201", "T203"]
176