openai/openai-python
Publicmirrored from https://github.com/openai/openai-pythonAvailable
pyproject.toml
181lines · modecode
| 1 | [project] |
| 2 | name = "openai" |
| 3 | version = "1.13.0" |
| 4 | description = "The official Python library for the openai API" |
| 5 | readme = "README.md" |
| 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", |
| 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 | ] |
| 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", |
| 36 | "License :: OSI Approved :: Apache Software License" |
| 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 |
| 51 | # version pins are in requirements-dev.lock |
| 52 | dev-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] |
| 68 | format = { 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 | "lint" = { chain = [ |
| 79 | "check:ruff", |
| 80 | "typecheck", |
| 81 | ]} |
| 82 | "check:ruff" = "ruff ." |
| 83 | "fix:ruff" = "ruff --fix ." |
| 84 | |
| 85 | typecheck = { chain = [ |
| 86 | "typecheck:pyright", |
| 87 | "typecheck:mypy" |
| 88 | ]} |
| 89 | "typecheck:pyright" = "pyright" |
| 90 | "typecheck:verify-types" = "pyright --verifytypes openai --ignoreexternal" |
| 91 | "typecheck:mypy" = "mypy ." |
| 92 | |
| 93 | [build-system] |
| 94 | requires = ["hatchling"] |
| 95 | build-backend = "hatchling.build" |
| 96 | |
| 97 | [tool.hatch.build] |
| 98 | include = [ |
| 99 | "src/*" |
| 100 | ] |
| 101 | |
| 102 | [tool.hatch.build.targets.wheel] |
| 103 | packages = ["src/openai"] |
| 104 | |
| 105 | [tool.black] |
| 106 | line-length = 120 |
| 107 | target-version = ["py37"] |
| 108 | |
| 109 | [tool.pytest.ini_options] |
| 110 | testpaths = ["tests"] |
| 111 | addopts = "--tb=short" |
| 112 | xfail_strict = true |
| 113 | asyncio_mode = "auto" |
| 114 | filterwarnings = [ |
| 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. |
| 122 | typeCheckingMode = "strict" |
| 123 | pythonVersion = "3.7" |
| 124 | |
| 125 | exclude = [ |
| 126 | "_dev", |
| 127 | ".venv", |
| 128 | ".nox", |
| 129 | ] |
| 130 | |
| 131 | reportImplicitOverride = true |
| 132 | |
| 133 | reportImportCycles = false |
| 134 | reportPrivateUsage = false |
| 135 | |
| 136 | [tool.ruff] |
| 137 | line-length = 120 |
| 138 | output-format = "grouped" |
| 139 | target-version = "py37" |
| 140 | select = [ |
| 141 | # isort |
| 142 | "I", |
| 143 | # bugbear rules |
| 144 | "B", |
| 145 | # remove unused imports |
| 146 | "F401", |
| 147 | # bare except statements |
| 148 | "E722", |
| 149 | # unused arguments |
| 150 | "ARG", |
| 151 | # print statements |
| 152 | "T201", |
| 153 | "T203", |
| 154 | # misuse of typing.TYPE_CHECKING |
| 155 | "TCH004" |
| 156 | ] |
| 157 | ignore = [ |
| 158 | # mutable defaults |
| 159 | "B006", |
| 160 | ] |
| 161 | unfixable = [ |
| 162 | # disable auto fix for print statements |
| 163 | "T201", |
| 164 | "T203", |
| 165 | ] |
| 166 | ignore-init-module-imports = true |
| 167 | |
| 168 | [tool.ruff.format] |
| 169 | docstring-code-format = true |
| 170 | |
| 171 | [tool.ruff.lint.isort] |
| 172 | length-sort = true |
| 173 | length-sort-straight = true |
| 174 | combine-as-imports = true |
| 175 | extra-standard-library = ["typing_extensions"] |
| 176 | known-first-party = ["openai", "tests"] |
| 177 | |
| 178 | [tool.ruff.per-file-ignores] |
| 179 | "bin/**.py" = ["T201", "T203"] |
| 180 | "tests/**.py" = ["T201", "T203"] |
| 181 | "examples/**.py" = ["T201", "T203"] |
| 182 | |