Files
OpenLLM/pyproject.toml
2023-07-20 20:44:51 -04:00

367 lines
10 KiB
TOML

# NOTE: The following are managed by ./tools/dependencies.py
# project.classifiers, project.dependencies, project.optional-dependencies, project.urls
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
[project]
authors = [{ name = "Aaron Pham", email = "aarnphm@bentoml.com" }]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: GPU :: NVIDIA CUDA",
"Environment :: GPU :: NVIDIA CUDA :: 12",
"Environment :: GPU :: NVIDIA CUDA :: 11.8",
"Environment :: GPU :: NVIDIA CUDA :: 11.7",
"License :: OSI Approved :: Apache Software License",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Intended Audience :: System Administrators",
"Typing :: Typed",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"bentoml[grpc,io]>=1.0.25",
"transformers[torch,tokenizers,accelerate]>=4.29.0",
"safetensors",
"optimum",
"attrs>=23.1.0",
"cattrs>=23.1.0",
"orjson",
"inflection",
"tabulate[widechars]>=0.9.0",
"httpx",
"typing_extensions",
"cuda-python;platform_system!=\"Darwin\"",
"bitsandbytes<0.40",
]
description = 'OpenLLM: Operating LLMs in production'
dynamic = ["version"]
keywords = [
"MLOps",
"AI",
"BentoML",
"Model Serving",
"Model Deployment",
"LLMOps",
"Large Language Model",
"Generative AI",
"StableLM",
"Alpaca",
"PyTorch",
"Transformers",
]
license = "Apache-2.0"
name = "openllm"
readme = "README.md"
requires-python = ">=3.8"
[project.scripts]
openllm = "openllm.cli:cli"
[project.urls]
Blog = "https://modelserving.com"
Discord = "https://l.bentoml.com/join-openllm-discord"
Documentation = "https://github.com/bentoml/openllm#readme"
GitHub = "https://github.com/bentoml/openllm"
History = "https://github.com/bentoml/openllm/blob/main/CHANGELOG.md"
Homepage = "https://bentoml.com"
Tracker = "https://github.com/bentoml/openllm/issues"
Twitter = "https://twitter.com/bentomlai"
[project.optional-dependencies]
agents = ["transformers[agents]>=4.30", "diffusers", "soundfile"]
all = [
"openllm[agents]",
"openllm[baichuan]",
"openllm[chatglm]",
"openllm[falcon]",
"openllm[fine-tune]",
"openllm[flan-t5]",
"openllm[ggml]",
"openllm[gptq]",
"openllm[llama]",
"openllm[mpt]",
"openllm[openai]",
"openllm[opt]",
"openllm[playground]",
"openllm[starcoder]",
"openllm[vllm]",
]
baichuan = ["cpm-kernels", "sentencepiece"]
chatglm = ["cpm-kernels", "sentencepiece"]
falcon = ["einops", "xformers"]
fine-tune = ["peft", "bitsandbytes", "datasets", "accelerate", "deepspeed", "trl"]
flan-t5 = ["flax", "jax", "jaxlib", "tensorflow", "keras"]
ggml = ["ctransformers"]
gptq = ["auto-gptq[triton]"]
llama = ["fairscale", "sentencepiece"]
mpt = ["triton", "einops"]
openai = ["openai", "tiktoken"]
opt = ["flax", "jax", "jaxlib", "tensorflow", "keras"]
playground = ["jupyter", "notebook", "ipython", "jupytext", "nbformat"]
starcoder = ["bitsandbytes"]
vllm = ["vllm", "ray"]
[tool.towncrier]
directory = "changelog.d"
filename = "CHANGELOG.md"
issue_format = "[#{issue}](https://github.com/bentoml/openllm/issues/{issue})"
name = "openllm"
start_string = "<!-- towncrier release notes start -->\n"
template = "changelog.d/template.md.jinja"
title_format = ""
underlines = ["", "", ""]
[[tool.towncrier.section]]
path = ""
[[tool.towncrier.type]]
directory = "breaking"
name = "Backwards-incompatible Changes"
showcontent = true
[[tool.towncrier.type]]
directory = "deprecation"
name = "Deprecations"
showcontent = true
[[tool.towncrier.type]]
directory = "change"
name = "Changes"
showcontent = true
[[tool.towncrier.type]]
directory = "feature"
name = "Features"
showcontent = true
[[tool.towncrier.type]]
directory = "fix"
name = "Bug fix"
showcontent = true
[tool.interrogate]
fail-under = 100
verbose = 2
whitelist-regex = ["test_.*"]
[tool.pytest.ini_options]
addopts = ["-rfEX", "-pno:warnings", "--snapshot-warn-unused"]
python_files = ["test_*.py", "*_test.py"]
testpaths = ["tests"]
[tool.black]
exclude = '''
(
/(
\.eggs
| \.git
| \.tox
| \.venv
| _build
| .build
| bazel-*
| build
| venv
| lib
| dist
| tools
)/
| src/openllm/__about__.py
)
'''
line-length = 119
target-version = ["py38", "py39", "py310", "py311"]
[tool.ruff]
exclude = ["tools", "src/openllm/playground"]
extend-include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"]
extend-select = [
"B", # flake8-bugbear
"I", # isort
"G", # flake8-logging-format
"D", # pydocstyle
"W", # pycodestyle
"Q", # flake8-quotes
"FA", # flake8-future-annotations
"S", # flake8-bandit
"TCH", # flake8-type-checking
"PLW", # pylint-warning
"PLR", # pylint-refactor
"PT", # flake8-pytest-style
"PYI", # flake8-pyi
"PERF", # perflint
"FLY", # flynt
"RUF", # Ruff-specific rules
"YTT", # flake8-2020
]
fix = true
ignore = [
"B027", # Allow non-abstract empty methods in abstract base classes
"FBT003", # Allow boolean positional values in function calls, like `dict.get(... True)`
"S105", # Ignore checks for possible passwords
"S106",
"S107",
"S603", # ignore subprocess.call
"PLR0911",
"PLR0912",
"PLR0913",
"PLR0915",
"PLR2004", # magic value to use constant
"E501", # ignore line length violation
"PYI021", # ignore docstring in stubs, as pyright will include docstring in stubs.
"D103", # Just missing docstring for magic methods.
"D102",
"D101",
"D100",
"TCH004", # don't move runtime import out, just warn about it
"RUF012", # mutable attributes to be used with ClassVar
"B905", # zip warning about strict, only applicable for 3.10+
]
line-length = 119
target-version = "py312"
unfixable = [
"F401", # Don't touch unused imports, just warn about it.
"TCH004", # Don't touch import outside of TYPE_CHECKING block
]
[tool.ruff.flake8-type-checking]
exempt-modules = ["typing", "typing_extensions", "."]
runtime-evaluated-base-classes = [
"pydantic.BaseModel",
"openllm._configuration.LLMConfig",
"openllm._configuration.GenerationConfig",
"openllm._configuration.ModelSettings",
]
runtime-evaluated-decorators = ["attrs.define", "attrs.frozen"]
[tool.ruff.pydocstyle]
convention = "google"
[tool.ruff.pycodestyle]
ignore-overlong-task-comments = true
[tool.ruff.isort]
force-single-line = true
known-first-party = ["openllm", "bentoml", 'transformers']
lines-after-imports = 2
no-lines-before = ["future", "standard-library"]
relative-imports-order = "closest-to-furthest"
[tool.ruff.flake8-quotes]
avoid-escape = false
[tool.ruff.extend-per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"__init__.py" = ["E402", "F401", "F403", "F811"]
"examples/**/*" = ["D"]
"src/openllm/_llm.py" = ["B010", "B009"]
"src/openllm/_strategies.py" = ["B904"]
"src/openllm/_types.py" = ["E402"]
"src/openllm/cli.py" = ["D301", "S101"]
"src/openllm/models/**/*" = ["D106", "S101", "D104"]
"src/openllm/playground/**/*" = ["E402", "F401", "PLR", "D"]
"src/openllm/utils/dummy_*" = ["D107"]
"src/openllm/utils/import_utils.py" = [
"PLW0603", # OK to ignore global access here
"D105", # magic docstring
]
"src/openllm_client/runtimes/*" = ["D107"]
"tests/**/*" = [
"S101",
"TID252",
"D", # No docstring in tests
"PT011", # ignore too broad raises, as it can be use pytest.raises().match()
"S307", # Ignore eval(compile) as it is a known script execution
]
"typings/**/*" = ["D", "F", "E", "PYI002", "I001"]
[tool.coverage.paths]
openllm = ["src/openllm", "*/openllm/src/openllm"]
[tool.coverage.run]
branch = true
omit = [
"__pypackages__/*",
"src/openllm/playground/",
"src/openllm/__init__.py",
"src/openllm/__about__.py",
"src/openllm/__main__.py",
"src/openllm/utils/dummy_*.py",
]
source_pkgs = ["openllm"]
[tool.coverage.report]
exclude_lines = [
"no cov",
"pragma: no cover",
"if __name__ == .__main__.:",
"if t.TYPE_CHECKING:",
'if TYPE_CHECKING:',
'if typing.TYPE_CHECKING:',
'@_overload',
'@overload',
'@t.overload',
'@typing.overload',
'raise NotImplementedError',
]
omit = [
"__pypackages__/*",
"src/openllm/playground/",
"src/openllm/__init__.py",
"src/openllm/__about__.py",
"src/openllm/__main__.py",
"src/openllm/utils/dummy_*.py",
]
precision = 2
show_missing = true
[tool.pyright]
analysis.useLibraryCodeForTypes = true
exclude = [
"__pypackages__/*",
"src/openllm/playground/",
"src/openllm/__init__.py",
"src/openllm/__about__.py",
"src/openllm/__main__.py",
"src/openllm/utils/dummy_*.py",
]
include = ["src/openllm", "src/openllm_client", "tests/", "tools/", "examples/"]
pythonVersion = "3.12"
reportMissingImports = "warning"
reportMissingTypeStubs = false
reportPrivateUsage = "warning"
reportUnknownArgumentType = "warning"
reportUnknownMemberType = "warning"
reportUnknownVariableType = "warning"
typeCheckingMode = "strict"
[tool.mypy]
disable_error_code = ["attr-defined", "name-defined", "annotation-unchecked"]
enable_error_code = ["redundant-expr"]
exclude = ["examples/", "tools/", "tests/", "src/openllm/playground/"]
files = ["src/openllm", "src/openllm_client"]
mypy_path = "typings"
pretty = true
python_version = "3.11"
show_error_codes = true
strict = true
warn_return_any = false
warn_unreachable = true
warn_unused_ignores = true
[[tool.mypy.overrides]]
ignore_missing_imports = true
module = [
"IPython.*",
"numpy.*",
"tensorflow.*",
"torch.*",
"optimum.*",
"inflection.*",
"huggingface_hub.*",
"peft.*",
"auto_gptq.*",
"vllm.*",
]
[[tool.mypy.overrides]]
ignore_errors = true
module = ["openllm.models.*", "openllm._types", "openllm", "openllm.playground.*"]