forked from LayerLens/stratix-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
152 lines (132 loc) · 4.34 KB
/
Copy pathpyproject.toml
File metadata and controls
152 lines (132 loc) · 4.34 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.version]
path = "src/layerlens/_version.py"
pattern = '__version__ = "(?P<version>[^"]+)"'
[project]
name = "layerlens"
dynamic = ["version"]
description = "The official Python library for the LayerLens Stratix API"
license = "Apache-2.0"
authors = [{ name = "LayerLens", email = "support@layerlens.ai" }]
dependencies = ["httpx>=0.23.0, <1", "pydantic>=1.9.0, <3"]
requires-python = ">= 3.8"
classifiers = [
"Typing :: Typed",
"Intended Audience :: Developers",
"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 :: 3.13",
"Operating System :: OS Independent",
"Operating System :: POSIX",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Topic :: Software Development :: Libraries :: Python Modules",
]
[project.optional-dependencies]
cli = ["click>=8.0.0"]
[project.urls]
Homepage = "https://github.com/LayerLens/stratix-python"
Repository = "https://github.com/LayerLens/stratix-python"
[project.scripts]
layerlens = "layerlens.cli:main"
stratix = "layerlens.cli:main"
[tool.rye]
managed = true
# version pins are in requirements-dev.lock
dev-dependencies = [
"mypy",
"pytest",
"pyright==1.1.399",
"pytest-cov>=6.2.1",
"ruff",
"build",
"twine==6.1.0",
"click>=8.0.0",
]
[tool.rye.scripts]
format = { chain = [
"format:ruff",
"fix:ruff",
# run formatting again to fix any inconsistencies when imports are stripped
"format:ruff",
] }
"format:ruff" = "ruff format"
"lint" = { chain = ["check:ruff", "typecheck:src", "check:importable"] }
"lint:all" = { chain = ["check:ruff", "typecheck", "check:importable"] }
"check:ruff" = "ruff check ."
"fix:ruff" = "ruff check --fix ."
"check:importable" = "python -c 'import layerlens'"
# Type checking for production code only (excludes tests)
"typecheck:src" = { chain = ["typecheck:pyright:src", "typecheck:mypy:src"] }
# Type checking for all code including tests
typecheck = { chain = ["typecheck:pyright", "typecheck:mypy"] }
"typecheck:pyright" = "pyright"
"typecheck:pyright:src" = "pyright src"
"typecheck:verify-types" = "pyright --verifytypes layerlens --ignoreexternal"
"typecheck:mypy" = "mypy ."
"typecheck:mypy:src" = "mypy src"
[tool.ruff]
line-length = 120
output-format = "grouped"
target-version = "py37"
exclude = ["samples"]
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint]
select = [
# isort
"I",
# bugbear rules
"B",
# remove unused imports
"F401",
# bare except statements
"E722",
# unused arguments
"ARG",
# print statements
"T201",
"T203",
# misuse of typing.TYPE_CHECKING
"TC004",
# import rules
"TID251",
]
ignore = [
# mutable defaults
"B006",
]
unfixable = [
# disable auto fix for print statements
"T201",
"T203",
]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead"
[tool.ruff.lint.isort]
length-sort = true
length-sort-straight = true
combine-as-imports = true
extra-standard-library = ["typing_extensions"]
known-first-party = ["openai", "tests"]
[tool.ruff.lint.per-file-ignores]
"bin/**.py" = ["T201", "T203"]
"scripts/**.py" = ["T201", "T203"]
"tests/**.py" = ["T201", "T203", "ARG", "B007"]
"examples/**.py" = ["T201", "T203"]
"src/layerlens/cli/**" = ["T201", "T203"]
[tool.pyright]
include = ["src", "tests"]
exclude = ["**/__pycache__"]
reportMissingTypeStubs = false
# Less strict settings for tests and cli
executionEnvironments = [
{ root = "src/layerlens/cli", reportMissingImports = false, reportFunctionMemberAccess = false, reportCallIssue = false, reportArgumentType = false, reportAttributeAccessIssue = false },
{ root = "tests", reportGeneralTypeIssues = false, reportOptionalSubscript = false, reportOptionalMemberAccess = false, reportUntypedFunctionDecorator = false, reportUnknownArgumentType = false, reportUnknownMemberType = false, reportUnknownVariableType = false, reportUnnecessaryIsInstance = false, reportUnnecessaryComparison = false, reportArgumentType = false, reportCallIssue = false },
]