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 · modeblame

08b8179aDavid Schnurr2 years ago1[project]
2name = "openai"
8ee5f33estainless-app[bot]2 years ago3version = "1.13.0"
b185cb31Stainless Bot2 years ago4description = "The official Python library for the openai API"
08b8179aDavid Schnurr2 years ago5readme = "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",
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 = [
e967f5a5Stainless Bot2 years ago53"pyright",
54"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",
08b8179aDavid Schnurr2 years ago63"azure-identity >=1.14.1",
64"types-tqdm > 4"
65]
66
67[tool.rye.scripts]
68format = { chain = [
69"format:ruff",
e1b60b22Stainless Bot2 years ago70"format:docs",
71"fix:ruff",
08b8179aDavid Schnurr2 years ago72]}
73"format:black" = "black ."
e1b60b22Stainless Bot2 years ago74"format:docs" = "python bin/ruffen-docs.py README.md api.md"
75"format:ruff" = "ruff format"
8ad790aeStainless Bot2 years ago76"format:isort" = "isort ."
08b8179aDavid Schnurr2 years ago77
0f093469Stainless Bot2 years ago78"lint" = { chain = [
79"check:ruff",
80"typecheck",
81]}
08b8179aDavid Schnurr2 years ago82"check:ruff" = "ruff ."
e1b60b22Stainless Bot2 years ago83"fix:ruff" = "ruff --fix ."
08b8179aDavid Schnurr2 years ago84
85typecheck = { chain = [
86"typecheck:pyright",
87"typecheck:mypy"
88]}
89"typecheck:pyright" = "pyright"
90"typecheck:verify-types" = "pyright --verifytypes openai --ignoreexternal"
a7ebc260Stainless Bot2 years ago91"typecheck:mypy" = "mypy ."
08b8179aDavid Schnurr2 years ago92
ca2fbacfDamien Deville3 years ago93[build-system]
08b8179aDavid Schnurr2 years ago94requires = ["hatchling"]
95build-backend = "hatchling.build"
96
97[tool.hatch.build]
98include = [
99"src/*"
100]
101
102[tool.hatch.build.targets.wheel]
103packages = ["src/openai"]
86dff298Jon Bringhurst3 years ago104
db4750c1Henrique Oliveira Pinto4 years ago105[tool.black]
08b8179aDavid Schnurr2 years ago106line-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
db4750c1Henrique Oliveira Pinto4 years ago135
08b8179aDavid Schnurr2 years ago136[tool.ruff]
137line-length = 120
e967f5a5Stainless Bot2 years ago138output-format = "grouped"
08b8179aDavid Schnurr2 years ago139target-version = "py37"
140select = [
a47375b7Stainless Bot2 years ago141# isort
142"I",
e967f5a5Stainless Bot2 years ago143# bugbear rules
144"B",
08b8179aDavid Schnurr2 years ago145# remove unused imports
146"F401",
147# bare except statements
148"E722",
149# unused arguments
150"ARG",
151# print statements
152"T201",
153"T203",
63de8ef4Stainless Bot2 years ago154# misuse of typing.TYPE_CHECKING
155"TCH004"
08b8179aDavid Schnurr2 years ago156]
e967f5a5Stainless Bot2 years ago157ignore = [
158# mutable defaults
159"B006",
160]
08b8179aDavid Schnurr2 years ago161unfixable = [
162# disable auto fix for print statements
163"T201",
164"T203",
165]
166ignore-init-module-imports = true
167
e1b60b22Stainless Bot2 years ago168[tool.ruff.format]
169docstring-code-format = true
08b8179aDavid Schnurr2 years ago170
a47375b7Stainless Bot2 years ago171[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
08b8179aDavid Schnurr2 years ago178[tool.ruff.per-file-ignores]
179"bin/**.py" = ["T201", "T203"]
180"tests/**.py" = ["T201", "T203"]
181"examples/**.py" = ["T201", "T203"]