openai/openai-python

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v1.25.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

pyproject.toml

202lines · modeblame

08b8179aDavid Schnurr2 years ago1[project]
2name = "openai"
ec52e89cStainless Bot2 years ago3version = "1.25.0"
b185cb31Stainless Bot2 years ago4description = "The official Python library for the openai API"
31a7e9adStainless Bot2 years ago5dynamic = ["readme"]
08b8179aDavid Schnurr2 years ago6license = "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",
a893a19fStainless Bot2 years ago13"typing-extensions>=4.7, <5",
31573844Stainless Bot2 years ago14"anyio>=3.5.0, <5",
08b8179aDavid Schnurr2 years ago15"distro>=1.7.0, <2",
dad2b56dStainless Bot2 years ago16"sniffio",
4aa7cbeeStainless Bot2 years ago17"cached-property; python_version < '3.8'",
08b8179aDavid Schnurr2 years ago18"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",
58eed2b4Stainless Bot2 years ago36"License :: OSI Approved :: Apache Software License"
08b8179aDavid Schnurr2 years ago37]
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
e967f5a5Stainless Bot2 years ago51# version pins are in requirements-dev.lock
08b8179aDavid Schnurr2 years ago52dev-dependencies = [
7a7e4bccStainless Bot2 years ago53"pyright>=1.1.359",
e967f5a5Stainless Bot2 years ago54"mypy",
55"respx",
56"pytest",
57"pytest-asyncio",
58"ruff",
59"time-machine",
60"nox",
08b8179aDavid Schnurr2 years ago61"dirty-equals>=0.6.0",
d58c2ef8Stainless Bot2 years ago62"importlib-metadata>=6.7.0",
5429f696Stainless Bot2 years ago63"inline-snapshot >=0.7.0",
08b8179aDavid Schnurr2 years ago64"azure-identity >=1.14.1",
9375d2ccStainless Bot2 years ago65"types-tqdm > 4",
5b20698dStainless Bot2 years ago66"types-pyaudio > 0",
67"trio >=0.22.2"
08b8179aDavid Schnurr2 years ago68]
69
70[tool.rye.scripts]
71format = { chain = [
72"format:ruff",
e1b60b22Stainless Bot2 years ago73"format:docs",
74"fix:ruff",
08b8179aDavid Schnurr2 years ago75]}
76"format:black" = "black ."
d2738d42Stainless Bot2 years ago77"format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md"
e1b60b22Stainless Bot2 years ago78"format:ruff" = "ruff format"
8ad790aeStainless Bot2 years ago79"format:isort" = "isort ."
08b8179aDavid Schnurr2 years ago80
0f093469Stainless Bot2 years ago81"lint" = { chain = [
82"check:ruff",
83"typecheck",
84]}
08b8179aDavid Schnurr2 years ago85"check:ruff" = "ruff ."
e1b60b22Stainless Bot2 years ago86"fix:ruff" = "ruff --fix ."
08b8179aDavid Schnurr2 years ago87
88typecheck = { chain = [
89"typecheck:pyright",
90"typecheck:mypy"
91]}
92"typecheck:pyright" = "pyright"
93"typecheck:verify-types" = "pyright --verifytypes openai --ignoreexternal"
a7ebc260Stainless Bot2 years ago94"typecheck:mypy" = "mypy ."
08b8179aDavid Schnurr2 years ago95
ca2fbacfDamien Deville3 years ago96[build-system]
31a7e9adStainless Bot2 years ago97requires = ["hatchling", "hatch-fancy-pypi-readme"]
08b8179aDavid Schnurr2 years ago98build-backend = "hatchling.build"
99
100[tool.hatch.build]
101include = [
102"src/*"
103]
104
105[tool.hatch.build.targets.wheel]
106packages = ["src/openai"]
86dff298Jon Bringhurst3 years ago107
31a7e9adStainless Bot2 years ago108[tool.hatch.metadata.hooks.fancy-pypi-readme]
109content-type = "text/markdown"
110
111[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
112path = "README.md"
113
114[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
115# replace relative links with absolute links
116pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
117replacement = '[\1](https://github.com/openai/openai-python/tree/main/\g<2>)'
118
db4750c1Henrique Oliveira Pinto4 years ago119[tool.black]
08b8179aDavid Schnurr2 years ago120line-length = 120
121target-version = ["py37"]
122
123[tool.pytest.ini_options]
124testpaths = ["tests"]
125addopts = "--tb=short"
126xfail_strict = true
127asyncio_mode = "auto"
128filterwarnings = [
129"error"
130]
131
132[tool.pyright]
133# this enables practically every flag given by pyright.
134# there are a couple of flags that are still disabled by
135# default in strict mode as they are experimental and niche.
136typeCheckingMode = "strict"
137pythonVersion = "3.7"
138
139exclude = [
140"_dev",
141".venv",
142".nox",
143]
144
145reportImplicitOverride = true
146
147reportImportCycles = false
148reportPrivateUsage = false
db4750c1Henrique Oliveira Pinto4 years ago149
bf09f427Stainless Bot2 years ago150
08b8179aDavid Schnurr2 years ago151[tool.ruff]
152line-length = 120
e967f5a5Stainless Bot2 years ago153output-format = "grouped"
08b8179aDavid Schnurr2 years ago154target-version = "py37"
155select = [
a47375b7Stainless Bot2 years ago156# isort
157"I",
e967f5a5Stainless Bot2 years ago158# bugbear rules
159"B",
08b8179aDavid Schnurr2 years ago160# remove unused imports
161"F401",
162# bare except statements
163"E722",
164# unused arguments
165"ARG",
166# print statements
167"T201",
168"T203",
63de8ef4Stainless Bot2 years ago169# misuse of typing.TYPE_CHECKING
674c6eebStainless Bot2 years ago170"TCH004",
171# import rules
172"TID251",
08b8179aDavid Schnurr2 years ago173]
e967f5a5Stainless Bot2 years ago174ignore = [
175# mutable defaults
176"B006",
177]
08b8179aDavid Schnurr2 years ago178unfixable = [
179# disable auto fix for print statements
180"T201",
181"T203",
182]
183ignore-init-module-imports = true
184
e1b60b22Stainless Bot2 years ago185[tool.ruff.format]
186docstring-code-format = true
08b8179aDavid Schnurr2 years ago187
674c6eebStainless Bot2 years ago188[tool.ruff.lint.flake8-tidy-imports.banned-api]
189"functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead"
190
a47375b7Stainless Bot2 years ago191[tool.ruff.lint.isort]
192length-sort = true
193length-sort-straight = true
194combine-as-imports = true
195extra-standard-library = ["typing_extensions"]
196known-first-party = ["openai", "tests"]
197
08b8179aDavid Schnurr2 years ago198[tool.ruff.per-file-ignores]
199"bin/**.py" = ["T201", "T203"]
d2738d42Stainless Bot2 years ago200"scripts/**.py" = ["T201", "T203"]
08b8179aDavid Schnurr2 years ago201"tests/**.py" = ["T201", "T203"]
202"examples/**.py" = ["T201", "T203"]