Files
OpenLLM/pyproject.toml
2023-06-23 21:24:53 -04:00

233 lines
5.8 KiB
TOML

[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
[project]
authors = [{ name = "Aaron Pham", email = "aarnphm@bentoml.com" }]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: Apache Software License",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries",
"Operating System :: OS Independent",
"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 :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
# NOTE: The below is managed by ./tools/update-optional-dependencies.py
dependencies = [
"bentoml[grpc,io]>=1.0.22",
"transformers[torch,tokenizers,accelerate]>=4.29.0",
"optimum",
"attrs>=23.1.0",
"cattrs>=23.1.0",
"orjson",
"inflection",
"tabulate[widechars]>=0.9.0",
"httpx",
"typing_extensions",
]
description = 'OpenLLM: REST/gRPC API server for running any open Large-Language Model - StableLM, Llama, Alpaca, Dolly, Flan-T5, Custom'
dynamic = ["version"]
keywords = [
"MLOps",
"AI",
"BentoML",
"Model Serving",
"Model Deployment",
"LLMOps",
"Large Language Model",
"Generative AI",
"Stable Diffusion",
"StableLM",
"Alpaca",
"PyTorch",
"Transformers",
]
license = "Apache-2.0"
name = "openllm"
readme = "README.md"
requires-python = ">=3.8"
# NOTE: Don't modify project.optional-dependencies
# as it is managed by ./tools/update-optional-dependencies.py
[project.optional-dependencies]
agents = ["transformers[agents]>=4.30", "diffusers", "soundfile"]
all = [
"openllm[chatglm]",
"openllm[starcoder]",
"openllm[falcon]",
"openllm[agents]",
"openllm[flan-t5]",
"openllm[fine-tune]",
"openllm[openai]",
]
chatglm = ["cpm_kernels", "sentencepiece"]
falcon = ["einops", "xformers", "safetensors"]
fine-tune = ["peft", "bitsandbytes", "datasets", "accelerate", "deepspeed"]
flan-t5 = ["flax", "jax", "jaxlib", "tensorflow", "keras"]
openai = ["openai", "tiktoken"]
starcoder = ["bitsandbytes"]
[project.urls]
Documentation = "https://github.com/bentoml/openllm#readme"
Issues = "https://github.com/bentoml/openllm/issues"
Source = "https://github.com/bentoml/openllm"
[project.scripts]
openllm = "openllm.cli:cli"
[tool.hatch.version]
path = "src/openllm/__about__.py"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["src/openllm", "src/openllm_client"]
[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.hatch.envs.all.matrix]]
python = ["3.8", "3.9", "3.10", "3.11"]
[tool.interrogate]
fail-under = 100
verbose = 2
whitelist-regex = ["test_.*"]
[tool.pytest.ini_options]
addopts = ["-rfEX", "-pno:warnings"]
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 = ["py311"]
[tool.ruff]
exclude = ["tools"]
ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
# Allow boolean positional values in function calls, like `dict.get(... True)`
"FBT003",
# Ignore complexity
"C901",
# Never enforce `E501` (line length violations).
"E501",
"E741",
]
line-length = 119
select = ["C", "E", "F", "I", "W"]
target-version = "py311"
unfixable = [
"F401", # Don't touch unused imports, just warn about it.
]
[tool.ruff.pydocstyle]
convention = "google"
[tool.ruff.isort]
force-single-line = true
known-first-party = ["openllm", "bentoml", 'transformers']
lines-after-imports = 2
[tool.ruff.per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"__init__.py" = ["E402", "F401", "F403", "F811"]
"src/openllm/_types.py" = ["E402"]
"src/openllm/playground/**/*" = ['E402', 'F401']
"tests/**/*" = ["PLR2004", "S101", "TID252"]
[tool.pyright]
analysis.useLibraryCodeForTypes = true
enableTypeIgnoreComments = true
include = ["src/", "tests/", "tools/", "examples/"]
pythonVersion = "3.11"
reportMissingImports = "none"
reportMissingModuleSource = "warning"
reportMissingTypeStubs = "warning"
reportUnknownMemberType = "warning"
reportUnknownVariableType = "warning"
strictDictionaryInference = true
strictListInference = true
strictParameterNoneValue = true
strictSetInference = true
typeCheckingMode = "strict"
[tool.coverage.run]
branch = true
omit = ["src/openllm/__about__.py"]
parallel = true
source_pkgs = ["openllm", "tests"]
[tool.coverage.paths]
openllm = ["src/openllm", "*/openllm/src/openllm"]
tests = ["tests", "*/openllm/tests"]
[tool.coverage.report]
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if t.TYPE_CHECKING:"]