-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathpyproject.toml
More file actions
113 lines (100 loc) · 2.97 KB
/
pyproject.toml
File metadata and controls
113 lines (100 loc) · 2.97 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
[project]
name = "genai-prices-root"
version = "0"
description = "Database of prices for calling LLM models."
readme = "README.md"
authors = [{ name = "Samuel Colvin", email = "samuel@pydantic.dev" }]
requires-python = ">=3.9"
# Do not publish this package to PyPI
classifiers = ["Private :: do not release"]
dependencies = []
[dependency-groups]
dev = [
"anyio>=4.9.0",
"basedpyright>=1.30.1",
"coverage[toml]>=7.9.2",
"devtools>=0.12.2",
"dirty-equals>=0.9.0",
"inline-snapshot[black]>=0.23.2",
"ipython>=8.18.1",
"pytest>=8.4.1",
"pytest-pretty>=1.3.0",
"pytest-recording>=0.13.4",
"pydantic-settings>=2.11",
"rich>=14.3.2",
"rich-argparse>=1.7.2",
"ruff>=0.12.3",
"boto3-stubs[bedrock,pricing]>=1.40.75",
"boto3>=1.40.75",
]
[tool.uv.workspace]
members = ["prices", "packages/python"]
[tool.ruff]
line-length = 120
target-version = "py39"
include = ["prices/src/**/*.py", "packages/python/**/*.py", "tests/**/*.py"]
[tool.ruff.lint]
extend-select = ["Q", "RUF100", "C90", "UP", "I"]
flake8-quotes = { inline-quotes = "single", multiline-quotes = "double" }
isort = { combine-as-imports = true, known-first-party = ["genai_prices"] }
mccabe = { max-complexity = 18 }
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"packages/python/genai_prices/data.py" = ["F405", "F403"]
[tool.ruff.format]
# don't format python in docstrings, pytest-examples takes care of it
docstring-code-format = false
quote-style = "single"
[tool.pytest.ini_options]
testpaths = "tests"
xfail_strict = true
filterwarnings = ["error"]
markers = [
"requires_latest_pydantic: marks tests that require Pydantic >2.10 for schema generation",
]
# https://coverage.readthedocs.io/en/latest/config.html#run
[tool.coverage.run]
include = [
# "prices/src/prices/**/*.py",
"packages/python/**/*.py",
"tests/**/*.py",
]
branch = true
# https://coverage.readthedocs.io/en/latest/config.html#report
[tool.coverage.report]
skip_covered = true
show_missing = true
ignore_errors = true
precision = 2
exclude_lines = [
'pragma: no cover',
'raise NotImplementedError',
'if TYPE_CHECKING:',
'if typing.TYPE_CHECKING:',
'@overload',
'@deprecated',
'@typing.overload',
'@abstractmethod',
'\(Protocol\):$',
'typing.assert_never',
'$\s*assert_never\(',
'if __name__ == .__main__.:',
'$\s*pass$',
]
[tool.pyright]
pythonVersion = "3.12"
typeCheckingMode = "strict"
reportUnnecessaryTypeIgnoreComment = true
reportIgnoreCommentWithoutRule = true
reportUnusedParameter = true
reportIncompatibleUnannotatedOverride = true
reportImplicitAbstractClass = true
include = ["prices/src", "packages/python", "tests"]
venv = ".venv"
executionEnvironments = [{ root = "tests", reportPrivateUsage = false }]
[tool.codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = "prices/data.json,package-lock.json"
[tool.inline-snapshot]
format-command = "ruff format --stdin-filename {filename}"