openai/openai-python
Publicmirrored from https://github.com/openai/openai-pythonAvailable
pyproject.toml
202lines · modeblame
08b8179aDavid Schnurr2 years ago | 1 | [project] |
| 2 | name = "openai" | |
ec52e89cStainless Bot2 years ago | 3 | version = "1.25.0" |
b185cb31Stainless Bot2 years ago | 4 | description = "The official Python library for the openai API" |
31a7e9adStainless Bot2 years ago | 5 | dynamic = ["readme"] |
08b8179aDavid Schnurr2 years ago | 6 | license = "Apache-2.0" |
| 7 | authors = [ | |
| 8 | { name = "OpenAI", email = "support@openai.com" }, | |
| 9 | ] | |
| 10 | dependencies = [ | |
| 11 | "httpx>=0.23.0, <1", | |
| 12 | "pydantic>=1.9.0, <3", | |
a893a19fStainless Bot2 years ago | 13 | "typing-extensions>=4.7, <5", |
31573844Stainless Bot2 years ago | 14 | "anyio>=3.5.0, <5", |
08b8179aDavid Schnurr2 years ago | 15 | "distro>=1.7.0, <2", |
dad2b56dStainless Bot2 years ago | 16 | "sniffio", |
4aa7cbeeStainless Bot2 years ago | 17 | "cached-property; python_version < '3.8'", |
08b8179aDavid Schnurr2 years ago | 18 | "tqdm > 4" |
| 19 | ] | |
| 20 | requires-python = ">= 3.7.1" | |
| 21 | classifiers = [ | |
| 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 ago | 36 | "License :: OSI Approved :: Apache Software License" |
08b8179aDavid Schnurr2 years ago | 37 | ] |
| 38 | | |
| 39 | [project.optional-dependencies] | |
| 40 | datalib = ["numpy >= 1", "pandas >= 1.2.3", "pandas-stubs >= 1.1.0.11"] | |
| 41 | | |
| 42 | [project.urls] | |
| 43 | Homepage = "https://github.com/openai/openai-python" | |
| 44 | Repository = "https://github.com/openai/openai-python" | |
| 45 | | |
| 46 | [project.scripts] | |
| 47 | openai = "openai.cli:main" | |
| 48 | | |
| 49 | [tool.rye] | |
| 50 | managed = true | |
e967f5a5Stainless Bot2 years ago | 51 | # version pins are in requirements-dev.lock |
08b8179aDavid Schnurr2 years ago | 52 | dev-dependencies = [ |
7a7e4bccStainless Bot2 years ago | 53 | "pyright>=1.1.359", |
e967f5a5Stainless Bot2 years ago | 54 | "mypy", |
| 55 | "respx", | |
| 56 | "pytest", | |
| 57 | "pytest-asyncio", | |
| 58 | "ruff", | |
| 59 | "time-machine", | |
| 60 | "nox", | |
08b8179aDavid Schnurr2 years ago | 61 | "dirty-equals>=0.6.0", |
d58c2ef8Stainless Bot2 years ago | 62 | "importlib-metadata>=6.7.0", |
5429f696Stainless Bot2 years ago | 63 | "inline-snapshot >=0.7.0", |
08b8179aDavid Schnurr2 years ago | 64 | "azure-identity >=1.14.1", |
9375d2ccStainless Bot2 years ago | 65 | "types-tqdm > 4", |
5b20698dStainless Bot2 years ago | 66 | "types-pyaudio > 0", |
| 67 | "trio >=0.22.2" | |
08b8179aDavid Schnurr2 years ago | 68 | ] |
| 69 | | |
| 70 | [tool.rye.scripts] | |
| 71 | format = { chain = [ | |
| 72 | "format:ruff", | |
e1b60b22Stainless Bot2 years ago | 73 | "format:docs", |
| 74 | "fix:ruff", | |
08b8179aDavid Schnurr2 years ago | 75 | ]} |
| 76 | "format:black" = "black ." | |
d2738d42Stainless Bot2 years ago | 77 | "format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md" |
e1b60b22Stainless Bot2 years ago | 78 | "format:ruff" = "ruff format" |
8ad790aeStainless Bot2 years ago | 79 | "format:isort" = "isort ." |
08b8179aDavid Schnurr2 years ago | 80 | |
0f093469Stainless Bot2 years ago | 81 | "lint" = { chain = [ |
| 82 | "check:ruff", | |
| 83 | "typecheck", | |
| 84 | ]} | |
08b8179aDavid Schnurr2 years ago | 85 | "check:ruff" = "ruff ." |
e1b60b22Stainless Bot2 years ago | 86 | "fix:ruff" = "ruff --fix ." |
08b8179aDavid Schnurr2 years ago | 87 | |
| 88 | typecheck = { chain = [ | |
| 89 | "typecheck:pyright", | |
| 90 | "typecheck:mypy" | |
| 91 | ]} | |
| 92 | "typecheck:pyright" = "pyright" | |
| 93 | "typecheck:verify-types" = "pyright --verifytypes openai --ignoreexternal" | |
a7ebc260Stainless Bot2 years ago | 94 | "typecheck:mypy" = "mypy ." |
08b8179aDavid Schnurr2 years ago | 95 | |
ca2fbacfDamien Deville3 years ago | 96 | [build-system] |
31a7e9adStainless Bot2 years ago | 97 | requires = ["hatchling", "hatch-fancy-pypi-readme"] |
08b8179aDavid Schnurr2 years ago | 98 | build-backend = "hatchling.build" |
| 99 | | |
| 100 | [tool.hatch.build] | |
| 101 | include = [ | |
| 102 | "src/*" | |
| 103 | ] | |
| 104 | | |
| 105 | [tool.hatch.build.targets.wheel] | |
| 106 | packages = ["src/openai"] | |
86dff298Jon Bringhurst3 years ago | 107 | |
31a7e9adStainless Bot2 years ago | 108 | [tool.hatch.metadata.hooks.fancy-pypi-readme] |
| 109 | content-type = "text/markdown" | |
| 110 | | |
| 111 | [[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]] | |
| 112 | path = "README.md" | |
| 113 | | |
| 114 | [[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] | |
| 115 | # replace relative links with absolute links | |
| 116 | pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)' | |
| 117 | replacement = '[\1](https://github.com/openai/openai-python/tree/main/\g<2>)' | |
| 118 | | |
db4750c1Henrique Oliveira Pinto4 years ago | 119 | [tool.black] |
08b8179aDavid Schnurr2 years ago | 120 | line-length = 120 |
| 121 | target-version = ["py37"] | |
| 122 | | |
| 123 | [tool.pytest.ini_options] | |
| 124 | testpaths = ["tests"] | |
| 125 | addopts = "--tb=short" | |
| 126 | xfail_strict = true | |
| 127 | asyncio_mode = "auto" | |
| 128 | filterwarnings = [ | |
| 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. | |
| 136 | typeCheckingMode = "strict" | |
| 137 | pythonVersion = "3.7" | |
| 138 | | |
| 139 | exclude = [ | |
| 140 | "_dev", | |
| 141 | ".venv", | |
| 142 | ".nox", | |
| 143 | ] | |
| 144 | | |
| 145 | reportImplicitOverride = true | |
| 146 | | |
| 147 | reportImportCycles = false | |
| 148 | reportPrivateUsage = false | |
db4750c1Henrique Oliveira Pinto4 years ago | 149 | |
bf09f427Stainless Bot2 years ago | 150 | |
08b8179aDavid Schnurr2 years ago | 151 | [tool.ruff] |
| 152 | line-length = 120 | |
e967f5a5Stainless Bot2 years ago | 153 | output-format = "grouped" |
08b8179aDavid Schnurr2 years ago | 154 | target-version = "py37" |
| 155 | select = [ | |
a47375b7Stainless Bot2 years ago | 156 | # isort |
| 157 | "I", | |
e967f5a5Stainless Bot2 years ago | 158 | # bugbear rules |
| 159 | "B", | |
08b8179aDavid Schnurr2 years ago | 160 | # 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 ago | 169 | # misuse of typing.TYPE_CHECKING |
674c6eebStainless Bot2 years ago | 170 | "TCH004", |
| 171 | # import rules | |
| 172 | "TID251", | |
08b8179aDavid Schnurr2 years ago | 173 | ] |
e967f5a5Stainless Bot2 years ago | 174 | ignore = [ |
| 175 | # mutable defaults | |
| 176 | "B006", | |
| 177 | ] | |
08b8179aDavid Schnurr2 years ago | 178 | unfixable = [ |
| 179 | # disable auto fix for print statements | |
| 180 | "T201", | |
| 181 | "T203", | |
| 182 | ] | |
| 183 | ignore-init-module-imports = true | |
| 184 | | |
e1b60b22Stainless Bot2 years ago | 185 | [tool.ruff.format] |
| 186 | docstring-code-format = true | |
08b8179aDavid Schnurr2 years ago | 187 | |
674c6eebStainless Bot2 years ago | 188 | [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 ago | 191 | [tool.ruff.lint.isort] |
| 192 | length-sort = true | |
| 193 | length-sort-straight = true | |
| 194 | combine-as-imports = true | |
| 195 | extra-standard-library = ["typing_extensions"] | |
| 196 | known-first-party = ["openai", "tests"] | |
| 197 | | |
08b8179aDavid Schnurr2 years ago | 198 | [tool.ruff.per-file-ignores] |
| 199 | "bin/**.py" = ["T201", "T203"] | |
d2738d42Stainless Bot2 years ago | 200 | "scripts/**.py" = ["T201", "T203"] |
08b8179aDavid Schnurr2 years ago | 201 | "tests/**.py" = ["T201", "T203"] |
| 202 | "examples/**.py" = ["T201", "T203"] |