-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
171 lines (149 loc) · 3.79 KB
/
pyproject.toml
File metadata and controls
171 lines (149 loc) · 3.79 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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
[project]
name = "translator_tom"
version = "1.0.3"
description = "TRAPI Object Models: A performant python data model and centralized utilities for the Translator Reasoner API."
readme = "README.md"
requires-python = ">=3.10"
authors = [
{ name = "Willow Callaghan", email = "43009413+tokebe@users.noreply.github.com" },
]
dependencies = [
"bmt>=1.4.6",
"orjson>=3.11.3",
"ormsgpack>=1.11.0",
"pydantic>=2.12.0",
"pydantic-core>=2.41.1",
"pydantic-settings>=2.13.1",
"stablehash>=0.3.0",
"typing-extensions>=4.15.0",
]
classifiers = [
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
[project.urls]
Homepage = "https://github.com/NCATSTranslator/TRAPIObjectModeling"
Repository = "https://github.com/NCATSTranslator/TRAPIObjectModeling"
Issues = "https://github.com/NCATSTranslator/TRAPIObjectModeling/issues"
[dependency-groups]
dev = [
"bpython>=0.25",
"deptry>=0.23.1",
"pre-commit>=4.3.0",
"pyinstrument>=5.1.1",
"pytest>=8.4.2",
"pytest-cov>=7.0.0",
"reasoner-pydantic>=6.0.0",
"ruff>=0.13.3",
"taskipy>=1.14.1",
"ty>=0.0.34",
]
[tool.uv]
config-settings = { editable_mode = "compat" }
package = true
[tool.taskipy.tasks]
# Code work
hook = "pre-commit install"
lint = 'ruff check src'
'lint:stats' = 'task lint --statistics'
'lint:watch' = 'task lint --watch'
'lint:fix' = 'task lint --fix'
typecheck = 'ty check src'
'typecheck:watch' = 'task typecheck --watch'
format = 'ruff format --diff src'
'format:fix' = 'ruff format src'
test = 'pytest --cov=src --cov-config=pyproject.toml --cov-report term-missing'
fixup = """
echo 'Linting...' &&
task lint:fix &&
echo 'Formatting...' &&
task format:fix &&
echo 'Static analysis...' &&
task typecheck &&
echo 'Check dependencies...' &&
deptry src &&
echo "✅ All set!"
"""
[tool.ruff]
include = ["src/*.py"]
line-length = 88
indent-width = 4
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["D", "PLR2004", "ANN201"]
[tool.ruff.lint]
select = [
# All of these were carefully chosen, see https://docs.astral.sh/ruff/rules
# Pyflakes
'F',
# Pycodestyle errors, warning
'E4',
'E7',
'E9',
'W',
# isort (sort imports)
'I',
# Pydocstyle (document your code!)
'D',
# Pep8 naming conventions (but slightly less pedantic)
'N80',
# Pyupgrade (use newer conventions)
'UP',
# Flake8-bugbear
'B',
# Flake8-annotations (require type annotations)
'ANN0',
'ANN2',
# Flake8-builtins (don't overwrite builtins)
'A',
# Flake8-comprehensions
'C4',
# Flake8-logging-format
'G',
# Flake8-simplify
'SIM',
# Flake8-use-pathlib (pathlib is just better)
'PTH',
# Pylint
'PL',
# FastAPI
'FAST',
# Perflint
'PERF',
# Refurb
'FURB',
# Ruff-specific
'RUF',
]
ignore = ['D100', 'D206', 'D300']
[tool.ruff.lint.pydocstyle]
convention = 'google'
[tool.ruff.lint.flake8-comprehensions]
allow-dict-calls-with-keyword-arguments = true
[tool.ruff.format]
docstring-code-format = true
[tool.deptry]
extend_exclude = ["locustfile.py", "tests"]
known_first_party = ["trapi_object_modeling"]
[tool.deptry.per_rule_ignores]
DEP002 = [
"orjson", # Used by FastAPI to speed up JSON serialization
]
[tool.pytest.ini_options]
norecursedirs = ["utils"]
log_cli = true
log_cli_level = "INFO"
markers = [
"bench: heavy benchmarks; skipped unless the test file is named explicitly on the command line",
]
[tool.coverage.run]
branch = true
relative_files = true
omit = ["tests/*"]
[tool.coverage.paths]
source = ["src"]
[tool.coverage.report]
include_namespace_packages = true