-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
210 lines (194 loc) · 5.21 KB
/
pyproject.toml
File metadata and controls
210 lines (194 loc) · 5.21 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
[project]
name = "times-square"
description = "Times Square is a service for parameterized Jupyter Notebooks as dynamic webpages."
license = "MIT"
license-files = ["LICENSE"]
readme = "README.md"
keywords = ["rubin", "lsst"]
# https://pypi.org/classifiers/
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.13",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: POSIX",
"Private :: Do Not Upload",
"Typing :: Typed",
]
requires-python = ">=3.13"
# Use requirements/main.in for runtime dependencies instead.
dependencies = [
"fastapi",
"gunicorn",
"starlette",
"uvicorn[standard]",
"safir[db,arq,redis]",
"alembic[tz]",
"pydantic[email]",
"pydantic_settings",
"click",
"nbformat",
"nbconvert",
"jsonschema",
"jinja2",
"gidgethub",
"markdown-it-py[linkify,plugins]",
"mdformat",
"mdformat-gfm",
"PyYAML",
"sentry-sdk",
"sse-starlette",
"nbstripout>=0.8.1",
"python-dateutil>=2.9.0.post0",
]
dynamic = ["version"]
[project.scripts]
times-square = "timessquare.cli:main"
[project.urls]
Homepage = "https://times-square.lsst.io"
Source = "https://github.com/lsst-sqre/times-square"
[build-system]
requires = ["setuptools>=61", "wheel", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"
[dependency-groups]
dev = [
"asgi-lifespan",
"coverage[toml]",
"httpx",
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-mock",
"uvicorn",
"respx",
"httpx-sse == 0.4.0",
"holdup",
"scriv",
"freezegun>=1.5.2",
]
docs = [
"documenteer[guide]>=1.0",
]
lint = [
"pre-commit",
"pre-commit-uv",
"ruff",
]
tox = [
"tox",
"tox-uv",
"tox-docker",
]
typing = [
"mypy",
"sqlalchemy[mypy]",
"types-PyYAML",
"types-python-dateutil"
]
[tool.setuptools_scm]
[tool.coverage.run]
parallel = true
branch = true
source = ["timessquare"]
[tool.coverage.paths]
source = ["src", ".tox/*/site-packages"]
[tool.coverage.report]
show_missing = true
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:"
]
[tool.pytest.ini_options]
asyncio_default_fixture_loop_scope = "function"
asyncio_mode = "strict"
python_files = [
"tests/*.py",
"tests/*/*.py"
]
[tool.mypy]
disallow_untyped_defs = true
disallow_incomplete_defs = true
ignore_missing_imports = true
local_partial_types = true
plugins = ["sqlalchemy.ext.mypy.plugin", "pydantic.mypy"]
no_implicit_reexport = true
show_error_codes = true
strict_equality = true
warn_redundant_casts = true
warn_unreachable = true
warn_unused_ignores = true
[[tool.mypy.overrides]]
# In order to use private members of the dateutil rruleset; a necessary evil
module = "timessquare.domain.schedule"
disable_error_code = ["attr-defined"]
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
warn_untyped_fields = true
[tool.scriv]
categories = [
"Backwards-incompatible changes",
"New features",
"Bug fixes",
"Other changes",
]
entry_title_template = "{{ version }} ({{ date.strftime('%Y-%m-%d') }})"
format = "md"
md_header_level = "2"
new_fragment_template = "file:changelog.d/_template.md.jinja"
skip_fragments = "_template.md.jinja"
# The rule used with Ruff configuration is to disable every lint that has
# legitimate exceptions that are not dodgy code, rather than cluttering code
# with noqa markers. This is therefore a reiatively relaxed configuration that
# errs on the side of disabling legitimate lints.
#
# Reference for settings: https://beta.ruff.rs/docs/settings/
# Reference for rules: https://beta.ruff.rs/docs/rules/
[tool.ruff]
extend = "ruff-shared.toml"
extend-exclude = [
"tests/data/**",
]
[tool.ruff.lint.per-file-ignores]
"alembic/env.py" = [
"INP001", # Alembic config isn't a package
]
"alembic/versions/**" = [
"INP001", # Alembic config isn't a package
"D103", # Alembic migrations don't need docstrings
]
"src/timessquare/config.py" = [
"FBT001", # Pydantic validators take boolean arguments
]
"src/timessquare/sentry.py" = [
"S311", # We're not using random.random for cryptography
]
"src/timessquare/domain/schedule.py" = [
"SLF001", # Necessary evil to use private members
]
"tests/**" = [
"C901", # tests are allowed to be complex, sometimes that's convenient
"D101", # tests don't need docstrings
"D103", # tests don't need docstrings
"PLR0915", # tests are allowed to be long, sometimes that's convenient
"PT012", # way too aggressive about limiting pytest.raises blocks
"S101", # tests should use assert
"S106", # tests are allowed to hard-code dummy passwords
"SLF001", # tests are allowed to access private members
"T201", # tests are allowed to use print
"ASYNC221", # async tests are allowed to use sync functions
]
[tool.ruff.lint.isort]
known-first-party = ["timessquare", "tests"]
known-third-party = ["alembic"]
split-on-trailing-comma = false