openai/openai-python
Publicmirrored from https://github.com/openai/openai-pythonAvailable
pyproject.toml
181lines · modeblame
08b8179aDavid Schnurr2 years ago | 1 | [project] |
| 2 | name = "openai" | |
8ee5f33estainless-app[bot]2 years ago | 3 | version = "1.13.0" |
b185cb31Stainless Bot2 years ago | 4 | description = "The official Python library for the openai API" |
08b8179aDavid Schnurr2 years ago | 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", | |
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 = [ |
e967f5a5Stainless Bot2 years ago | 53 | "pyright", |
| 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", |
08b8179aDavid Schnurr2 years ago | 63 | "azure-identity >=1.14.1", |
| 64 | "types-tqdm > 4" | |
| 65 | ] | |
| 66 | | |
| 67 | [tool.rye.scripts] | |
| 68 | format = { chain = [ | |
| 69 | "format:ruff", | |
e1b60b22Stainless Bot2 years ago | 70 | "format:docs", |
| 71 | "fix:ruff", | |
08b8179aDavid Schnurr2 years ago | 72 | ]} |
| 73 | "format:black" = "black ." | |
e1b60b22Stainless Bot2 years ago | 74 | "format:docs" = "python bin/ruffen-docs.py README.md api.md" |
| 75 | "format:ruff" = "ruff format" | |
8ad790aeStainless Bot2 years ago | 76 | "format:isort" = "isort ." |
08b8179aDavid Schnurr2 years ago | 77 | |
0f093469Stainless Bot2 years ago | 78 | "lint" = { chain = [ |
| 79 | "check:ruff", | |
| 80 | "typecheck", | |
| 81 | ]} | |
08b8179aDavid Schnurr2 years ago | 82 | "check:ruff" = "ruff ." |
e1b60b22Stainless Bot2 years ago | 83 | "fix:ruff" = "ruff --fix ." |
08b8179aDavid Schnurr2 years ago | 84 | |
| 85 | typecheck = { chain = [ | |
| 86 | "typecheck:pyright", | |
| 87 | "typecheck:mypy" | |
| 88 | ]} | |
| 89 | "typecheck:pyright" = "pyright" | |
| 90 | "typecheck:verify-types" = "pyright --verifytypes openai --ignoreexternal" | |
a7ebc260Stainless Bot2 years ago | 91 | "typecheck:mypy" = "mypy ." |
08b8179aDavid Schnurr2 years ago | 92 | |
ca2fbacfDamien Deville3 years ago | 93 | [build-system] |
08b8179aDavid Schnurr2 years ago | 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"] | |
86dff298Jon Bringhurst3 years ago | 104 | |
db4750c1Henrique Oliveira Pinto4 years ago | 105 | [tool.black] |
08b8179aDavid Schnurr2 years ago | 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 | |
db4750c1Henrique Oliveira Pinto4 years ago | 135 | |
08b8179aDavid Schnurr2 years ago | 136 | [tool.ruff] |
| 137 | line-length = 120 | |
e967f5a5Stainless Bot2 years ago | 138 | output-format = "grouped" |
08b8179aDavid Schnurr2 years ago | 139 | target-version = "py37" |
| 140 | select = [ | |
a47375b7Stainless Bot2 years ago | 141 | # isort |
| 142 | "I", | |
e967f5a5Stainless Bot2 years ago | 143 | # bugbear rules |
| 144 | "B", | |
08b8179aDavid Schnurr2 years ago | 145 | # 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 ago | 154 | # misuse of typing.TYPE_CHECKING |
| 155 | "TCH004" | |
08b8179aDavid Schnurr2 years ago | 156 | ] |
e967f5a5Stainless Bot2 years ago | 157 | ignore = [ |
| 158 | # mutable defaults | |
| 159 | "B006", | |
| 160 | ] | |
08b8179aDavid Schnurr2 years ago | 161 | unfixable = [ |
| 162 | # disable auto fix for print statements | |
| 163 | "T201", | |
| 164 | "T203", | |
| 165 | ] | |
| 166 | ignore-init-module-imports = true | |
| 167 | | |
e1b60b22Stainless Bot2 years ago | 168 | [tool.ruff.format] |
| 169 | docstring-code-format = true | |
08b8179aDavid Schnurr2 years ago | 170 | |
a47375b7Stainless Bot2 years ago | 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 | | |
08b8179aDavid Schnurr2 years ago | 178 | [tool.ruff.per-file-ignores] |
| 179 | "bin/**.py" = ["T201", "T203"] | |
| 180 | "tests/**.py" = ["T201", "T203"] | |
| 181 | "examples/**.py" = ["T201", "T203"] |