-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathpyproject.toml
More file actions
138 lines (123 loc) · 4 KB
/
pyproject.toml
File metadata and controls
138 lines (123 loc) · 4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# SPDX-License-Identifier: Apache-2.0
[build-system]
requires = ["setuptools>=70.1.0", "setuptools_scm>=8", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "granite-common"
authors = [
{ name = "Fred Reiss", email = "frreiss@us.ibm.com" },
{ name = "Gabe Goodhart", email = "ghart@us.ibm.com" },
{ name = "Mark Sturdevant", email = "mark.sturdevant@ibm.com" },
{ name = "Martin Hickey", email = "martin.hickey@ie.ibm.com" },
{ name = "Khoi-Nguyen Tran", email = "kndtran@ibm.com" },
]
description = "Input and output processing for IBM Granite models"
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: Apache Software License",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
]
dynamic = ["version"]
dependencies = [
"jsonschema",
"pydantic >= 2.0.0, < 3.0", # LiteLLM requires >= 2
]
[project.optional-dependencies]
transformers = ["transformers[torch]", "peft", "huggingface-hub", "xgrammar"]
nltk = ["nltk~=3.9.1"]
gpt-oss = ["triton>=3.4", "accelerate", "kernels"]
retriever = ["sentence-transformers", "pyarrow", "elasticsearch>=8.0.0,<9.0.0"]
dev = [
"isort==8.0.0",
"pre-commit>=3.0.4,<5.0",
"pylint>=2.16.2,<5.0",
"pylint-pydantic",
"pytest",
"pytest-cov",
"pytest-html",
"pytest-retry~=1.7",
"pytest-xdist",
"pytest-recording", # Used for blocking network access
"ruff==0.15.2",
"tox",
"anywidget",
"ipywidgets",
"requests",
"openai",
"huggingface-hub",
"granite-common[transformers]",
"granite-common[nltk]",
"granite-common[gpt-oss]",
"granite-common[retriever]",
]
# Dependencies needed for running notebooks. Update as required.
notebook = [
"notebook",
"aiohttp", # For AIO in notebooks
"requests",
"openai",
"nltk",
"huggingface-hub",
]
all = ["granite-common[dev]", "granite-common[notebook]"]
[project.urls]
homepage = "https://github.com/ibm-granite/granite-common"
source = "https://github.com/ibm-granite/granite-common"
issues = "https://github.com/ibm-granite/granite-common/issues"
[tool.setuptools]
package-dir = { "" = "src" }
[tool.setuptools_scm]
version_file = "src/granite_common/_version.py"
# do not include +gREV local version, required for Test PyPI upload
local_scheme = "no-local-version"
[tool.setuptools.packages.find]
where = ["src"]
include = ["granite_common", "granite_common*"]
[tool.ruff]
target-version = "py310"
# same as Black's default line length
line-length = 88
[tool.ruff.lint]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# modern type annotations
extend-safe-fixes = ["UP006", "UP007"]
# Fixers will be enabled gradually.
select = [
"B", # flake8-bugbear
"E", # pycodestyle
"F", # Pyflakes
"Q", # flake8-quotes
# Ruff does not support isort's import_headings feature, yet.
# "I", # isort
"UP", # pyupgrade
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
]
ignore = []
[tool.ruff.lint.isort]
# same as .isort.cfg except for settings that are commented out as that are not yet supported
# profile="black"
from-first = true
# import_heading_future="Future"
# import_heading_stdlib="Standard"
# import_heading_thirdparty="Third Party"
# import_heading_firstparty="First Party"
# import_heading_localfolder="Local"
known-local-folder = ["src/granite_common", "tests"]
# extend-skip="src/granite_io/_version.py"
[tool.pytest.ini_options]
# Run tests in parallel.
# Use work stealing to compensate for skew in test running times.
# Temporarily disabled because it is not compatible with --isolate
addopts = "-n auto --dist worksteal"