-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpyproject.toml
More file actions
152 lines (137 loc) · 3.58 KB
/
pyproject.toml
File metadata and controls
152 lines (137 loc) · 3.58 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 = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"
[project]
name = "opensafely-ehrql"
description = ""
version = "2+local"
readme = "README.md"
authors = [{name = "OpenSAFELY", email = "tech@opensafely.org"}]
license-files = ["LICENSE"]
license = "GPL-3.0-or-later"
requires-python = ">=3.13"
dependencies = [
"pyarrow",
"sqlalchemy",
# Database driver for MS-SQL
"pymssql",
# Trino python client and database driver
"trino",
# Gives us isolation from the system version of SQLite and means we don't
# need to worry about e.g. some versions of SQLite missing the `FLOOR`
# function.
"sqlean.py",
# For graphing query graphs
"networkx",
"pydot",
# speed up for dummy data next generation
"numpy",
]
[project.scripts]
ehrql = "ehrql.__main__:entrypoint"
[project.urls]
Home = "https://opensafely.org"
Documentation = "https://docs.opensafely.org"
Source = "https://github.com/opensafely-core/ehrql"
[tool.coverage.run]
branch = true
[tool.coverage.report]
fail_under = 100
skip_covered = true
exclude_also = [
# this indicates that the line should never be hit
"assert False",
# this condition is only true when a module is run as a script
'if __name__ == "__main__":',
# this indicates that a method should be defined in a subclass
"raise NotImplementedError",
# this is just for type hints and doesn't appear in the runtime code
"@overload",
# function used for defining test fixture code inline
"@function_body_as_string",
# Custom multiline pragma to allow excluding whole files. See:
# https://coverage.readthedocs.io/en/7.11.0/excluding.html#multi-line-exclusion-regexes
'\A(?s:.*# pragma: no cover file.*)\Z',
]
omit = [
"tests/acceptance/external_studies/*",
]
[tool.coverage.html]
[tool.flit.module]
name = "ehrql"
[tool.pydocstyle]
convention = "google"
add_select = [
"D213",
]
# Base ignores for all docstrings, for module/package specific ones add them to
# the CLI args in justfile
add_ignore = [
"D100",
"D104",
"D107",
"D212",
]
[tool.pytest.ini_options]
addopts = "--tb=native --strict-markers --dist=loadgroup -p no:legacypath"
testpaths = ["tests"]
filterwarnings = [
# ignnore dbapi() deprecation warnings for the third party TrinoDialect that we subclass
"ignore:.*dbapi.*TrinoDialect.*:sqlalchemy.exc.SADeprecationWarning",
# ignore warning about pydot being unmaintained; there's no obvious easy-to-install replacement
"ignore:.*nx.nx_pydot.to_pydot.*:DeprecationWarning",
]
[tool.ruff]
line-length = 88
exclude = [
".direnv",
".git",
".github/",
".ipynb_checkpoints",
".pytest_cache",
".venv/",
"__pycache__",
"coverage/",
"docker/",
"docs/",
"htmlcov/",
"tests/acceptance/external_studies/",
"tests/fixtures/bad_definition_files",
"venv/",
]
[tool.ruff.lint]
extend-select = [
"A", # flake8-builtins
"I", # isort
"INP", # flake8-no-pep420
"UP", # pyupgrade
"W", # pycodestyle warning
]
extend-ignore = [
"A005", # ignore stdlib-module-shadowing
"E501", # line-too-long
"UP032", # replace `.format` with f-string
]
isort.lines-after-imports = 2
# Note: any `exclude-newer-package` timestamps should be removed if > 7 days old
# See https://github.com/opensafely-core/repo-template/blob/main/DEVELOPERS.md for details
[tool.uv]
exclude-newer = "2026-04-15T00:00:00Z"
exclude-newer-package = {}
[dependency-groups]
dev = [
"docker",
"hypothesis",
"openpyxl>=3.1.5",
"pre-commit",
"pyright[nodejs]",
"pytest",
"pytest-cov",
"pytest-mock",
"pytest-xdist",
"ruff",
"toml",
# docs
"mkdocs",
"mkdocs-material",
]